Deus Lex Machina - Validark's Blog
Другая версия токенайзера для Zig, с упором на производительность
https://validark.dev/posts/deus-lex-machina/
#блоги
Другая версия токенайзера для Zig, с упором на производительность
https://validark.dev/posts/deus-lex-machina/
#блоги
Validark's Blog
Deus Lex Machina - Validark's Blog
A new compaction-based tokenizer for the Zig programming language
❤4🔥1🤔1
Язык Zig (канал)
https://github.com/Validark/Accelerated-Zig-Parser
это вторая версия того же токенайзера
👍1
Forwarded from TheCodePunk
Опубликовал новую главу о работе с файлами и директориями — рассказываю, как их создавать, читать, удалять и обходить. Как всегда, буду рад, если материал окажется полезным. Приятного чтения! - https://thecodepunk.com/posts/zigbook23/
👍13
Forwarded from Андрей Краевский
YouTube
Packages, Modules, Dependencies - Zig Build System Basics
https://ziglang.org/learn/build-system/
https://github.com/kristoff-it
https://github.com/allyourcodebase
https://zig.day
https://www.twitch.tv/kristoff_it
0:00 Intro
0:25 Basics
1:24 Zig Package
4:38 Declaring Zig Modules
6:30 Declaring Executables
11:31…
https://github.com/kristoff-it
https://github.com/allyourcodebase
https://zig.day
https://www.twitch.tv/kristoff_it
0:00 Intro
0:25 Basics
1:24 Zig Package
4:38 Declaring Zig Modules
6:30 Declaring Executables
11:31…
🔥6❤4
Comptime аллокатор от mlugg:
https://zigbin.io/9a46a9
https://zigbin.io/9a46a9
pub const comptime_allocator: Allocator = .{
.ptr = undefined,
.vtable = &.{ .alloc = &comptimeAlloc, .resize = &comptimeResize, .remap = &comptimeRemap, .free = &Allocator.noFree },
};
fn comptimeAlloc(_: *anyopaque, len: usize, alignment: Alignment, ra: usize) ?[*]u8 {
_ = ra;
if (!@inComptime()) @panic("comptimeAlloc called at runtime");
var buf: [len]u8 align(alignment.toByteUnits()) = undefined;
return &buf;
}
fn comptimeResize(_: *anyopaque, mem: []u8, alignment: Alignment, new_len: usize, ra: usize) bool {
_ = alignment;
_ = ra;
if (!@inComptime()) @panic("comptimeResize called at runtime");
return new_len <= mem.len; // allow shrinking in-place
}
fn comptimeRemap(_: *anyopaque, mem: []u8, alignment: Alignment, new_len: usize, ra: usize) ?[*]u8 {
_ = alignment;
_ = ra;
if (!@inComptime()) @panic("comptimeRemap called at runtime");
return if (new_len <= mem.len) mem.ptr else null; // allow shrinking in-place
}
comptime {
var al: std.ArrayListUnmanaged(u32) = .empty;
defer al.deinit(comptime_allocator);
al.appendSlice(comptime_allocator, &.{ 1, 2, 3 }) catch unreachable;
al.appendNTimes(comptime_allocator, 42, 256) catch unreachable;
std.debug.assert(al.items.len == 256 + 3);
std.debug.assert(al.items[0] == 1);
std.debug.assert(al.items[1] == 2);
std.debug.assert(al.items[2] == 3);
for (al.items[3..]) |x| {
std.debug.assert(x == 42);
}
}
const std = @import("std");
const Allocator = std.mem.Allocator;
const Alignment = std.mem.Alignment;🤔8❤4🤩2🤯1
Тут официальный список зеркал для Zig добавили:
https://ziglang.org/download/community-mirrors/
Пока что используется только в https://github.com/marketplace/actions/setup-zig-compiler, но mlugg предлагает авторам програм по типу zigup и zvm тоже его использовать
#upstream
https://ziglang.org/download/community-mirrors/
Пока что используется только в https://github.com/marketplace/actions/setup-zig-compiler, но mlugg предлагает авторам програм по типу zigup и zvm тоже его использовать
#upstream
GitHub
Setup Zig Compiler - GitHub Marketplace
Download and install the Zig compiler, and cache the global Zig cache
👍3❤2
Zig Roadmap 2026
Через два дня, 2 июля в 16:00 по UTC:
* Производительность компилятора
* Опять про async/await
* Fuzzing with coverage
* Деньжата и сообщество
#блоги #upstream
Через два дня, 2 июля в 16:00 по UTC:
* Производительность компилятора
* Опять про async/await
* Fuzzing with coverage
* Деньжата и сообщество
#блоги #upstream
👍6
Forwarded from Serg Gini
YouTube
Zig and Rust in Production (ft. Matklad)
Twitch https://twitch.tv/ThePrimeagen
Discord https://discord.gg/ThePrimeagen
00:00:00 - How matklad got his name
00:01:25 - What is Tiger Beetle?
00:03:01 - NO DYNAMIC ALLOCATIONS?
00:05:17 - Consensus Algorithms
00:09:02 - Scaling
00:16:00 - NASA 10 Rules…
Discord https://discord.gg/ThePrimeagen
00:00:00 - How matklad got his name
00:01:25 - What is Tiger Beetle?
00:03:01 - NO DYNAMIC ALLOCATIONS?
00:05:17 - Consensus Algorithms
00:09:02 - Scaling
00:16:00 - NASA 10 Rules…
🔥13👍2🤯1
remove async and await keywords; remove usingnamespace
Из хорошего: удалили async и await, так что теперь функции из нового плана можно писать без @"..."
Из плохого: убили usingnamespace окончательно...
#upstream
Из хорошего: удалили async и await, так что теперь функции из нового плана можно писать без @"..."
Из плохого: убили usingnamespace окончательно...
#upstream
GitHub
remove `async` and `await` keywords; remove `usingnamespace` by andrewrk · Pull Request #24362 · ziglang/zig
async and await keyword removal
Also remove @frameSize, closing #3654.
While the other machinery might remain depending on #23446, it is settled that there will not be async/ await keywords in the ...
Also remove @frameSize, closing #3654.
While the other machinery might remain depending on #23446, it is settled that there will not be async/ await keywords in the ...
🎉12👍1