並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 22 件 / 22件

新着順 人気順

zigの検索結果1 - 22 件 / 22件

  • Learning Zig

    home Learning Zig Welcome to Learning Zig, an introduction to the Zig programming language. This guide aims to make you comfortable with Zig. It assumes prior programming experience, though not in any particular language. Zig is under heavy development and both the Zig language and its standard library are constantly evolving. This guide targets the latest development version of Zig. However, it's

    • VSCodeがWebAssemblyの実行時デバッグに対応。C/C++やRust、Zigなどのソースコードと関連付け、変数参照、ブレークポイントなど可能に

      VSCodeがWebAssemblyの実行時デバッグに対応。C/C++やRust、Zigなどのソースコードと関連付け、変数参照、ブレークポイントなど可能に マイクロソフトは、オープンソースで開発しているコードエディタ「Visual Studio Code」(以下、VSCode)の最新版となる2023年9月版(バージョン1.83)で、JavaScriptデバッガがWebAssemblyのデバッグにも対応したことを明らかにしました。 The JavaScript debugger can now debug code compiled into WebAssembly if it includes DWARF debug information. For example, C++ code compiled using Emscripten can be debugged: pic.twitt

        VSCodeがWebAssemblyの実行時デバッグに対応。C/C++やRust、Zigなどのソースコードと関連付け、変数参照、ブレークポイントなど可能に
      • ZigでWriting an OS in 1,000 Linesをやる

        ZigでWriting an OS in 1,000 Linesをやる #2023-11-21 自作 OS で学ぶマイクロカーネルの設計と実装(通称エナガ本)の補足資料として公開されているWriting an OS in 1,000 Linesを、できるだけZigでやってみることにした。 目次成果物 #repositoryは以下。 さいしょに #エナガ本は一通り読んでいたのだが、機能に対していくつかのOSの実装を眺める。という構成になっており、個人的には「同じような難易度でRV32を対象に 0->1 でシンプルなOSを作る書籍があるといいなあ」と思いながら読んでいたのだが、まさに欲していたものが公開されたので大喜びで実装を開始した。 自分はそのまま写経してしまうと頭に入らないため、異なる言語で書いてみたり、何らかの制約を課して実施することが多い。今回はZigで書いてみることにした。 概ね問

          ZigでWriting an OS in 1,000 Linesをやる
        • Zig探訪 - comptime編

          イントロ さあ、やって参りました。 第1回Zig探訪のお時間です。 今回担当するのは、Zigを使い始めて早くも半年・永遠のニートことsmallkirbyです。 Zig探訪では、Zigの機能や特徴の中で面白いんじゃないかと思うものをピックアップして紹介していきます。 紹介しないこともあります。 第1回のテーマは、Zigの中でも特に重要なコンセプトであるcomptimeについてです。 Zigとは - Everything is Explicit Zigについておさらい 第1回ということで、最初に軽くZigについておさらいしておきましょう。 Zigは、2016年に開発が始まったコンパイル型汎用プログラミング言語です。 Rustが2015年に1.0リリースされた翌年に開発がスタートしたんですね。 最新のリリースはv0.12.0であり、大体1年くらいでマイナーアップデートされるようです。 まだ1.0

            Zig探訪 - comptime編
          • WinterJSとは何者か?ベンチマークでの比較検証

            概要 2024年3月12日にこんなニュースが飛び込んできました。 WinterJSの1.0が発表されたとのことで、今回はWinterJSとは何者なのかについてをまとめていき、検証していきます。 WinterJS WinterJS とは、Rustで書かれたJavaScriptランタイムでSpiderMonkeyエンジンを使用して、javaScriptを実行します。 Rustで書かれたと言っているのは、HTTPリクエストなどの処理や、JavaScriptイベントのループを処理をするRust の非同期ランタイムTokioを使用しているからです。 また、WinterJSは、WebAssemblyにコンパイルすることもできるようです。 そして、一番重要なことは、JavaScriptにおけるHTTP Serverとしての性能について、処理速度がとんでも無く早いということを謳っている点ですね。 今回は、

              WinterJSとは何者か?ベンチマークでの比較検証
            • Using Zig in our incremental Turborepo migration from Go to Rust – Vercel

              Using Zig in our incremental Turborepo migration from Go to RustLearn how we're cross-compiling a Rust-Go-Rust sandwich to six platforms. We’ve been porting Turborepo, the high-performance build system for JavaScript and TypeScript, from Go to Rust. We talked about how we started the porting process, so now let’s talk about how we began porting our two main commands: run and prune. Since last time

                Using Zig in our incremental Turborepo migration from Go to Rust – Vercel
              • CからZigに書き直して激遅になったと思ったら最適化オプションの変更で改善した話

                メモとして残します。 MJPEGを入力してJPEGに切り出すプログラム ChatGPT-4 に作らせました。 USBカメラから入力された生のmjpegの映像データを標準入力から受けて、jpegの静止画に切り出してファイルに保存するプログラムをC言語で書いてください。書き出すファイル名はout%03d.jpg という感じでフレーム番号を含めてください。ソースコード内のコメントは英語で書いてください。 最初のものはffmpegやらたくさん外部のライブラリに依存するコードを出してきたので、もっとシンプルなやつにしてくれとお願いしました。できたものはこれ。[1] #include <stdio.h> #include <fcntl.h> #include <unistd.h> #define BUF_SIZE 1024 #define OUTPUT_FILENAME_PATTERN "out%03

                  CからZigに書き直して激遅になったと思ったら最適化オプションの変更で改善した話
                • 新通貨ジンバブエ・ゴールド、波乱のスタート 旧通貨は無価値に

                  ジンバブエの首都ハラレでジョン・ムシャヤバンフ中央銀行総裁が披露した新通貨ジンバブエ・ゴールドの紙幣(2024年4月5日撮影)。(c)Jekesai NJIKIZANA / AFP 【4月10日 AFP】金を裏付けとしたジンバブエの新通貨ジンバブエ・ゴールド(ZiG)が今週、波乱のスタートを切った。店舗は米ドルでの支払いしか受け付けず、銀行の前には困惑した人々が預金を引き出そうと長蛇の列を作っている。 旧通貨ジンバブエ・ドルが過去1年間で暴落し、高インフレに見舞われた同国は8日、新通貨の運用を開始した。だが、切り替えの発表が数日前だったため、多くの国民は準備ができていなかった。 大半の銀行は9日、新通貨に移行するためにシステムをオフラインにした。そのため首都ハラレでは、預金を引き出そうとする多くの人が銀行の前に何時間も並ぶ事態が起きた。 通貨切り替えによって、すでに価値がほとんどなかった旧

                    新通貨ジンバブエ・ゴールド、波乱のスタート 旧通貨は無価値に
                  • Denoで困ったときはZigで何とかなるかもしれない

                    サードパーティライブラリが無いよ問題 いきなりネガティブな話で申し訳ございません。愚痴みたいなものです。本題ではありませんので読み飛ばしていただいて問題ありません。 Denoユーザーの1人としての個人的な印象として、Denoの勢いは2023年に入った頃から低迷しているように感じます。2022年末からnpm対応によってNode.jsの資産を使えるようになったにも関わらずです。実際のユーザー数はDenoチームではないので分かりませんが、登場から数年経って真新しさも無くなったので、どんなサービスにもありがちなことなのかなと思います。 ありがちとはいえ、ただ低迷しているだけではありません。ここからNode.jsを超えるのはなかなか難しいです。なぜならnpm対応というのは、明示的にNode.jsに対して「生き残っていい」それどころか「あなたが正しい」と宣言してしまったようなものです。Node.jsの

                      Denoで困ったときはZigで何とかなるかもしれない
                    • GitHub - zigcc/zig-cookbook: Simple Zig programs that demonstrate good practices to accomplish common programming tasks.

                      You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                        GitHub - zigcc/zig-cookbook: Simple Zig programs that demonstrate good practices to accomplish common programming tasks.
                      • Metaprogramming in Zig and parsing CSS | notes.eatonphil.com

                        I knew Zig supported some sort of reflection on types. But I had been confused about how to use it. What's the difference between @typeInfo and @TypeOf? I ignored this aspect of Zig until a problem came up at work where reflection made sense. The situation was parsing and storing parsed fields in a struct. Each field name that is parsed should match up to a struct field. This is a fairly common pr

                        • GitHub - andrewrk/poop: Performance Optimizer Observation Platform

                          You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                            GitHub - andrewrk/poop: Performance Optimizer Observation Platform
                          • Using Zig to Unit Test a C Application

                            Zig is a new, independently developed low-level programming language. It’s a modern reimagining of C that attempts to retain C’s performance while embracing improvements from the last 30 years of tooling and language design. Zig makes calling into C code easier than any other language I’ve used. Zig also treats unit testing as a first-class feature, which the C language certainly does not. These t

                            • GitHub - ZigEmbeddedGroup/microzig: Unified abstraction layer and HAL for several microcontrollers

                              You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                GitHub - ZigEmbeddedGroup/microzig: Unified abstraction layer and HAL for several microcontrollers
                              • make the main zig executable no longer depend on LLVM, LLD, and Clang libraries · Issue #16270 · ziglang/zig

                                This issue is to fully eliminate LLVM, Clang, and LLD libraries from the Zig project. The remaining ties to these projects are as follows: completely eliminate dependency on LLD #8726 eliminate dependency on LLD for Mach-O #8727 eliminate dependency on LLD for ELF #17749 eliminate dependency on LLD for COFF/PE #17751 eliminate dependency on LLD for WebAssembly #17750 LLVM directly output LLVM bitc

                                  make the main zig executable no longer depend on LLVM, LLD, and Clang libraries · Issue #16270 · ziglang/zig
                                • What's Zig got that C, Rust and Go don't have? (with Loris Cro)

                                  Zig is a programming language that’s attempting to become “the new C” - the language of choice for low-level systems programming and embedded hardware. Going into that space not only puts it in competition with C and C++, but also other newcomers like Rust and Go. So what makes Zig special? Joining us to discuss it is Loris Cro from the Zig Foundation. We talk through Zig’s reasons to exist, its

                                    What's Zig got that C, Rust and Go don't have? (with Loris Cro)
                                  • DenoとZigの間でデータ受け渡し

                                    前回の記事はこちら。 前回JavaScriptとWasmでデータを受け渡す概念的なことを説明しました。今回は、実際にDenoとZigのコードを書いていきます。 Denoで書いていますが、これまでの記事で説明したようにブラウザのJavaScriptでも少し書き換えるだけで利用できます。 今回説明する方法はあくまで、私が考えた1つの方法にすぎないことをご了承ください。前記事を踏まえて自身で学んで書くか、ライブラリを探すのも一つの手だと思います。 なお、私はZigにあまり詳しくなく、データ受け渡しのための最低限のことしか勉強していません。そのため、Zigのコードについては稚拙なものになっているかもしれませんがご了承ください。 何を作るか 今回の目標は、Zigの標準ライブラリのBase64エンコードをWasm化することです。 これは実際に計測して確かめたことなのですが、Base64エンコード程度の

                                      DenoとZigの間でデータ受け渡し
                                    • Zig defer Patterns

                                      Zig defer Patterns Mar 21, 2024 A short note about some unexpected usages of Zig’s defer statement. This post assumes that you already know the basics about RAII, defer and errdefer. While discussing the differences between them is not the point, I will allow myself one high level comment. I don’t like defer as a replacement for RAII: after writing Zig for some time, I am relatively confident that

                                      • Writing a task scheduler in Zig

                                        I'm working on an application that needs the ability to schedule tasks. Many applications have a similar need, but requirements can vary greatly. Advanced cases might require persistence and distribution, typically depending on external systems (like a database or queue) to do much of the heavy lifting. My needs are simpler: I don't have a huge variety of tasks or a high number of them. Thread-Per

                                        • Zigで配列をなめるときにはできるだけwhileでなくてforを使いましょうという話

                                          まあ、当たり前のことなんですけどね。 前回の記事のプログラムを書き直した 前回の記事のMJPEGからJPEGを切り出すプログラムにはバグがありました。脚注にも書きましたが、それは読み込んだバッファの最後のバイトが0xffで、次のバッファの先頭が0xd9のときに、JPEGの終わりを見逃してしまうというものです。 なので、ちゃんと4つの状態を遷移するように書き直しました。 const std = @import("std"); const fs = std.fs; const io = std.io; const os = std.os; const BUF_SIZE = 64 * 1024; const OUTPUT_FILENAME_PATTERN = "out{d:0>4}.jpg"; const JPEG_START0 = 0xff; const JPEG_START1 = 0xd8;

                                            Zigで配列をなめるときにはできるだけwhileでなくてforを使いましょうという話
                                          • Zigの@typeInfoと@Typeを理解する

                                            最初に結論 @TypeOf(): 値 → 型 (型名) @typeInfo(): 型 (型名) → 型情報 @Type(): 型情報 → 型 anytype: どんな型の値でも受け取れる、という意味の型 type: 型 (型名) を受け取る場合や、関数で型を返す場合に使う、型 (ちなみに@はZigの組み込み関数を表す。) まえがき: メタプログラミングだけど普通のコード Zigはcomptimeという強力なメタプログラミングの仕組みを持っているのだけれど、C++やRustやNimなどと違って、マクロやメタプログラミング専用の記法は基本的に持っていない。 ではどうやってメタプログラミングするのかというと、comptimeは単に実行時にできることをコンパイル時にできるようにするというもので、さらにZigの画期的なアイデアとして、型そのものの情報をシンプルに構造体として読み取ったり操作することが

                                              Zigの@typeInfoと@Typeを理解する
                                            • Talk: Introducing Ghostty and Some Useful Zig Patterns

                                              This is the text format of a talk I did for Zig Showtime. If you'd rather watch the video, you can find it on YouTube: Zig Showtime: Ghostty. The video also includes a Q&A session at the end which I did not include in this post. Hello! I'm excited to talk today about Ghostty. Ghostty is a brand new terminal emulator written from scratch in Zig. Note: at the time of writing this, Ghostty is still n

                                              1