Skip to content
ℕ𝔸𝕊𝔸™ℕ𝕒𝕤𝕒𝕣𝕖™𝕊𝕡𝕒𝕔𝕖𝕏™ https://nasa.re/

Nasare™🚀

フレッシュ スペース & テクノロジー NEWS📢

  • About 𝒩𝒶𝓈𝒶𝓇𝑒™
  • SMART Tools
  • SMART AI
    • Kubeshark PCAP Export/Import
    • Coaching engineering managers to employ on organizational issues
    • Zelda: Hyperlink’s Awakening game engine documentation (2021)
    • Commercial Resupply Services-CRS
  • Show HN
    • WINd3x、iPod Bootrom エクスプロイトは 10 年遅かった
    • Just by Notでプログラミングするシステム オブジェクト指向プログラミングの活用
    • 主な BGP 増加をレジデンス Windows デスクトップに追加する
    • ガジェットの複雑さが増し、余分な IP の再利用が促進される
    • 新しい GitHub CLI 拡張インストゥルメント
    • Kubernetes を 7,500 ノードにスケーリング (2021 年)
    • Wander アプリ用の軽量なオンザフリット構成ライブラリ
    • Ask HN
      • Declare HN: I wrote a WebAssembly Interpreter and Toolkit in C
      • Describe HN: Kandria, an action RPG made in Frequent Voice, is now out
      • Demonstrate HN: ClickHouse-local – a runt instrument for serverless files analytics
      • Brand HN: Motion photographs Watchlist Chrome Extension
      • Existing HN: Connmap – Desktop widget that reveals your TCP company on an international diagram
      • Level to HN: An initiate source tool to generate Jet Engine compressors
      • Insist HN: Ov – characteristic smartly off terminal pager
      • Level to HN: Graphic-Walker – A special kind of originate-offer different to Tableau
      • Level to HN: A corpulent game of snake encoded in a url
      • Point out HN: Kweb: A a ways away interface to the earn browser’s DOM
      • Present HN: Nanelo DNS – Privacy-Kindly, European Nameservers
      • Reward HN: Vim on-line editor the exercise of WebAssembly, storing files the exercise of IndexedDB
      • Show HN: AREnets – TensorFlow-basically based mostly Relation Extraction equipment for work in Colab
      • Speak HN: What sub $200 product improved HN readers’ 2022
      • Uncover HN: Easy internet app for teenagers to management a single Philips Hue light
      • Advise HN: Daft Art – an album veil maker powered by AI and curated aesthetics
    • Show HN
      • Reward HN: Vim on-line editor the exercise of WebAssembly, storing files the exercise of IndexedDB
      • Android phones will at the moment obtain iPhone-love SOS satellite texting
      • Demonstrate HN: ClickHouse-local – a runt instrument for serverless files analytics
      • Show HN: AREnets – TensorFlow-basically based mostly Relation Extraction equipment for work in Colab
      • Present HN: Nanelo DNS – Privacy-Kindly, European Nameservers
      • Insist HN: Ov – characteristic smartly off terminal pager
      • Level to HN: An initiate source tool to generate Jet Engine compressors
      • Speak HN: What sub $200 product improved HN readers’ 2022
      • Advise HN: Daft Art – an album veil maker powered by AI and curated aesthetics
      • Uncover HN: Easy internet app for teenagers to management a single Philips Hue light
      • Level to HN: A corpulent game of snake encoded in a url
    • Brand HN: Motion photographs Watchlist Chrome Extension
    • Existing HN: Connmap – Desktop widget that reveals your TCP company on an international diagram
    • Point out HN: Kweb: A a ways away interface to the earn browser’s DOM
    • Declare HN: I wrote a WebAssembly Interpreter and Toolkit in C
    • Tag HN: Using Key-Value Retail outlets in Serverless Codehooks.io Applications
    • Declare HN: I wrote a WebAssembly Interpreter and Toolkit in C
    • Point out HN: Kweb: A a ways away interface to the earn browser’s DOM
    • Existing HN: Connmap – Desktop widget that reveals your TCP company on an international diagram
    • Brand HN: Motion photographs Watchlist Chrome Extension
    • Level to HN: A corpulent game of snake encoded in a url
    • Uncover HN: Easy internet app for teenagers to management a single Philips Hue light
    • Advise HN: Daft Art – an album veil maker powered by AI and curated aesthetics
    • Speak HN: What sub $200 product improved HN readers’ 2022
    • Level to HN: An initiate source tool to generate Jet Engine compressors
    • Level to HN: Graphic-Walker – A special kind of originate-offer different to Tableau
    • Insist HN: Ov – characteristic smartly off terminal pager
    • Present HN: Nanelo DNS – Privacy-Kindly, European Nameservers
    • Show HN: AREnets – TensorFlow-basically based mostly Relation Extraction equipment for work in Colab
    • Demonstrate HN: ClickHouse-local – a runt instrument for serverless files analytics
    • Reward HN: Vim on-line editor the exercise of WebAssembly, storing files the exercise of IndexedDB
  • A Computer virus and a Dilemma
    • OCIS – OwnCloud Countless Scale
    • A Princeton student built an app which is ready to detect if ChatGPT wrote an essay
    • GitHub Is Sued, and We Would possibly perhaps Learn Something About Creative Commons Licensing
    • Adobe’s Command material analysis can be using photos/videos to narrate AI w/o consent
    • Ultralearning a.k.a. how I learned to code
    • Automatic1111 is assist on GitHub after taking away Embedding Links
    • Where Your Sides Came From
    • What Is a Pig Butchering Rip-off?
    • Submit-processing is ruining iPhone photos
    • Clos Topologies and Centralized Retain a watch on in Google’s Datacenter Community
    • Miller Engineering DS-1 House Planetarium
    • Gimel Studio: Non-harmful, 2D image editor
  • Technology
    • Miller Engineering DS-1 House Planetarium
    • Apple Doctors: to construct it as a file it is advisable to electronic mail it to your self
    • The Air India passenger who urinated on a girl has been fired by Wells Fargo
    • The Filesystem Hierarchy Usual Comes to Guix Containers
    • Sooner than it sued Google for copying from Java, Oracle changed into as soon as copying IBM’s SQL (2020)
    • The i3-gaps mission has been merged with i3
    • Making an Alphorn from Scratch
    • Apple: Braille Individual Guides
    • MotherDuck Is a Original Thought
    • The class of CGI and simple make
    • Like a mercurial tour of DragonFly BSD 6.4?
    • computer science
    • AI
    • Artificial intelligence
    • Technology
    • Ai
    • Apple
    • digital
  • TOP HN
    • anti-Mastodon
    • TOP HN
      • Show HN
      • Ask HN
      • coding
      • ガジェットの複雑さが増し、余分な IP の再利用が促進される
      • 新しい GitHub CLI 拡張インストゥルメント
      • Kubernetes を 7,500 ノードにスケーリング (2021 年)
      • Just by Notでプログラミングするシステム オブジェクト指向プログラミングの活用
      • Describe HN: Kandria, an action RPG made in Frequent Voice, is now out
      • WINd3x、iPod Bootrom エクスプロイトは 10 年遅かった
      • Wander アプリ用の軽量なオンザフリット構成ライブラリ
      • Artificial intelligence
      • 主な BGP 増加をレジデンス Windows デスクトップに追加する
      • Technology
      • Level to HN: Graphic-Walker – A special kind of originate-offer different to Tableau
      • Declare HN: I wrote a WebAssembly Interpreter and Toolkit in C
      • Point out HN: Kweb: A a ways away interface to the earn browser’s DOM
      • Existing HN: Connmap – Desktop widget that reveals your TCP company on an international diagram
      • Advise HN: Daft Art – an album veil maker powered by AI and curated aesthetics
      • Brand HN: Motion photographs Watchlist Chrome Extension
      • Declare HN: I wrote a WebAssembly Interpreter and Toolkit in C
      • Demonstrate HN: ClickHouse-local – a runt instrument for serverless files analytics
      • Describe HN: Kandria, an action RPG made in Frequent Voice, is now out
      • Existing HN: Connmap – Desktop widget that reveals your TCP company on an international diagram
      • Insist HN: Ov – characteristic smartly off terminal pager
      • Just by Notでプログラミングするシステム オブジェクト指向プログラミングの活用
      • Kubernetes を 7,500 ノードにスケーリング (2021 年)
      • Level to HN: A corpulent game of snake encoded in a url
      • Level to HN: An initiate source tool to generate Jet Engine compressors
      • Level to HN: Graphic-Walker – A special kind of originate-offer different to Tableau
      • Point out HN: Kweb: A a ways away interface to the earn browser’s DOM
      • Present HN: Nanelo DNS – Privacy-Kindly, European Nameservers
      • Reward HN: Vim on-line editor the exercise of WebAssembly, storing files the exercise of IndexedDB
      • Show HN: AREnets – TensorFlow-basically based mostly Relation Extraction equipment for work in Colab
      • Speak HN: What sub $200 product improved HN readers’ 2022
      • Uncover HN: Easy internet app for teenagers to management a single Philips Hue light
      • Wander アプリ用の軽量なオンザフリット構成ライブラリ
      • WINd3x、iPod Bootrom エクスプロイトは 10 年遅かった
      • ガジェットの複雑さが増し、余分な IP の再利用が促進される
      • 主な BGP 増加をレジデンス Windows デスクトップに追加する
      • 新しい GitHub CLI 拡張インストゥルメント
      • ロンドンで*ダウン*を継続的に見つめる: Pavement Oddities
      • 報酬 HN: C の 30 行でスピンロック
      • FAA の NOTAM とは何ですか? 航空専門家が機械の仕組みを説明
      • ナノGPT
      • 1 ビット LCD のグレースケール (2022)
      • The Muse (YC W12) は FP&A のシニア ディレクターを採用しています
      • Zen (YC S21) はグロース エンジニアを採用しています
      • Tall Inquire of (YC W21) が B2B 回顧録の幹部を採用
      • Actiondesk (YC S19) は、プロダクト ドレスメーカーを採用しています (4-6 か月の契約)
      • Oven (YC S19) は、Bun を作成するために C/C++ または Zig エンジニアを採用しています。
      • WInd3x, the iPod Bootrom exploit 10 years too unhurried
      • Sign HN: FASTA recordsdata を操作するための FUSE モジュール
      • HN を指します: Socketify.py: PyPy3 および Python3 用の Http/Https および WebSocket サーバー
      • Wage Development Continues to Gradual in the UK and Euro House
      • Stage Supervisor for the unimpressed: 1 Getting started
      • First public free up of Pushup: a brand unique compiler for making net apps in Trip
      • Fixing Cart-Pole Swingup with a Hierarchical Controller
      • Flight Testing the Touchdown Radar for Mars Science Laboratory 2011-06-21T17:36:36Z
      • Flightcontrol (YC W22) is hiring first Developer Recommend
      • Flying boats and other tech for cleaner shipping
      • Four Finalist Touchdown Location Candidates for Mars Science Laboratory 2008-11-19T16:21:01Z
      • France’s prized nuclear sector stalled in Europe’s hour of want
      • French startup unveils new residential thermo-acoustic warmth pump
      • FTC Cracks Down on Firms That Impose Contaminated Noncompete Restrictions
      • FTX’s Aged Prime Lawyer Aided US Authorities in Bankman-Fried Case
      • FY18 NASA lėšų šnypštimas 2017-05-22T00:00:00Z
      • G-3PO: A protocol droid for Ghidra, or GPT-3 for reverse-engineering
      • Gail.com FAQ
      • Gemini-Titan (GT)-6 – Gemini 6 of 7 – 지역 사진 – 외부 지역 1965-12-15T00:00:00Z
      • Geoffrey Hinton Publishes Original Deep Learning Algorithm
      • Germany warns: AI fingers flee already underway (2021)
      • Gimel Studio: Non-harmful, 2D image editor
      • GitHub Availability File
      • GitHub Is Sued, and We Would possibly perhaps Learn Something About Creative Commons Licensing
      • Google needs RISC-V to be a “tier-1” Android architecture
      • Google researcher, lengthy out of math, cracks devilish dispute about gadgets
      • Google start sourced CDC File Transfer from the ashes of Stadia
      • GRC-2003-C-02097 2004-05-01T00:00:00Z
      • GRC-2013-C-05246 2009-11-26T00:00:00Z
      • Hello world!
      • Highlights of Science Launching on SpaceX CRS-15 2018-06-24T00:00:00Z
      • Hilf Al-Fudul
      • HiOperator (YC S16) Is Hiring VP of Engineering
      • HN を指します: Socketify.py: PyPy3 および Python3 用の Http/Https および WebSocket サーバー
      • How kind I blueprint a pair of buttocks?
      • How will the haj switch as international temperatures upward thrust?
      • Human gene linked to bigger brains turned into as soon as born from apparently pointless DNA
      • Hundreds of scientists publish a paper every 5 days
      • In Favor of Friction and Flexibility
      • Indicate HN: Klotho – Change into straightforward code into cloud native code
      • Indoor farming isn’t exact for the smartly off
      • Iranian assault drone came across to have parts from more than a dozen US companies
      • Israeli researcher experiences leak of 235M Twitter-linked e-mail addresses
      • Jam Stations in Low Earth Orbit
      • Jazz Is Freedom
      • JPL-20171102-TECHf-0001-ドローントリップ 人間vs機械 2017-11-17T00:00:00Z
      • JPL에서 NASA의 MSI 콘도미니엄 액셀러레이터 2022-08-25T00:00:00Z
      • JPSO extinct facial recognition abilities to arrest a man. The tech modified into once defective
      • jsc2017e136097 – 12 月 4 日,俄罗斯联邦地区公司 (Roscosmos) 的远征 54-55 号机组人员 Anton Shkaplerov 在俄罗斯 Principal person City 的加加林宇航员训练中心上向整洁的祝福者挥手致意,当时他登上了前往附近的 Chkalovsky Ai 的公共汽车2017-12-04T00:00:00Z
      • Kemble’s Cascade of Stars
      • Kepler-90 マシン (アーティストの考え) 2017-12-14T00:00:00Z
      • Koichi Wakata SpaceX 코칭 2022-06-27T00:00:00Z
      • KSC and Proud to Be Heart-Wide Diversity Tournament 2019-08-20T00:00:00Z
      • KSC ir „Proud to Be Center“ įvairovės turnyras 2019-08-20T00:00:00Z
      • AI
      • Artificial intelligence
      • Auto-Generate
      • anti-Mastodon
      • Awesome
      • BioSentinel
      • CATEGORIES
      • DC
      • Dione
      • Diversity
      • drone racing
      • drones
      • Dulles
      • education
      • Event
      • filmstock
      • Goddard
      • AI
      • Ask HN
      • autonomous
      • coding
      • computer science
      • Clusters
      • Artificial intelligence
        • Ai
        • Apple
        • Tesla
        • digital
        • MESSENGER
        • Device
        • Charts
        • change
        • Shows
        • fraud
        • Former
        • fucking
        • purge
        • Works
        • entering
        • Databases
        • Review
        • Strangely
        • Instinct
        • staff
        • Salesforce
        • intern
        • Involuntary
        • promise
        • Twilio’s
        • nisv live
        • attack
        • Iranian
        • France’s
        • prized
        • infrastructure
        • Debian-based
        • nisv s02 ep03
        • siduction
        • Awesome
        • Calculate
        • Beautiful
        • Linux
        • Start
        • dollar
        • Messier
        • Daughters
        • ‘Breakthrough’
        • obesity
        • Al-Fudul
        • sixty years
        • PyTorch
        • discloses
        • Ancient
        • Stone
        • Popup
        • design
        • public
        • expanding
        • cloud
        • forest
        • startup
        • French
        • batteries
        • fleas
        • spotted
        • Petals
        • language
        • Habitual
        • checking
        • GitHub
        • Availability
        • layers
        • inconsistencies
        • Affair
        • Quasi-War
        • Sergey
        • Irate
        • bestseller
        • necessarily
        • Scientists
        • Titan
        • twitch
        • FGS/NIRISS – Fine Guidance Sensor/Near InfraRed Imager and Slitless Spectrograph
        • infrared
        • ISIM – Integrated Science Instrument Module
        • JHU – Johns Hopkins University
        • JWST – James Webb Space Telescope
        • JWST – James Webb Space Telescope
        • absolute zero
        • Big Bang
        • Peace
        • Studio
        • Making
        • project
        • -gaps
        • warns
        • Germany
        • Braille
        • MotherDuck
        • prototype
        • Challenges
        • Infinite
        • OwnCloud
        • Novel
        • Before
        • copying
        • California
        • getting
        • States
        • Criminal
        • Brother
        • Released
        • Method
        • owners
        • ‘richsession’
        • email
        • Elements
        • Where
        • passenger
        • Hierarchy
        • Filesystem
        • economic
        • Crew Dragon
        • Bridenstine
        • Scientific
        • Heaviosity
        • Patterns
        • Unexpected
        • minimalist
        • Ecode
        • Alpha
        • Wolfram
        • Tailwind
        • HiOperator
        • Klotho
        • TEAMS
        • ROBOTICS
        • Antelope
        • Sponsors
        • Ellen Gertsen
        • Transform
        • Flightcontrol
        • subscriptions
        • Internet
        • Theory-building
        • you’re
        • looking
        • Transfer
        • error’
        • Tails
        • migrate
        • Building
        • Bitmovin
        • Remote
        • PhotoRoom
        • Company
        • Taking
        • Ribbon
        • BibDesk
        • Android
        • profilers
        • phones
        • modern
        • Mastercard
        • private
        • We’ve
        • reportedly
        • Microsoft
        • Artsy
        • trades
        • skilled
        • Polygon
        • Flying
        • Princeton
        • Codemods
        • Coaching
        • UK’s
        • popping
        • sourced
        • Wikipedia
        • admin
        • Indoor
        • quick
        • Mysterious
        • Spotify
        • Fancy
        • Spotify
        • Weird
        • mail-order
        • Recipients
        • computer
        • optics
        • partnership
        • commercial
        • telemetry
        • Crisis
        • billionaire
        • Party
        • Onelab
        • Faster
        • general
        • Adobe’s
        • database
        • FinanceDatabase
        • Numerical
        • Freedom
        • concrete
        • Stacks
        • computer science
        • NASA
    • Show HN
    • Ask HN
    • Technology
    • computer science
    • coding
    • Clusters
    • AI
    • drones
    • autonomous
    • Auto-Generate
    • Ask HN
    • Show HN
    • The SMART Science™
    • google
  • CRYPTO
    • Blockchain
    • farming
    • Billionaires
    • FTX’s
    • FinanceDatabase: A database of 300.000 symbols (ETFs, Currencies, Crypto)
  • Artificial intelligence
  • Toggle search form
  • F. Cholletによる「知性の尺度について」(2019)
    F. Cholletによる「知性の尺度について」(2019) “On
  • Google が組み込み LLM (562b パラメータ) に関する論文を発表
    Google が組み込み LLM (562b パラメータ) に関する論文を発表 Artificial intelligence
  • 不要な汎用構造体を削除して (Rust) librsvg のコード サイズを削減する
    不要な汎用構造体を削除して (Rust) librsvg のコード サイズを削減する Artificial intelligence
  • AI生成画像 基本的に詩に基づく
    AI生成画像 基本的に詩に基づく anti-Mastodon
  • 男性と女性の起業家が、VC から要求されたさまざまな質問をまとめます
    男性と女性の起業家が、VC から要求されたさまざまな質問をまとめます anti-Mastodon
  • Randomart 画像の目的は何ですか?
    Randomart 画像の目的は何ですか? anti-Mastodon
  • Jsonnet、Cue、および HCL よりも高速なもう 1 つの構成プログラミング言語
    Jsonnet、Cue、および HCL よりも高速なもう 1 つの構成プログラミング言語 Another
  • Basaran は、OpenAI テキスト アナウンス マテリアル完了 API に代わる配信オファーです。
    Basaran は、OpenAI テキスト アナウンス マテリアル完了 API に代わる配信オファーです。 anti-Mastodon
  • This portray used to be taken by NASA’s EPIC camera onboard the NOAA DSCOVR spacecraft 2023-01-07 07:fifty three:16
    This portray used to be taken by NASA’s EPIC camera onboard the NOAA DSCOVR spacecraft 2023-01-07 07:fifty three:16 image
  • नासा का खुलासा 2021-06-02T00:00:00Z
    नासा का खुलासा 2021-06-02T00:00:00Z Ask HN
  • Gonzalez vs. Google Dwell Diagnosis – Institute for Rebooting Social Media
    Gonzalez vs. Google Dwell Diagnosis – Institute for Rebooting Social Media anti-Mastodon
  • Covid後の世界で会社をオフサイトに投げる方法を学ぶ
    Covid後の世界で会社をオフサイトに投げる方法を学ぶ anti-Mastodon
  • Twitter は荒らしからあなたを保護することはできません、インサイダーはため息をつきます
    Twitter は荒らしからあなたを保護することはできません、インサイダーはため息をつきます anti-Mastodon
  • HN 代表: 支払いを通知するための優れた簡単な iOS アプリを作成しました
    HN 代表: 支払いを通知するための優れた簡単な iOS アプリを作成しました Awesome
  • Pastebin のようなインターネットの住居を機械で組み立てる
    Pastebin のようなインターネットの住居を機械で組み立てる anti-Mastodon
C から Zig への mini-rv32ima (RISC-V エミュレーター) の移植

C から Zig への mini-rv32ima (RISC-V エミュレーター) の移植

Posted on February 20, 2023 By 📢 𝕂𝕒𝕤𝕡𝕖𝕣𝕤𝕜𝕪™

TLDR; 私はちっぽけな RISC-V エミュレーターを C から zig に移植しました。それは (平和的に) Linux を起動します

https://github.com/ringtailsoftware/zig-minirv32

Zig は、既存の C コードを段階的に移植するのに理想的な言語です。

(WASMモデル:

https ://ringtailsoftware.github.io/)

連絡先: https://mastodon.me.uk/@tobyjaffey

Zig?

Zig は非常にユニークなシステム プログラミング言語です。

オンラインページには、

Zig は、かなりの、最適で再利用可能なアプリケーションを維持するための独自計画のプログラミング言語およびツールチェーンではなくなりました。

組み込みシステムおよびネットワーキング担当者としての私の観点からすると、Zig は「より優れた C 」。 これにより、まったく同じ低レベルのゲイン エントリが許可されますが、より優れた言語構成により、多くのクラスの一般的なエラーが取り除かれます。 必然的に、人々は同じ住居をかなり計画しているので、Zig to Rust を検討するでしょう。 私の旅は、Zig は教えられて苦労するのがかなり単純であり、Zig の最小限の構文は、時にはより冗長なコードを書くことを意味する可能性があるかもしれませんが、そのコードは簡単に教えられます-私は贅沢です.

言語の感触を得るために見ていても、 Ziglingsは充実の紹介です Mini-RV32ima

Mini-RV32ima は単一の C ヘッダ ファイルの RISC-V エミュレータです。 オンラインページ

から:

    RISC-V rv32ima/ を実装します。 Zifencei†+Zicsr (および部分的な su)、CLINT および MMIO を使用 正確なコードの400系統を用意しています

  • 依存関係がなく、もはや libc もありません*)

    免責事項: 私は RISC-V についてほとんど何も知りません。 C コードを Zig に移植する戦略は、RISC-V リファレンス マニュアルに対応する必要があるため、行ごとに翻訳することになりました。

    Zigの秘密兵器

    Zigコンパイラジグ

    、さらに C コンパイラです - それは本物です 
    clang
    。 これにより、C と Zig を組み合わせたイニシアチブを簡単に考案できます。  

    私の移植の最初のモデルは、これで少し贅沢に見えました、Zigは次のように呼びかけます

    doEverything() として知られる C 機能本物の中古 C

     ファンダメンタルと呼ぶ()
     ( に名前を変更) _main
     シンボル名の衝突を判断して操縦する) . 

    Zig:

    const rv32=@cImport({ @cInclude("ミニ-rv32ima.h"); } pub fn 基本() !void { rv32.doEverything(); }

    C:

    void doEverything(void) { char *argv={ "minirv32", "-f", "イメージ" }; _main(3, argv); } int _main(int argc, char *argv) { ... }

    Zig は Zig を発明マシンとして使用します (もう

    construct
    / cmake
     /

    autotools /その他多数) および
    invent.zig コードに C を追加するようにすると、このように贅沢な気分になります: 

    const rv32ima_flags=[_] const u8{ "-壁", };  const rv32ima_sources=[_] const u8{ "mini-rv32ima/mini-rv32ima.c", };  fn createrv32ima(b: *std.invent.Builder) *std.invent.LibExeObjStep { const lib=b.addStaticLibrary("rv32ima", null);  lib.addCSourceFiles(&rv32ima_sources, &rv32ima_flags);  lib.addIncludePath("mini-rv32ima");  lib.linkSystemLibraryName("c"); ライブラリを返します。  } 

    実際のスリザー

    zig invent 
     動作する実行ファイルを購入しました。 すべて C で書かれていますが、Zig でコンパイルされています。 これは無意味に聞こえますが、一方で、Zig は 

    非常に優雅な堕落したコンパイラ

    。 それを含まなかった場合

    libc 依存性がある場合は、WASM で贅沢な自立型プラットフォームを追加で発明する可能性がありますが、それについては後で詳しく説明します.

    一度に魅力的な機能

    Mini-rv32 はいくつかの C 関数を使用して、シミュレートされたハードウェアへのメモリ書き込みを処理します。それらを Zig に切り替えましょう。

    HandleControlStore

  • は、エミュレータがコードを実行して、メモリにマップされた IO 計測器に知識を保存しようとするケースを扱います。

    0x10000000
    にバイトを書き込む 端末から出力します.

    C:

    uint32_t HandleControlStore( uint32_t addy, uint32_t val ) { if( addy==0x10000000 ) { //UART 8250 / 16550 Recordsdata Buffer printf( "%c", val ); fflush(標準出力); 0を返します。 }

    Zig:

    export fn HandleControlStore(addr:u32, val:u32) callconv(.C) u32 { if (addr==0x10000000 ) { //UART 8250 / 16550 Recordsdata Buffer std.debug.print("{c}", .{@intCast(u8, val)}); 0を返します。 }

    Zig では、本物を追加します

    export

     および 
    callconv(.C)
     エクスポートしましたC から呼び出し可能な機能です。C の 
    _main() を呼び出す Zig を購入しました。  はエミュレータコアを実行しますが、IO を構成するために Zig を呼び出します  

    (

    std.debug から出力されています) とりあえずここは絶対に失敗しないから)

    エミュレータのコアは、単一のアキュムレート - デコード - 実行サイクルを実行する機能です。 Cでは、これで贅沢をしているように見えます:

    int32_t MiniRV32IMAStep( struct MiniRV32IMAState 発音、uint8_t 画像、uint32_t vProcAddress、uint32_t 経過時間、int カウント, uint32_t ramSize);  

    と発音する は主に最新のレジスタとフラグです (実際には RAM の最後に保持されます)、画像はマシンのメモリであり、測定値です 
    ramSize. 

    _main()
     Cガジェットの問題次に、ステップ機能をループで呼び出します。 次に、心の中身を発音して Zig に切り替えます:  

    メモリを割り当てます:

     const メモリ=std.heap.page_allocator.alignedAlloc(u8, 4, ramSize); を目指してください。  

    レベルa

    MiniRV32IMAState

    RAM の結論の構造体。 Zig の構造体を再定義する必要がなかったことを隠してください - C ヘッダー ファイルを教えて、すべての部分を正確にマップする必要があります (はい、Zig は、C がスライスを起動し、アライメントを知るためにできるポインター演算の合計を制定できます) :

    var 発音:*rv32.MiniRV32IMAState=@ptrCast(*rv32.MiniRV32IMAState, memory.ptr + (ramSize - @sizeOf(rv32.MiniRV32IMAState)) );  

    それから、Zig は本物のステップ機能を連続して呼び出すことができます。 非表示を表示します。フォーム マッピングは必要ありません。

    const ret=rv32.MiniRV32IMAStep(コア、memory.ptr、0、経過時間、カウント、ramSize);  

    エミュレータコアの書き換え

    エミュレータの心臓部は MiniRV32IMAStep()

    .  CPUエミュレーターから期待されるように、それは適切な 

    swap

    総操作を強制するアサーション。 Zigに移植する際の細かな調整方法を紹介します。

    C:

     swap( ir & 0x7f ) { case 0b0110111: // LUI rval=( ir & 0xfffff000 ); スマッシュ;  case 0b0010111: // AUIPC rval=非公開のコンピューター + ( ir & 0xfffff000 ); スマッシュ;  case 0b1101111: { // JAL int32_t reladdy=((ir & 0x80000000)>>11) |  ((ir & 0x7fe00000)>>20) |  ((ir & 0x00100000)>>9) |  ((ir&0x000ff000));  if( reladdy & 0x00100000 ) reladdy |=(int32_t)0xffe00000;  // シグナル拡張。  rval=非公開のコンピューター + 4; 非公共のコンピューター=非公共のコンピューター + (uint32_t)(reladdy - 4); スマッシュ;  } case 0b1100111: { // JALR uint32_t imm=ir>> 20;  int32_t imm_se=imm |  (( imm & 0x800 )?0xfffff000:0);  rval=非公開のコンピューター + 4; 非公共のコンピュータ=( (REG( (ir>> 15) & 0x1f ) + imm_se) & ~1) - 4; スマッシュ;  } ... 

    Zig:

     スワップ (ir & 0x7f) { 0b0110111=> rval=(ir & 0xfffff000), // LUI 0b0010111=> rval=非公開コンピュータ +% (ir & 0xffffff000), // AUIPC 0b1101111=> { // JAL var reladdy: i32=@intCast(i32, ( (ir & 0x80000000)>> 11) | ((ir & 0x7fe00000)>> 20) | ((ir & 0x00100000)>> 9) | ((ir & 0x000ff000)));  if ((reladdy & 0x00100000) !=0) { reladdy=@bitCast(i32, @bitCast(u32, reladdy) | 0xffe00000);  // シグナル拡張。  rval=非公開のコンピューター + 4; 非公開コンピュータ=非公開コンピュータ +% @bitCast(u32, reladdy - 4);  }, 0b1100111=> { // JALR const imm: u32=ir>> 20;  var imm_se: i32=@intCast(i32, imm);  if (imm & 0x800 !=0) { imm_se=@bitCast(i32, imm | 0xfffff000);  rval=非公開のコンピューター + 4;  const newpc: u32=((pronounce.regs[(ir>> 15) & 0x1f] +% @bitCast(u32, imm_se)) & ~@as(u32, 1)) - 4; 非公共のコンピュータ=newpc;  }, 

    刻印すべきいくつかの問題:

    Zig に スマッシュ アサーション、ループから抜け出すことはなくなり、もはや合計

    swap ケース。

    スマッシュ
    . 

    Zig は C で贅沢な三項演算子を含んでいません。

    a ? b : c
     は long make as if (a) b else c 。 もっと冗長だとしても、これはより読みやすい計画であると結論付けます。 rval=非公開のコンピュータ + ( ir & 0xfffff000 )
    .  Zig では、整数のオーバーフロー (一部の発明モードで) により実行時エラーが発生します。 したがって、

    rval=非公開のコンピューター +% ( ir & 0xfffff000)
    . 

    JAL
    の最後に、C モデルは を使用して署名されたアドレスから PC を更新します。 非公開コンピュータ=非公開コンピュータ + (uint32_t)(reladdy - 4)
     .  Zig では、生ビットを 

    u32

    として定義するためにコンパイラにため息をつくことができます。 (およびオーバーフローをラップ) を使用) 非公開コンピュータ=非公開コンピュータ +% @bitCast(u32, reladdy - 4).

    C では、コードは

    & ~1
     、それはどのような形を識別するために左側の面を見て構成しています 
    1

    ひょっとしたら平和になるかもしれません。 Zig では、

    & ~@as(u32, 1) と発音する必要があります。 . 
    WASM

    ZigはWASMをターゲットとしてサポートしています. エミュレーターを完全に Zig に移植するよりも早く、C コード モデルを WASM に発明し、ブラウザーで実行することができます。 これを実行するには、すべて

    libc
    に依存します。 を削除したい - IO 処理関数を Zig.

    C で作業するのは簡単で、JavaScript を介してアクセスする機能をエクスポートするのも簡単なので事実です

    Zig:

    export fn tty_read(b:u8) void { // IO を処理します }

    JavaScript:

    return WebAssembly.instantiate(bytes, imports).then((outcomes)=> { var tty_read=results.occasion.exports.tty_read; ... });  

    一時的な思考の証明として、WASM にコンパイルされた mini-rv32 の C モデルを使用してブラウザーのデモをハックし、

    xterm.js 。 確かに、JSLinux の方が優れていましたが、逆に平和でリラックスできるハックです…

    https:// ringtailsoftware.github.io/

    おわりに

    純粋にジグを書いて遊んでいます。 ほんの少しのイニシアチブの後、私は現在、ほとんどの構文を知っているという点に達しており、ライブラリ関数が必要になった後に贅沢に見えるものについて、まともな賭けをする立場にいます。 長時間の C プログラマーとして、Zig は私が仲介する能力に適しています。 私はそれが興味深い未来を買ったと思います. https://www.hodgepig.org/zero/ (Zig のマスコットが登場するスポーツで、WebGL 強化用にゼロ グラフィックス ライブラリを使用)

  • https://github.com/ringtailsoftware/zig-embshel​​l (テキストコマンドを実行するためのちっぽけな REPL/シェル)

  • https://github.com/ringtailsoftware/zig-embeddir (多様なレコードデータからの知識をバイナリに埋め込むための、Zig を使用した集合時間のトリック)

    𝚆𝚊𝚝𝚌𝚑 𝙽𝙾𝚆 📺

    anti-Mastodon, Ask HN, Auto-Generate, Billionaires, Blockchain, coding, computer science, CRYPTO, mini-rv, Porting, Show HN, Technology, TOP HN Tags:Blockchain, mini-rv, Porting

    Post navigation

    Previous Post: Bing AI は、あからさまな人間の敵に名前を付け、それらを罰する計画を説明します
    Next Post: ESA – Terrae Novae: ヨーロッパの探査ビジョン

    Related Posts

    • MLBは、違反がレッドソックス対ブレーブスの試合を終了させたため、現在のピッチクロックの原則の結論を感じる
      MLBは、違反がレッドソックス対ブレーブスの試合を終了させたため、現在のピッチクロックの原則の結論を感じる anti-Mastodon
    • Datadog が開発者に originate provide exporter の廃止を要求
      Datadog が開発者に originate provide exporter の廃止を要求 anti-Mastodon
    • TextExpander を使用した ChatGPT の緊急エンジニアリング
      TextExpander を使用した ChatGPT の緊急エンジニアリング anti-Mastodon
    • Show hide HN: DoubleCloud Viz、SSO およびその他の特典を備えた無料のセルフバイ キャリア
      Show hide HN: DoubleCloud Viz、SSO およびその他の特典を備えた無料のセルフバイ キャリア anti-Mastodon
    • 米国とEUが数十億ドルを投じる中、英国の半導体思想はAWOLになる
      米国とEUが数十億ドルを投じる中、英国の半導体思想はAWOLになる anti-Mastodon
    • AirGradient Open CO2 および PM2.5 測定用の空気高品質モニターを提供
      AirGradient Open CO2 および PM2.5 測定用の空気高品質モニターを提供 AirGradient
    • Markdown の第 5 バージョン RPG SRD 5.1、著作権で保護された用語をキャプチャするように編集
      Markdown の第 5 バージョン RPG SRD 5.1、著作権で保護された用語をキャプチャするように編集 anti-Mastodon
    • 幕の内:燃料と核のロビーがEUの分類法を再形成するとき
      幕の内:燃料と核のロビーがEUの分類法を再形成するとき anti-Mastodon
    • Spotify は、AI による解説でパーソナライズされた音楽を提供するまったく新しい機能を開始します
      Spotify は、AI による解説でパーソナライズされた音楽を提供するまったく新しい機能を開始します anti-Mastodon
    • RocksDB マイクロベンチマーク: コンパイラ、Arm、x86
      RocksDB マイクロベンチマーク: コンパイラ、Arm、x86 anti-Mastodon

    Recent Posts

    • Webフィンガープリンティングは私が思っていたよりも悪い
    • 幕の内:燃料と核のロビーがEUの分類法を再形成するとき
    • OpenAI は、自分自身であることを拒否した後、その決定のために荒らされています
    • ヤマハ NS10 エピック (2008)
    • Awesome-completely-open-ChatGPT: ChatGPT のオープン ピックのリスト

    Recent Comments

    1. robga on Excessive Avenue コーヒーのカフェイン ステージはさまざまで、テストでは
    2. Loic on 行方不明の放射性タブレットは、必死の捜索の後、WA奥地で偶然見つけました
    3. minihat on メタは、標準的な VR e スポーツ Echo Area をシャットダウンします
    4. dafelst on フレーム ポインターの巻き戻しによる Move 実行トレーサーのオーバーヘッドの削減
    5. cloudking on GraphGPT: 構造化されていないテキストの肯定的な素材からのレコードデータ グラフの外挿
    • 老舗の Visual Studio と ClangCL の比較
      老舗の Visual Studio と ClangCL の比較 Artificial intelligence
    • GitHub: ChatGPT プロンプトと使用するさまざまなプロンプトを発明する方法を予約する
      GitHub: ChatGPT プロンプトと使用するさまざまなプロンプトを発明する方法を予約する Artificial intelligence
    • Mysterious Antennas Are Showing in Utah’s Hills and Officials Are Stumped
      Mysterious Antennas Are Showing in Utah’s Hills and Officials Are Stumped NASA
    • Amazonの専門家が従業員に送った人員削減に関するメモを読む
      Amazonの専門家が従業員に送った人員削減に関するメモを読む Amazon
    • Petals: 効果的なデバイスの共同推論と快適なチューニング
      Petals: 効果的なデバイスの共同推論と快適なチューニング anti-Mastodon
    • 「Fabricate Your Devour Redis」ガイドが完成しました
      「Fabricate Your Devour Redis」ガイドが完成しました Artificial intelligence
    • Proton は、検閲された Deutsche Welle にアクセスするための専用 VPN サーバーを起動します
      Proton は、検閲された Deutsche Welle にアクセスするための専用 VPN サーバーを起動します anti-Mastodon
    • Non-ECC メモリを使用した電力の消耗を想像する – 何が友好的でないのか?
      Non-ECC メモリを使用した電力の消耗を想像する – 何が友好的でないのか? Artificial intelligence
    MAILANON
    2100 MAIL
    SEO
    METAVERSE
    BioLINK
    CRYPTO MINING
    CASINO
    DEFI-TRACKER
    StartApp Network
    RAVES-MONSTER-GAME
    RAVES EXCHANGE
    RAVES NFT
    KVANTA TV

    Copyright © 2023 Nasare™🚀.

    Powered by PressBook News Dark theme