* Comptime, which can serve the purpose of generics without a new sub-language [1]
* Colorblind async-await, basically parameterizing async-ness to avoid the downsides of async's infectious nature [2]
* Hot-code swapping proof-of-concept [3] (Edit: specifically, new to low-level languages, AFAICT)
Pretty cool stuff!
[1] https://kristoff.it/blog/what-is-zig-comptime/
[2] https://kristoff.it/blog/zig-colorblind-async-await/
[3] https://www.reddit.com/r/Zig/comments/s9toy1/we_have_a_worki...
Hot-code swapping seems to require a lot of tricky code. Are there compelling use cases that justify the implementation effort?
The examples seem to be mostly focused on swapping out functions but I dot see how it could handle structural changes to data structures.
[1]: https://gavinhoward.com/2022/04/i-believe-zig-has-function-c...
I'm not sure you are using the same notion of "colorblind" as most people. All that is claimed is that much application code can be *compile time generic* over the async-ness of the I/O functions it calls. Stepping up the requirements to being runtime generic introduces some difficult concerns about the different error sets of different I/O functions, but async vs. non-async can be handled as in the above gist or by writing like one switch statement.
Months later I read Gavin's post (linked above). I found that post immensely helpful to understand Zig's design around sync/async function colors (thanks Gavin!). Gavin's post helped to illuminate for me that Zig functions do have colors, but that the compiler can infer the color in most usual cases. This is still very exciting!
As I see it, it's not to Zig's detriment whether it "has" function colors or not, I don't really care. I'm really excited about Zig either way. But I personally (coming from a decade+ of JS/Python/Go) found the verbiage I found used to describe Zig's behavior here confusing.
The original color article is soo annoying, because it presents two things as one: a JS-specific limitation, and author's arbitrary opinion on how async syntax should (not) look like. Since then even languages that don't have JS's limitation still keep chasing the other point, because otherwise they're shamed for having "color".
Not only do threads not really do the thing (in part because of the high cost of threads compared to alternatives), the alternative isn't only threads. Users of Lua, Greenlet, ucontext_t, libco, etc. have been able to write single-threaded code that's generic over the async-ness of its callees for decades. Recently there's a trend toward preferring needing to change 99 call sites and function signatures when adding a single piece of I/O to a single function though, needing to write two versions of each library, etc.
Plenty of coments of mine where I list what exists since their early days.
Yes, C++ compilers like Visual C++ support it. Or Unreal tooling like Live++.
Common Lisp is only hot-swappable when you're not running a binary, at least from what I know of SBCL.
So, it's hard to take your comment seriously. I am unfamiliar with Visual C++'s hot-swapping capabilities, but to claim the language itself can do it seems pretty ridiculous to me, as all you've got is machine code at runtime, C++ has no hot-swapping runtime and could never have one... which makes me think you're just confused about what we're talking about... I am not talking about debuggers here.
Maybe spend some time using proper Lisps like LispWorks and Allegro Common Lisp.
Language and implementation aren't the same thing.
There is so much to learn about compilers, young padawan.
Which is false.
It's not a question of inventing it, but rather of making it mainstream popular.
Oberon used hot code reload for OS modules.
Visual C++ has had edit-and-continue for years, and hot reload as improvement since the last two years.