logoalt Hacker News

Zig Zen Update

117 pointsby toshtoday at 8:38 AM56 commentsview on HN

Comments

mchermtoday at 9:32 AM

Nicely done!

I always felt that Python's "There should be one-- and preferably only one --obvious way to do it." was a bit of a mess.

Obviously (to anyone who was around at the time), that plank was written in response to Perl's motto: "There is more than one way to do it."

Zig's original take on this, "Only one obvious way to do things" seems even worse. You see, both languages agree that Perl had it wrong: it is unhelpful to have several different ways to write any future. But they went a little too far: it is not actually bad for it to be possible to write the same thing in more than one way.

Zig's new phrasing: "There is an idiomatic way to do it." captures the CORRECT alternative to Perl's motto. It is not important that there be no alternative ways of writing something, Rather, it is important that there be a single idiomatic way to write it.

show 4 replies
Panzerschrektoday at 12:46 PM

> Resource allocation may fail

Yes it can. But it's nearly impossible to handle such cases properly. That's why checking each allocation manually is a bad idea. Other languages do this better - they provide nice abstractions, but if something fails, the language runtime terminates the process. The result is the same, but has much less friction.

Also on some systems (like Linux) memory allocation may not fail, but the "allocated" memory may not be available and a program can crash accessing this memory.

show 4 replies
Validarktoday at 9:24 AM

Glad to see "Together we serve the users" come back. I miss the old Zig readme that said Zig comes with an MIT license and a humble request to build software that serves the users.

show 2 replies
alberthtoday at 12:32 PM

OT: any word on how Codeberg has been working out for Zig?

show 1 reply
rowbintoday at 9:18 AM

I'm out of the loop. Is there any context? Can't pick up on what really changed here.

show 1 reply
melon_tusktoday at 10:04 AM

I don't see how Zig will ever contend with Odin, Jai, C3 and others when they drive away half of the prospective users with activism.

show 7 replies