並び順

ブックマーク数

期間指定

  • から
  • まで

81 - 120 件 / 121件

新着順 人気順

Zigの検索結果81 - 120 件 / 121件

  • 0.5.0 Release Notes · The Zig Programming Language

    Tier System § Tier 1 Support § Not only can Zig generate machine code for these targets, but the standard library cross-platform abstractions have implementations for these targets. Thus it is practical to write a pure Zig application with no dependency on libc. The CI server automatically tests these targets on every commit to master branch, and updates the download page with links to pre-built b

    • 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, Parser Combinators - and Why They're Awesome

        In this article we will be exploring what parser combinators are, what runtime parser generation is - why they’re useful, and then walking through a Zig implementation of them. What are parser combinators?Why are parser combinators useful?Going deeper: runtime parser generationA note about traditional regex enginesImplementing the Parser interfaceCompile-time vs. run-timeThe parser interfaceZig ge

        • Zig's New Relationship with LLVM

          While not yet at version 1.0, Zig is about to reach a new level of maturity and stability. In the early days, Zig was but a thin frontend in front of LLVM. This was instrumental for getting started quickly and filling in gaps of Andrew’s knowledge as a compiler developer. Now, the training wheels of the bicycle are coming off, and LLVM is transitioning into an optional component. The work to repla

            Zig's New Relationship with LLVM
          • zig note

            zig言語学習帳。 しばらく zig してなかったのだが、また触り始める。 2周め。 `v0.11 dev~` 軌道に乗るまでに手間取りました。 他の言語と違うところ、初見でわかりにくいところのメモなど。 ~`v0.10`

              zig note
            • Zig, the small language

              If you look at the HackerNews headlines and comments - you may notice that every now and then people praise Zig, a relatively young programming language for low-level programming. Maybe not as low-level as assembler, but definitely as low-level as C or C++. I’m usually very skeptical about new languages, so naturally I wanted to give Zig a try. But after playing around and building a few toy proje

              • Zig探訪 - エコシステム編

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

                  Zig探訪 - エコシステム編
                • Is Zig the Long Awaited C Replacement

                  In many ways my whole programming career feels like a long wait for a replacement to C. 20 years ago I though that was C++. Over time I learned C++ was a complex monster that could never be tamed no matter how many thick best practices books I read.

                    Is Zig the Long Awaited C Replacement
                  • Zig 標準ライブラリで用意されているコレクション型をざっくり押さえる

                    Zig の標準ライブラリではコレクション型が提供されていますが、ドキュメント整備が途上ということもあり、どのようなコレクションが提供されているのかを把握するのが難しいと感じています。 提供されているコレクションを簡単にまとめ、適切な場面で適切なコレクション型を利用することができるようになることを狙いとした記事です。 なお、対象のZigバージョンは 0.10.0-dev.3513+e218b7ea0 です。 また、掲載しているサンプルコードは以下のgistにまとめてあります。 ArrayList 全要素がメモリ上で連続した領域に配置され、実行時に動的に長さを変えることができるコレクションです。 C++のstd::vector, Rustのstd::vec::Vec に相当します。 添字によるランダムアクセス、末尾への要素追加、順方向・逆方向のイテレーションをしたいユースケースで役立ちます。

                      Zig 標準ライブラリで用意されているコレクション型をざっくり押さえる
                    • https://swest.toppers.jp/SWEST22/program/pdfs/s3a_public.pdf

                      • How (memory) safe is zig?

                        I keep seeing discussions that equate zig's level of memory safety with c (or occasionally with rust!). Neither is particularly accurate. This is an attempt at a more detailed breakdown. This article is limited to memory safety. See Assorted thoughts on zig and rust for a more general comparison. I'm concerned mostly with security. In practice, it doesn't seem that any level of testing is sufficie

                        • Zig メモ

                          Zig に関する自分なりのメモを残しています。 学ぶモチベーション C++ や Rust を学ぶには難しそう Erlang VM の NIF 経由で Zig で書かれたライブラリを呼び出したい Zig で HWA を利用したエンコーダーとか作ってみたい macOS もしくは Linux で動けば良い Wasm に出力してブラウザで利用したい Zig の良いところ zig build は C のビルドツールとしても有用そう allocator の概念がわかりやすい std.crypto が充実している zig test がよくできている switch が好み 利用目的 WebTransport HTTP/3 QUIC HTTP/2 MLS (C++ / Wasm) Signal Protocol (C++ / Wasm) AV1 / VPX / Opus / Lyra 翻訳 自分向けに Zi

                            Zig メモ
                          • Zig で作ったブートローダーから Hello World するまで

                            この記事で書くこと 最近、低レイヤー周りの技術を学習しているなかでブートローダーを実装したので、頭の整理もかねて記事を書くことにしました。 ブートローダーで実行するカーネルは Hello World を出力するだけの自作カーネルで、メモリ管理やシステムコールなどの実装はしません。そのためブートローダーも自作カーネルを実行するのに必要な範囲の実装になっています。 ブートローダー、カーネルともに Zig で実装します。プログラムのビルドにも Zig が使えるので他にビルドツールを揃えなくてもいいところが嬉しいです。 Zig Language Reference ブートローダーを実行する リポジトリをクローンしてブートローダーを実行することができます。

                              Zig で作ったブートローダーから Hello World するまで
                            • Zig-style generics are not well-suited for most languages

                              Zig-style generics are not well-suited for most languages Too long; didn’t read: Zig’s compilation scheme for generics shares a lot of similarities with C++, and hence the pitfalls too. Such a compilation scheme is not well-suited to all languages, so armchair suggestions about how other languages should embrace Zig-style generics are misguided. Ain’t nobody handing out free lunches in Generics La

                              • 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
                                • Zigでかんたんな自作言語のコンパイラを書いた

                                  ブログに書いていたものを引っ越してきて一部手直ししました。元の記事公開日は 2021-01-07 です。 かんたんな自作言語のコンパイラをいろんな言語で書いてみるシリーズ 11回目は Zig です。 ライフゲームのコンパイルが通ったのでヨシ、という程度の雑なものです。 Zig言語(ziglang)を触り始めて1週間くらいの人が、理解は後回しにしてとにかく動くものを作るぞ、という方向性で書いたもの(その程度のノリでかんたんに書けるコンパイラです)。 Zig のバージョンは 0.6.0。 (追記 2022-07-17: 0.9.1 に上げました) できたもの サイズはこんな感じ: $ wc -l {lexer,parser,codegen}.zig lib/{types,utils,json}.zig 189 lexer.zig 630 parser.zig 552 codegen.zig 2

                                    Zigでかんたんな自作言語のコンパイラを書いた
                                  • Playing the Open Source Game

                                    You've surely read plenty about how simple is good, but what's wrong with easy? The Zig project has a non-profit foundation that needs to be managed, a community to shape, and the actual language to develop. These are all big, complex problems that don't default to a positive outcome without active care. Andrew did an amazing job laying the foundations, from deliberately choosing a non-profit corp

                                      Playing the Open Source Game
                                    • 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)
                                      • Packed structs in Zig make bit/flag sets trivial

                                        As we’ve been building Mach engine, we’ve been using a neat little pattern in Zig that enables writing flag sets more nicely in Zig than in other languages. What is a flag set?We’ve been rewriting mach/gpu (WebGPU bindings for Zig) from scratch recently, so let’s take a flag set from the WebGPU C API:

                                          Packed structs in Zig make bit/flag sets trivial
                                        • GitHub - tigerbeetle/tigerbeetle: The distributed financial transactions database designed for mission critical safety and performance.

                                          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 - tigerbeetle/tigerbeetle: The distributed financial transactions database designed for mission critical safety and performance.
                                          • Coming Soon to a Zig Near You: HTTP Client

                                            Fore-forwarning: This post describes std.http efforts pre-0.11 zig. After the 0.11 release new features have been introduced, and some names have been changed, this post does not describe those changes. To attempt to keep this post as a useful guide: if you're using zig 0.12 (or a development version thereof, as 0.12 has not been released as of this edit), apply the following changes: Client.reque

                                              Coming Soon to a Zig Near You: HTTP Client
                                            • 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

                                                  • Integrating Zig and SwiftUI

                                                    Building a native GUI for a cross-platform application is a decades old problem. Nowadays, most people just don't and fallback to using a non-native experience such as Electron instead. One approach to building a native GUI for a cross-platform application is to write all of the business logic in a cross-platform language (C, Rust, Zig, etc.) and then write the platform-specific GUI code. This is

                                                    • Build an Efficient & Portable Programming Language with Zig

                                                      Build an Efficient & Portable Programming Language with Zig Building a programming language from scratch is no easy feat. In addition to creating the compiler, defining the standard library, and supporting tools like editors and build systems, you need to design the language — will it be imperative or functional? What systems will the language be used for? Will it have metaprogramming capabilities

                                                        Build an Efficient & Portable Programming Language with Zig
                                                      • Perfecting WebGPU/Dawn native graphics for Zig

                                                        We’ve just finished a complete rewrite of mach/gpu (WebGPU/Dawn bindings for Zig), with 700+ commits, ~7.4k LOC, and 100% API coverage. WebGPU (not to be confused with WebGL) is a modern graphics API, acting as a unified API to the underlying Vulkan/Metal/DirectX APIs. Despite it’s name, it is also designed for use in native applications via its C API. Dawn is the C++ implementation of WebGPU by G

                                                          Perfecting WebGPU/Dawn native graphics for Zig
                                                        • Zig 言語リファレンス

                                                          index.md これは Zig ドキュメント 0.10.1 を DeepL Pro と ChatGPT を利用して翻訳したものです。 一部 master なモノもあります、ごちゃ混ぜです 自分用に翻訳しています zig_doc_0.10.1.md Zig 言語リファレンス はじめに Zig は、堅牢で最適かつ再利用可能なソフトウェアを維持するための汎用プログラミング言語およびツールチェインです。 ロバスト メモリ不足などのエッジケースでも正しく動作する。 最適化 プログラムが最適に動作・実行されるように記述する。 再利用可能 同じコードが、制約の異なる多くの環境で動作します。 保守性 コンパイラや他のプログラマに意図を正確に伝えることができる。コードを読むためのオーバーヘッドが少なく、要件や環境の変化に強い言語です。 新しいことを学ぶのに一番効率的な方法は例を見ることであることが多いので

                                                            Zig 言語リファレンス
                                                          • Zig Is Self-Hosted Now, What's Next?

                                                            Why self-host Zig? For great justice, of course… and also a few more reasons actually. With the upcoming 0.10.0 release of Zig on November 1st, we are going to ship the new self-hosted compiler. This is the result of a huge amount of work that brings a lot of benefits, some obvious, some others less so. Even though the self-hosted compiler is now shipped, there's still more work to do on it but, a

                                                              Zig Is Self-Hosted Now, What's Next?
                                                            • Zig

                                                              This page collects my writing about the 🦎 Zig programming language. Compiler Internals An introduction to the internals of the Zig compiler. The articles currently cover an introduction of most of the compiler "frontend" -- the process from source code to just prior to machine code generation. Note: These are the internals for the self-hosted compiler, also known as the "stage2" compiler. At the

                                                              • GitHub - zig-gamedev/zig-gamedev: Main monorepo for @zig-gamedev libs and example applications

                                                                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 - zig-gamedev/zig-gamedev: Main monorepo for @zig-gamedev libs and example applications
                                                                • Zigの@typeInfoと@Typeを理解する

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

                                                                    Zigの@typeInfoと@Typeを理解する
                                                                  • 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を使いましょうという話
                                                                    • GitHub - ziglang/vscode-zig: Zig language support for VSCode

                                                                      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 - ziglang/vscode-zig: Zig language support for VSCode
                                                                      • Zig Build System Internals

                                                                        Zig has a built-in build system for building projects. It runs on every platform Zig supports and is capable of building everything from simple executables and libraries to complex, multi-artifact, multi-step projects. This page will dive into how the internals of the Zig build system works. Build systems are an extremely important detail of any software project. When they work, they can feel like

                                                                        • Looking into Zig

                                                                          I think that it was the Pragmatic Programmer that recommend that you should learn a new language a year. For me, in 2020 that was Rust. I read a bunch of books about the language, I read significant amount of code and wrote some non trivial amount of code in Rust. That was sufficient to get me to grok the language, I’m not a Rust developer by any mean, but I walked with Rusty shoes for long enough

                                                                            Looking into Zig
                                                                          • Zig Makes Rust Cross-compilation Just Work · Um, actually...

                                                                            Sat, May 22, 2021This post is a spiritual successor to Loris Cro’s Go cross-compilation. The encounterDuring a recent stage 2 meeting, Jakub Konka wanted to demo his progress on WASM support, but ran into problems with screen-sharing on Linux. After switching to his Mac to run it there, he found out that Wasmtime (a WASM runtime) doesn’t ship aarch64-macos pre-built binaries. But Wasmtime is an op

                                                                            • Zig, Skia, Clojure, Geometry and the Japanese TV Show: ICFP Contest 2021

                                                                              Zig, Skia, Clojure, Geometry and the Japanese TV Show: ICFP Contest 2021 Every year I participate in ICFP Contest, or ICFPC for short (ICFP stands for International Conference on Functional Programming). This is a team coding challenge that lasts for 72 hours and in which you have to solve a series of very hard tasks by writing (functional) code. Tasks are usually too hard to find a perfect soluti

                                                                                Zig, Skia, Clojure, Geometry and the Japanese TV Show: ICFP Contest 2021
                                                                              • I think Zig is hard...but worth it - ratfactor

                                                                                "I learned Zig in a weekend! …​Six hours! …​6µs!" say the blissful lizards. Followed by something to the effect of, "It’s easy to pick up because the syntax is so simple." That’s a sentiment I’ve seen thrown around a lot since 2016’s announcement, Introduction to the Zig Programming Language (andrewkelly.me). Clearly, many folks really do find Zig easy to learn. Veteran C programmers, in particula

                                                                                • 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