Язык Zig (канал)
174 subscribers
28 photos
3 videos
6 files
241 links
Download Telegram
Ziglings мигрируют с GitHub на Codeberg:
* старый репозиторий https://github.com/ratfactor/ziglings
* новый репозиторий https://codeberg.org/ziglings/exercises/
* ещё есть https://ziglings.org/, который перенаправляет на ссылку выше.

Анонс на https://github.com/ratfactor/ziglings/issues/360, объяснение причин на https://ratfactor.com/leaving-github (вкратце — новое требование обязать включить 2FA некоторым аккаунтам было последней каплей для автора)
🔥4
https://www.twitch.tv/andrewrok/

> in about 1.5 hours from now I'll go live to do a big merge train. choo choo! all aboard the merge train!! 🚄 🚃 🚃 🚃 🔥

ну вы поняли
#стримы #upstream
Язык Zig (канал)
https://www.twitch.tv/andrewrok/ > in about 1.5 hours from now I'll go live to do a big merge train. choo choo! all aboard the merge train!! 🚄 🚃 🚃 🚃 🔥 ну вы поняли #стримы #upstream
остался 1 час.. бомбите пулл реувестами пока не поздно)))) (шучу, ну и походу они пока что в таком графике будут работать — что-то жирное для инкрементальной компиляции => немного отлагают пулл реквесты)
Дожили???
https://github.com/ZigC-Lang/zigc

ZigC is a C-like language with a lot of modern concepts introduced in Zig language, and getting rid of a lot of seemingly unnecessary features from C/C++ and embarrassing peculiarities from Zig syntax.
In result, ZigC is easier than C++/Rust, faster than Go/Java, safer than C/C++, familiar than Rust/Zig, smaller than Rust/C++, and more machine friendly than C/C++/Rust/Go.

...блабла...

...блабла...

ZigC corrected Zig syntax as follows:
* Back to C like syntax from Pascal-like variable, function declaration.
* JSON like struct iniatialization.
* Array bracket [] for array initialization.
* Simple for loops, removing crapy while/for syntax.
* Semicolon in struct/union, instead of comma.
* Back to switch/case/default.
* Non-null, non-error 'quotation, instead of |capture|.
* Error sets merge A|B, not A||B.
* Array concat + and mult *, not ++ and **.
* anyframe(return_type) not anyframe->return_type.
* Public and static.
* Non-public main.
* ! operator, not try ...
* catch (null), instead of 'orelse'.

В репозитории только примеры кода кстати.
🤨3
Язык Zig (канал)
Дожили??? https://github.com/ZigC-Lang/zigc ZigC is a C-like language with a lot of modern concepts introduced in Zig language, and getting rid of a lot of seemingly unnecessary features from C/C++ and embarrassing peculiarities from Zig syntax. In result…
https://github.com/ZigC-Lang/zigc/blob/102b162a30626d0d7c1885da1acdd44d9e7c125f/15.%20ZigC%20Syntax%20Principle.md

Followings are how ZigC syntax is formulated:
* shoul be most comfortable for C programmers.
should accommodate all modern syntax introduced by Zig, but in more C-like way.
* should take simplist form, comparing among other modern languages.
* should guarrantee zero overhead on Zig, which also guarrantees zero overhead on C.
* may take away unnecessary details from Zig, if possible.
* may compromise rigid rules, if it helps programmer's happyness.
* may slightly sacrifice compile time, if it helps programmer's sanity.
Debugging a Zig Test Failure
https://zinascii.com/2023/debugging-a-zig-test-failure.html
Про исправление ошибки в стандартной библиотеки Zig для платформы Illumos (если точнее, дистрибутив OmniOS). Много разьяснений и мыслей (ну или воды, для кого как) про отладку, DTrace и т.д.

#блоги
Парный стрим kristoff_it и andrewrk по программированию https://www.twitch.tv/kristoff_it
#стримы
🔥1
https://github.com/ziglang/zig/pull/17497
pub fn fatal(comptime fmt: []const u8, args: anytype) error{TestFatal} {
fail(fmt, args);
return error.TestFatal;
}
оказывается можно писать и так, думал только error{TestFatal}!void (и т.д.) работает
usingnamespace оказывается ещё и на enum/union работает... (я думал только на struct и opaque) тот же результат — публичные обьявления ре-экспортируются
Язык Zig (канал)
usingnamespace оказывается ещё и на enum/union работает... (я думал только на struct и opaque) тот же результат — публичные обьявления ре-экспортируются
const Location = enum(u32) {
box = 0,
stolovaya = 1,
workshop = 2,
mine = 3,
_,

pub const start_facilites: u32 = 2;
pub const end_facilities: u32 = 3;
}

const Everything = struct {
pub usingnamespace Location; // теперь можно писать Everything.start_facilities, но не Everything.box пушто не публичное обьявление, а просто член
};
очередной compiler meeting в дискорде начался
Forwarded from Königskraut
немного оффтопик, но смотрите что теперь в телеграме есть

const std = @import("std");

pub fn main() !void {
std.debug.print("kek\n", .{});
}
2👍2🤯1
Königskraut
немного оффтопик, но смотрите что теперь в телеграме есть const std = @import("std"); pub fn main() !void { std.debug.print("kek\n", .{}); }
В k версии [1.9.6 (418)] старый вид, в z/a [10.0.15] новый (с кнопкой копировать) но подсветки нет, в десктоп клиенте [4.11.1] есть и кнопка и подсветка
Кстати насчёт той весёлой задачки „Man or boy test” с Rosetta Code, я по фану сегодня таки сделал её (немного схитрил внутри, но шо поделать — Зиг так хочет), вроде работает с правильными результатами вплоть до 20, дальше мне стека не хватило:

https://rosettacode.org/wiki/Man_or_boy_test?oldid=358095#Zig
🤔1