Remix.run Logo
olivia-banks 2 days ago

I agree with the "off" part. I've thought maybe it's the syntax? It's unclear, but I'm just hoping the feeling will go away! I find the IO changes to be strange, it's almost as if Zig is encoding an effect system a-la Haskell (i.e. this function will have an allocation/IO side effect).

bsder 2 days ago | parent [-]

> I find the IO changes to be strange

Perhaps you just feel that way because of 10+ years of accreted expectations?

To me, it feels like a reinvention of an interesting idea: Fastbufs

https://www.ucw.cz/libucw/doc/ucw/fastbuf.html

I will concede that the ergonomics of Io in Zig right now are pretty rough sledding.

scuff3d 2 days ago | parent | next [-]

I said this elsewhere, but I think the awkwardness is coming from Zigs attitude towards interfaces. It seems like from a language design perspective they've been made intentionally awkward because they want to discourage their use, and fair enough. There are other options for sure. But now they want to base Io around interfaces. So Writers and Readers, it sounds like Async as well, and of course Allocators were already using interfaces. If they are going to become that fundamental to core features of the language, I think a more ergonomic way to work them needs to be a higher priority.

bsder 2 days ago | parent [-]

> It seems like from a language design perspective they've been made intentionally awkward

Awkward relative to what?

Relative to C? Did you look at my link to Fastbufs? Take a look at that and then get back to me how awkward Zig is relative to that.

Zig seems to be aiming to be a better C. Full stop. If you want abstraction, RAII and other higher-level stuff, C++ and Rust exist.

> If they are going to become that fundamental to core features of the language, I think a more ergonomic way to work them needs to be a higher priority.

I don't disagree. However, there have really only been two times so far that significant "interfaces" have churned like this (Allocgate and Writergate). Allocgate was driven by the fact that the previous implementation had real, measurable performance issues. Presumably, Writergate is being driven by similar problems. I'm actually really happy that someone is designing a language while paying very strict attention to the performance of both the compiler and the compiled code.

It's really hard to generalize until you get a couple of concrete examples under your belt. Trying to make an "interface" more ergonomic when it may get nuked from orbit in a couple of versions is kind of pointless.

I have plenty of gripes about Zig, but "interface churn" or "ergonomics" aren't very high on my list. I signed up for a language that is pre-1.0, so, while I may get annoyed, I also have to admit that I did this to myself.

pjmlp 2 days ago | parent [-]

> Zig seems to be aiming to be a better C.

Modula-2 and Object Pascal already did that for me, before I cared with C on MS-DOS, unfortunely one did not come with UNIX as selling point, and the other had the two industry giants that cared doing the wrong decisions.

0-R-1-0-N 2 days ago | parent | prev [-]

Io as an interface isn’t released yet, I say wait and let’s try it out. Maybe it’s crap and something else will be implemented like the other previous async solutions in zig. Since zig isn’t a 1.0 lang yet it’s expected to have some pitfalls and breakage.