[RU] Язык Zig (канал)
208 subscribers
74 photos
4 videos
11 files
331 links
Unofficial channel about Zig language (in Russian language)

Неофициальный канал про язык Zig (на русском языке)

Chat / Чат:
@ziglang_ru
Download Telegram
Час назад:

I'm planning to do a stream in an hour or two from now


https://mastodon.social/@andrewrk/116455170889340599

After a long, unplanned hiatus, I'll do a live coding stream starting in a couple hours from now.
Main topic will be a demo of some partially completed changes to the build system, and pushing forward on it a little bit.
Q&A will also be welcome from chat.
https://www.
twitch.tv/andrewrok/



Скоро стрим с показом обновлений в системе сборки от Эндрю
4🕊2
https://x.com/bunjavascript/status/2048427636414923250

In Bun’s zig fork, we added parallel semantic analysis and multiple codegen units to the llvm backend on macOS & Linux

This makes debug builds of Bun compile > 4x faster, improving internal development velocity


https://github.com/oven-sh/zig/compare/upgrade-0.15.2...upgrade-0.15.2-fast

We do not currently plan to upstream this, as Zig has a strict ban on LLM-authored contributions.
🤣9
[RU] Язык Zig (канал)
https://x.com/bunjavascript/status/2048427636414923250 In Bun’s zig fork, we added parallel semantic analysis and multiple codegen units to the llvm backend on macOS & Linux This makes debug builds of Bun compile > 4x faster, improving internal development…
В форк Zig от Bun мы добавили параллельный семантический анализ и генерацию кода по частям в LLVM-бэкенд для macOS и Linux.

Это ускорило компиляцию Bun (в режиме отладки) более чем в 4 раза, что сильно ускорило внутреннюю разработку.

Мы пока не планируем передавать это в основной проект, так как в Zig действует строгий запрет на любой вклад, созданный нейросетями.
😁6
На фоне недавней новости об эксперименте Bun с портированием с Zig на Rust, я вспомнил одну вещь.

В прошлые годы они ведь выделяли для Zig Software Foundation солидные суммы. Что теперь с ними будет? Уменьшится ли доход ZSF? Урежут ли тогда core team оплату мероприятий или себя?

https://ziglang.org/news/2025-financials/
В 2024 году было 60'000 USD.

Плюс к тому же двойной эффект, если донатеры пришедшие с волной популярности из-за Bun тоже уйдут.
👍1
[RU] Язык Zig (канал)
На фоне недавней новости об эксперименте Bun с портированием с Zig на Rust, я вспомнил одну вещь. В прошлые годы они ведь выделяли для Zig Software Foundation солидные суммы. Что теперь с ними будет? Уменьшится ли доход ZSF? Урежут ли тогда core team оплату…
https://x.com/arredsumner/status/2053047748191232310

Если вкратце:
1. Почти все (99.8%) тесты на x86_64-linux-gnu проходятся на Rust версии.
2. Сейчас код почти такой же, но компилятор теперь проверяет lifetime и добавили деструкторы.
3. Они устали думать над и исправлять ошибки по типу утечек памяти или краши, т.д. Хотят, чтобы язык это мощнее предотвращал.
4. Будет блог-пост с замерами скорости и потребления памяти, и как они этот порт сделали.
5. По скорости компиляции версия на Rust схожа с их форком Zig (где у них приватные поля в структурах и параллельная компиляция в LLVM), и быстрее официального Zig. Другими словами, для их проекта компилятор Zig медленнее компилятора Rust.

Порт содержит в себе 960 000 строк кода, за 6 дней
🤯5🥰1🐳1🤝1
[RU] Язык Zig (канал)
Rewrite Bun in Rust the binary size shrinks by 3 MB - 8 MB, the benchmarks are between neutral and faster
Мне напомнило это о долгой истории написания нового компилятора на Zig взамен старого на C++ во время примерно 0.7-0.10, как они сначала частями добавляли AstGen, Sema, какие-то части переиспользовали между stage1 и stage2, сколько лет это заняло т.д.

И как они некоторые фичи в то время пропустили, по типу второй версии async/await, мелкие фичи с @Vector

Если бы у главной команды были в то время LLM, сделали ли бы они эту миграцию намного быстрее? Скажем, не 5 лет (хотя честно говоря основной фокус был в последние годы), а месяц? Или может async/await бы не потеряли по пути? “export to C headers” ещё бы продолжал работать?

Или может Эндрю бы вообще не создавал Zig в 2015 и просто писал бы себе на C/C++ и JS (или даже Rust 1.0) дальше свои медиа-плееры и майнкрафт ботов?
👍3😁2
[RU] Язык Zig (канал)
Rewrite Bun in Rust the binary size shrinks by 3 MB - 8 MB, the benchmarks are between neutral and faster
https://news.ycombinator.com/item?id=48133806

The depth-of-recursion tests for TOML/JSONC parsers went from 25_000 -> 200_000 because Rust’s smaller stack frames (LLVM lifetime annotations let the optimizer reuse stack slots) mean 25k levels no longer reaches the 18 MB stack on Windows.


Довольно логично кстати, Zig часто просит слишком много памяти на стеке https://t.me/ziglang/384
1👍1
zig.exe fetch --save=blabla ../

на 0.15 все нормально было, на 0.16 в рекурсию уходит и диск сжирает за секунды буквально!

Кладите в другую папку или чистите .paths в build.zig.zon

У меня грубо говоря такой сетап был:
1. Пакет с build.zig и пустым paths в build.zig.zon (т.е. дефолт - всё включено)
2. Хотел импортировать его в примерах внутри папки examples/
3. С этой командой получается рекурсия zig-pkg/name.../examples/zig-pkg/name.../examples/zig-pkg/...

Я пофиксил, прописав конкретные paths.

Это на Windows 11 было, на других не тестил.

#предупреждение
👍3
https://zsf.zulipchat.com/#narrow/channel/454446-ecosystem/topic/improving.20the.20contributer.20to.20maintainer.20pipeline/near/595939945

@**Chris Boesch** I just want to reassure you along with everyone else who is trying to contribute that you're not doing anything wrong. On my end the reason you might not have gotten any review feedback lately is:
* focusing on finishing my own build system branch for the 0.17.0 tag
* going on vacation for 1 week
* dealing with personal matters in my life

The other core team members have their own reasons for how much time they spend on the PR queue. As a reminder, nobody including myself has committed to any particular amount of time. It's all best effort, goodwill type of situation.

With that in mind, however, there's a greater discussion to be had here, which is also taking place on ziggit.

After the 0.17.0 tag, I plan to focus on improving the contribution pipeline. We still have a lot to discuss, both publicly and internally, but in general I'd like to try to create a higher trust environment, where more people have more capability to unblock each other and themselves without bottlenecking on ~4.5 active core team members. Furthermore I'd like to solve the technical problem of the frequent codeberg downtime - either by self-hosting or by choosing a different technology that is resilient to outages.

In conclusion if contributors are feeling frustrated right now with the review queue, code forge stability and performance, and similar matters, you're not alone. Let's come up with a way to increase contributor trust and autonomy without compromising the integrity of the project, both from software quality perspective and as a community of people looking to hone their skills and resumes.

I would have preferred to just continue cooking, but sometimes you gotta sharpen your knives
👍1