並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 38 件 / 38件

新着順 人気順

Zigの検索結果1 - 38 件 / 38件

  • 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
              • 新通貨ジンバブエ・ゴールド、波乱のスタート 旧通貨は無価値に

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

                  新通貨ジンバブエ・ゴールド、波乱のスタート 旧通貨は無価値に
                • 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.
                  • C++でもRustでもなく「Zig」が必要なのはなぜか

                    関連キーワード プログラマー | プログラミング 機械語に近い「低水準言語」を扱う開発者の心をつかみそうな新しいプログラミング言語がある。その名を「Zig」という。2024年7月時点で完全版はまだ公開されていないが、開発が盛んで、コミュニティーの熱気もある。 なぜ今新しいプログラミング言語が必要なのか。より具体的に言えば、Zigには「C」「C++」「Rust」「D」などのプログラミング言語を上回る点はあるのか。本連載はZigの主要なメリット5つを取り上げる。 「Zig」が必要なのはなぜ? その5つのメリット 併せて読みたいお薦め記事 新たなプログラミング言語を学んでみよう CでもC++でもなくプログラミング言語「Go」を使いたくなる“あの良さ”とは? プログラミング言語「Carbon」は「C++」より何が優れているのか メリット1.シンプルかつ簡潔な構文を備える 複雑ではないことがZigの

                      C++でもRustでもなく「Zig」が必要なのはなぜか
                    • Making a Chess Engine in Zig

                      I had the honor of speaking at Systems Distributed at the end of June. Since it was hosted by TigerBeetle who is one of the largest zig users, a lot of the zig community was there. After talking to some of them, Zig seemed more interesting for me to try out. Around the same time my youtube algorithm got me hooked on chess content. I'm not a good chess player by any means, but it started giving me

                      • 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
                          • Zig探訪 - エコシステム編

                            イントロ さあ、やって参りました。 第2回 Zig探訪 のお時間です。 今回担当するのは、ここ最近冷房が寒くてエアコンを消すと、今度は内部洗浄で湧き出てくる熱気のせいでまた部屋が暑くなることに悩まされている、社会人歴マイナス2年のsmallkirbyです。昨日Ubuntuを24.04にしました。まだ22.04使ってる人は反省してください。もう22.04からアップグレードできます。Ubuntuは最初のポイントリリースまでアップグレードできない印象あったんだけど、どういうこと? Zig探訪では、Zigの機能や特徴の中で面白いんじゃないかと思うものをピックアップして紹介していきます。 紹介しないこともあります。 第2回のテーマは、Zigを取り囲むエコシステムについてです。 実際にコーディングをする上で開発体験に大きく影響を与える部分ですね。 最近の言語だと、ただ言語仕様自体が優れているだけでは不

                              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)
                              • Basic MetaProgramming in Zig

                                While I've written a lot about Zig, I've avoided talking about Zig's meta programming capabilities which, in Zig, generally falls under the "comptime" umbrella. The idea behind "comptime" is to allow Zig code to be run at compile time in order to generate code. It's often said that an advantage of Zig's comptime is that it's just Zig code, as opposed to a separate, often limited, language as seen

                                • 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の@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

                                        • Zig is now also a Windows resource compiler - ryanliptak.com

                                          As of a few weeks ago, a cross-platform Windows resource compiler called resinator that I've been working on has been merged into the Zig compiler. This means that the latest master version of Zig can now compile (and cross-compile) Windows resource-definition script (.rc) files for you and link the resulting .res into your program. In addition, the PE/COFF resource table is also used for embedded

                                          • https://lukewilliamboswell.github.io/roc-ray-experiment/

                                            • [Zig] Arena Allocatorを使った "ふつうの" Zigプログラミング

                                              タイトルは、『ふつうのHaskellプログラミング』にちなんでみた。一見難しく感じるZigが、Pythonなどのように"ふつうに"使えると感じるきっかけにこの記事がなると嬉しい。 (記事自体の難易度もふつうにしたかったのだけれど、自分の技量不足で専門用語が多くなってしまったので、今後加筆して簡単にいきたい。) 自分がZigを書き始めようと思った理由はいくつかあるのだけれど、一番大きな理由は「Arena Allocator(アリーナ・アロケーター)」を理解したことが大きかった。 Zigなどのメモリを自分で管理しなければならない言語というのは、開発コストが大きい、と自然に感じてしまう。自分もZigに以前から魅力を感じていたけれど、それがネックで長い間敬遠していた。 ちなみにArena Allocatorを自分が知ったきっかけは実はZigではなく、EmberGenという有名なリアルタイムシミュレ

                                                [Zig] Arena Allocatorを使った "ふつうの" Zigプログラミング
                                              • When Zig outshines Rust - Memory efficient enum arrays

                                                Enums (or tagged unions) whose variants vary in size are prone to significant memory fragmentation in Rust. That's because we need to allocate enough data to accommodate the largest variant. Figure 1: Consider the following enum: This presents real pain when collecting a large number of them into a Vec or HashMap. The padding can be dealt with using some form of struct of arrays (SoA) transformati

                                                • Using Zig to Call C Code: Strings

                                                  Zig is a new, open-source programming language designed to replace C. I’m still a Zig beginner, so I’m trying to learn the language by using Zig to rewrite parts of existing C applications. One of the first challenges I encountered with Zig is understanding strings. I couldn’t find detailed documentation about how Zig strings work when calling C code, so I’m sharing my findings in case they’re hel

                                                  • Zig's New CLI Progress Bar Explained - Andrew Kelley

                                                    Zig's New CLI Progress Bar Explained Sometimes, programming projects are too easy and boring. Sometimes, they're too hard, never ending or producing subpar results. This past week I had the pleasure of completing a project that felt like maximum difficulty - only possible because I am at the top of my game, using a programming language designed for making perfect software. This problem threw every

                                                    • ZigでWeb Assemblyのインタプリタを書いてみた | 株式会社ヌーラボ(Nulab inc.)

                                                      プログラミング言語Zigを使ってWebAssembly (Wasm) のインタプリタを書いてみました。SIMD命令以外のテストは通っているので、Core Specification version 1.0の範囲はサポートできているはずです。 作ったインタプリタの紹介 作ったインタプリタはGitHubで公開済みなのでクローンして試すことができます。クローン後、Zigを導入済みであれば zig runで実行できます。 試しに2つの整数の足し算関数addを含む次のようなWasmバイナリを実行させてみましょう。まず、wasm-objdumpでバイナリの中身を確認してみます。2つの整数を取り1つの整数を返すaddという関数があり、それが単に足し算をしているだけであるのがわかります。 ❯ wasm-objdump -dx add.wasm add.wasm: file format wasm 0x1

                                                        ZigでWeb Assemblyのインタプリタを書いてみた | 株式会社ヌーラボ(Nulab inc.)
                                                      • GitHub - judofyr/spice: Fine-grained parallelism with sub-nanosecond overhead in Zig

                                                        Spice uses heartbeat scheduling to accomplish extremely efficient parallelism in Zig: Sub-nanosecond overhead: Turning your function into a parallelism-enabled function adds less than a nanosecond of overhead. Contention-free: Threads will never compete (i.e. spin) over the same work. Adding more threads to the system will not make your program any slower, but the extra threads might be completely

                                                          GitHub - judofyr/spice: Fine-grained parallelism with sub-nanosecond overhead in Zig
                                                        • Why I am not yet ready to switch to Zig from Rust

                                                          Jun 19, 2024 Why I am not yet ready to switch to Zig from Rust I am not going to lie: I love programming in C. I know it’s a little bit irrational, but programming in C just feels right. Perhaps that’s because I did spend a lot of time programming with C as I contributed to the Linux kernel. Those were good times because I had the opportunity to learn from some of the best C programmers in the wor

                                                            Why I am not yet ready to switch to Zig from Rust
                                                          • 2024 Financial Report and Fundraiser ⚡ Zig Programming Language

                                                            2024 Financial Report and FundraiserZig Software Foundation is a 501(c)(3) non-profit organization which I am proud to say makes extremely efficient use of monetary resources. Unlike many of our peers, our primary expense is direct payments to contributors for their enhancements to the Zig project. Don’t take my word for it - let’s look at some numbers. 2023 Expenditures

                                                            • 0.13.0 Release Notes ⚡ The Zig Programming Language

                                                              Tier 4 Support § Support for these targets is entirely experimental. If this target is provided by LLVM, LLVM may have the target as an experimental target, which means that you need to use Zig-provided binaries for the target to be available, or build LLVM from source with special configure flags. zig targets will display the target if it is available. This target may be considered deprecated by

                                                              • Tokamak: A web framework for Zig – Kamil Tomšík

                                                                I’ve been recently extracting some parts of Ava into a separate open-source projects, and one of them is Tokamak, a web framework for Zig. So first of all, why Zig? Zig is a very interesting language, it’s a low-level language but with a very powerful metaprogramming support. Hm… ok, I’m too far ahead, so maybe let’s start from the beginning… AllocatorsAt first, I thought Zig is not a good fit for

                                                                • Thoughts on Zig

                                                                  Zig is a programming language designed by Andrew Kelley. The official website lists three principles of the language: No hidden control flow. No hidden memory allocations. No preprocessor, no macros. For someone like me coming mostly from Rust, Go and TypeScript, this is different—and different is interesting, so I wanted to know what it feels like to write code in it. Here are my thoughts after 3

                                                                    Thoughts on Zig
                                                                  • GitHub - cztomsik/tokamak: Server-side framework for Zig, relying heavily on dependency injection.

                                                                    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 - cztomsik/tokamak: Server-side framework for Zig, relying heavily on dependency injection.
                                                                    • Effective TypeScript › A TypeScripter's Take on Zig (Advent of Code 2023)

                                                                      What can Zig learn from TypeScript, and what can TypeScript learn from Zig? The Advent of Code is a fun annual programming competition with an Elf theme. It consists of 25 two-part problems of increasing difficulty, released every day in December leading up to Christmas. Every December, I complete it in a new programming language. Every January, I intend to blog about the experience. Usually this

                                                                        Effective TypeScript › A TypeScripter's Take on Zig (Advent of Code 2023)
                                                                      • Intercepting and modifying Linux system calls with ptrace | notes.eatonphil.com

                                                                        How software fails is interesting. But real-world errors can be infrequent to manifest. Fault injection is a formal-sounding term that just means: trying to explicitly trigger errors in the hopes of discovering bad logic, typically during automated tests. Jepsen and ChaosMonkey are two famous examples that help to trigger process and network failure. But what about disk and filesystem errors? A fe

                                                                        • Zig 言語の練習に AtCoder 202308 新ジャッジテストコンテスト A-E を解いてみた - Qiita

                                                                          はじめに AtCoder 2023年8月の 新ジャッジコンテストから、Zig 0.10.1 が使えるようになりました。 ホーム ⚡ Zig Programming Language 普段 Rust で AtCoder ABC に参加しています。 Zig 言語は Rust 同様に高速なバイナリ出力を狙った、Rust とは違うアプローチのモダンな言語と言うことで、気になっていました。 Zig 言語は Bun の開発で使われていることでも話題です。今月 Bun 1.0 になりました。 Bun — A fast all-in-one JavaScript runtime というわけで、AtCoder 202308 新ジャッジテストコンテスト -Algorithm- の問題を Zig 言語で解いてみて、感想を書こうという記事です。超初心者ですので変なところも多いかもしれませんがご了承ください。 対象

                                                                            Zig 言語の練習に AtCoder 202308 新ジャッジテストコンテスト A-E を解いてみた - Qiita
                                                                          • 既存のC言語による実装をインクリメンタルにZigに移植する

                                                                            興味深い記事を見つけました。 気に入ったところだけピックアップして紹介するので、ぜひ原文も読んでください。 Zig is an ideal language for incrementally porting existing C code to as I’ll hopefully show. Zigは既存のCのコードをインクリメンタルに(少しずつ)移植するのに理想的な言語です。これからそれを紹介します。 Mini-RV32ima Mini-RV32imaはひとつのCのヘッダファイルからなるRISC-Vのエミュレータです。(このエミュレータでLinuxカーネルを起動することが可能です) 私(元のブログの筆者)はRISC-Vのことをあまり知りません。RISC-Vのリファレンスを見るよりもCのコードを一行ずつ忠実にZigに書き直しました。 最初の一歩 zig はCコンパイラとして使うこともでき

                                                                              既存のC言語による実装をインクリメンタルにZigに移植する
                                                                            • Zigで書いたDLLをRustで読み込む

                                                                              姉妹編 Windows版アイヌ語IMEを作るにあたって、ZigでTSFライブラリを書いてみたいけど、やはり設定画面などGUIはtauriとSvelteKitで作りたいので、とりあえず最初のステップとして(?)RustとZigのインターロップを勉強しておきたいのでやってみました。 はじめに 本稿では、RustのアプリにZigで生成されたDLL(ダイナミック・リンク・ライブラリ)を読み込む方法についてお話します。せっかくなのでリンクする方法と、ロードする方法の両方についてご紹介します。基本的にはWindows中心ですが、Linuxなどでも似たような手順でできるかと思われます。 TL;DR C ABIを介してやります。ロードする場合はlibloadingを使います。 インストール Rustのインストール方法(公式・日本語) Zigのインストール方法(公式・日本語・古い) TL;DR (Windo

                                                                                Zigで書いたDLLをRustで読み込む
                                                                              1