←back to thread

228 points Retro_Dev | 8 comments | | HN request time: 0.805s | source | bottom
Show context
brabel ◴[] No.44461708[source]
I like Zig but it seems to just keep redesigning itself, while other languages like Odin “shipped” long ago and don’t seem to need to look back. Is Zig suffering from perfectionism syndrome where things are never good enough??
replies(7): >>44461733 #>>44461743 #>>44461761 #>>44461828 #>>44461832 #>>44461929 #>>44470782 #
1. audunw ◴[] No.44461832[source]
This is a standard library change, not a syntax change

I think the main big thing that’s left for 1.0 is to resurrect async/await.. and that’s a huge thing because arguably very few if any language has gotten that truly right.

As the PR description mentions: “This is part of a series of changes leading up to "I/O as an Interface" and Async/Await Resurrection.”

So this work is partially related to getting async/await right. And getting IO right is a very important part of that.

I think it’s a good idea for Zig to try to avoid a Python 3 situation after they reach 1.0. The project seems fairly focused to me, but they’re trying to solve some difficult problems. And they spend more time working on the compiler and compiler infrastructure than other languages, which is also good. Working on their own backend is actually critical for the language itself, because part of what’s holding Zig back from doing async right is limitations and flaws in LLVM

replies(2): >>44461905 #>>44462237 #
2. dosshell ◴[] No.44461905[source]
>> because part of what’s holding Zig back from doing async right is limitations and flaws in LLVM

this was interesting! Do you have a link or something to be able to read about it?

replies(2): >>44462067 #>>44463710 #
3. audunw ◴[] No.44462067[source]
Much of the discussion is buried in the various GitHub issues related to async. I found something of a summary in this Reddit comment

https://www.reddit.com/r/Zig/comments/1d66gtp/comment/l6umbt...

4. travisgriggs ◴[] No.44462237[source]
> I think the main big thing that’s left for 1.0 is to resurrect async/await.. and that’s a huge thing because arguably very few if any language has gotten that truly right.

Interesting. I like Zig. I dabble periodically. I’m hoping that maturity and our next generation ag tech device in a few years might intersect.

Throwing another colored function debacle in a language, replete with yet another round of the familiar but defined slightly differently keywords, would be a big turn off for me. I don’t even know if Grand Central Dispatch counts, but it—and of course Elixir/Erlang—are the only two “on beyond closures/callbacks” asynch system I’ve found worked well.

replies(3): >>44462297 #>>44463132 #>>44463761 #
5. messe ◴[] No.44462297[source]
As far as I know, Zig still wants their implementation of async to avoid function colouring.
6. stratts ◴[] No.44463132[source]
My understanding is that the current plans are to implement async in userspace, as part of a broader IO overhaul.

This would involve removing async/await as keywords from the language.

7. throwawaymaths ◴[] No.44463710[source]
iirc the llvm async operation does heap allocations?
8. throwawaymaths ◴[] No.44463761[source]
part of function coloring is "not being trivially resolvable". in this case the function coloring boundary is trivially resolvable.

    const pick_a_global_io = ...;

    fn needs_io(io:IO) void {...}

    fn doesnt_take_io() void {
       needs_io(pick_a_global_io);
    }

easy peasy. you've resolved the coloring boundary.

now, if you want to be a library writer, yeah, you have to color your functions if you don't want to be an asshole, but for the 95% use case this is not function coloring.