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
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
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
Zigは2015年に登場した新しいオープンソースのプログラミング言語です。Go言語やRust言語のように、C言語の置き換えを目標にしたコンパイラ言語です。その最大の特徴はシンプルであることです。確かに、マクロもプリプロセッサもありませんが、現代的な言語に仕上がっています。最近話題になることが増えてきたので試してみましょう。 ZigのWebサイト Zigとは Zigはアンドリュー・ケリー氏によって2015年に登場した新しいプログラミング言語です。コンパイラ基盤のLLVMを利用しており、幅広いOSに対応した実行ファイルを生成することができます。 Zigはシンプルをモットーとしています。Zigのマニュアルでは、C++やRust、D言語など多くの機能を持つ言語を挙げて、それらとは異なりシンプルであることを名言しています。 そして、その構文は、C言語と似ているのですが、遅延処理のdefer構文や型推
Zig And Rust Mar 26, 2023 This post will be a bit all over the place. Several months ago, I wrote Hard Mode Rust, exploring an allocation-conscious style of programming. In the ensuing discussion, @jamii name-dropped TigerBeetle, a reliable, distributed, fast, and small database written in Zig in a similar style, and, well, I now find myself writing Zig full-time, after more than seven years of Ru
3/7/2023 When Zig is safer and faster than Rust There are endless debates online about Rust vs. Zig, this post explores a side of the argument I don't think is mentioned enough. Intro / TLDRλ I was intrigued to learn that the Roc language rewrote their standard library from Rust to Zig. What made Zig the better option? They wrote that they were using a lot of unsafe Rust and it was getting in thei
Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. To follow this guide, we assume you have: Prior experience programming Some understanding of low-level programming concepts Knowing a language like C, C++, Rust, Go, Pascal, or similar will help you follow this guide. You must have an editor, terminal, and internet connection availab
Unsafe Zig is Safer than Unsafe Rust Consider the following Rust code: struct Foo { a: i32, b: i32, } fn main() { unsafe { let mut array: [u8; 1024] = [1; 1024]; let foo = std::mem::transmute::<&mut u8, &mut Foo>(&mut array[0]); foo.a += 1; } } This pattern is pretty common if you are interacting with Operating System APIs. Another example. Can you spot the problem with the code? It's pretty subtl
This post is also available in 简体中文 and 繁體中文. After the recent announcement regarding WASI support in Workers, I decided to see what it would take to get code written in Zig to run as a Worker, and it turned out to be trivial. This post documents the process I followed as a new user of Zig. It’s so exciting to see how Cloudflare Workers is a polyglot platform allowing you to write programs in the
Zig is also a C Compiler § One of the main features of Zig is @cImport and C Translation. This is accomplished by linking against Clang libraries. Clang is a fully featured C and C++ compiler. Zig has all this functionality - so we may as well expose it! The zig cc command exposes clang, which you can see with this amusing output: $ zig cc --version clang version 8.0.0 ... zig cc is a bit of a low
Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software. ⚡ A Simple LanguageFocus on debugging your application rather than debugging your programming language knowledge. No hidden control flow.No hidden memory allocations.No preprocessor, no macros.⚡ ComptimeA fresh approach to metaprogramming based on compile-time code execution and lazy
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く