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 некоторым аккаунтам было последней каплей для автора)
* старый репозиторий 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 некоторым аккаунтам было последней каплей для автора)
GitHub
GitHub - ratfactor/ziglings: Learn the Zig programming language by fixing tiny broken programs.
Learn the Zig programming language by fixing tiny broken programs. - ratfactor/ziglings
🔥4
Язык Zig (канал)
https://www.twitch.tv/vexu0 великий чинитель стримит > новый translate-c на базе Arocc для Zig
Второй translate-c на основе Aro (скорее всего полностью заменит первый translate-c на выхлопе Clang, связанное предложение https://github.com/ziglang/zig/issues/16268)
https://github.com/ziglang/zig/pull/17221
#upstream
https://github.com/ziglang/zig/pull/17221
#upstream
GitHub
upstream Aro and use it for translate-c instead of clang · Issue #16268 · ziglang/zig
Aro is a C compiler written in Zig by @Vexu and @ehaas. This issue is for transitioning Zig's translate-c feature from being based on Clang to being based on Aro. The transition will probably n...
⚡1🔥1
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
> 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
Twitch
andrewrok - Twitch
Lead developer & president of Zig Software Foundation.
Язык 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'.
В репозитории только примеры кода кстати.
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'.
В репозитории только примеры кода кстати.
GitHub
GitHub - ZigC-Lang/zigc: ZigC Language Description
ZigC Language Description. Contribute to ZigC-Lang/zigc development by creating an account on GitHub.
🤨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.
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.
GitHub
zigc/15. ZigC Syntax Principle.md at 102b162a30626d0d7c1885da1acdd44d9e7c125f · ZigC-Lang/zigc
ZigC Language Description. Contribute to ZigC-Lang/zigc development by creating an account on GitHub.
Язык Zig (канал)
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…
Я так понял это чудо строится ПОВЕРХ Zig, вот он, наш ответ C++... Zig+-
🤣2
Debugging a Zig Test Failure
https://zinascii.com/2023/debugging-a-zig-test-failure.html
Про исправление ошибки в стандартной библиотеки Zig для платформы Illumos (если точнее, дистрибутив OmniOS). Много разьяснений и мыслей (ну или воды, для кого как) про отладку, DTrace и т.д.
#блоги
https://zinascii.com/2023/debugging-a-zig-test-failure.html
Про исправление ошибки в стандартной библиотеки Zig для платформы Illumos (если точнее, дистрибутив OmniOS). Много разьяснений и мыслей (ну или воды, для кого как) про отладку, DTrace и т.д.
#блоги
Zinascii
Debugging a Zig Test Failure
Debugging a Zig test failure using DTrace speculative tracing.
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 (и т.д.) работает
pub fn fatal(comptime fmt: []const u8, args: anytype) error{TestFatal} {
fail(fmt, args);
return error.TestFatal;
}
оказывается можно писать и так, думал только error{TestFatal}!void (и т.д.) работает
GitHub
std.testing: fail and fatal formatted messaging by pascaldekloe · Pull Request #17497 · ziglang/zig
Two new functions in std.testing:
/// Fail the test with a formatted message but continue execution, unlike fatal.
/// The common pattern is as follows.
///
/// ```zig
/// if (got != want)
/// ...
/// Fail the test with a formatted message but continue execution, unlike fatal.
/// The common pattern is as follows.
///
/// ```zig
/// if (got != want)
/// ...
BuiltinFunction: Use a generated DAFSA (deterministic acyclic finite state automaton) instead of a generated enum
https://github.com/Vexu/arocc/pull/524
related: оптимизация std.meta.stringToEnum https://github.com/ziglang/zig/issues/3863#issuecomment-1763271656
#upstream #производительность
https://github.com/Vexu/arocc/pull/524
related: оптимизация std.meta.stringToEnum https://github.com/ziglang/zig/issues/3863#issuecomment-1763271656
#upstream #производительность
GitHub
BuiltinFunction: Use a generated DAFSA instead of a generated enum by squeek502 · Pull Request #524 · Vexu/arocc
A DAFSA (deterministic acyclic finite state automaton) is essentially a trie flattened into an array, but that also uses techniques to minimize redundant nodes. This provides fast lookups while min...
Язык Zig (канал)
BuiltinFunction: Use a generated DAFSA (deterministic acyclic finite state automaton) instead of a generated enum https://github.com/Vexu/arocc/pull/524 related: оптимизация std.meta.stringToEnum https://github.com/ziglang/zig/issues/3863#issuecomment-1763271656…
GitHub
GitHub - Validark/Accelerated-Zig-Parser: A high-throughput parser for the Zig programming language.
A high-throughput parser for the Zig programming language. - Validark/Accelerated-Zig-Parser
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 пушто не публичное обьявление, а просто член
};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
https://rosettacode.org/wiki/Man_or_boy_test?oldid=358095#Zig
Rosetta Code
Man or boy test
Background: The man or boy test was proposed by computer scientist Donald Knuth as a means of evaluating implementations of the ALGOL 60 programming language. The...
🤔1