Live data from Hacker News

Zig 0.6.0 Release Notes

ziglang.org

11–20 of 33 posts

Re: Zig 0.6.0 Release Notes

#11
I am continuously surprised by the amount of work zig committers manage to put out every release. It is actually inspiring. How do they get to appear so productive?

Anyway, here's a nitpick. In this release they've removed varargs, and now this is how a printf call looks like in zig:

    std.debug.warn("{}+{} is {}\n", .{1, 1, 1 + 1});
The ergonomics of typing .{} for every print seems pretty awful if you're a heavy user of debug printing. I was hoping that maybe some sort of a syntax sugar is planned so that tuples could be used without .{} -- emulating varargs, but the bug tracker doesn't turn up anything in that direction.

In the previous release (0.5.0) one didn't need the .{}, but instead integer literals needed explicit casts, because the vararg implementation was limited:

    std.debug.warn("{}+{} is {}\n", i32(1), i32(1), i32(1 + 1));
Both of these options seem like a regression compared to the usual

    printf("%d+%d is %d\n", 1, 1, 1 + 1);
... and there doesn't seem to be a way to work around it by e.g. using a function overloaded in the number of arguments (no such thing in zig) or some preprocessor tricks (again, no such thing).

PS. I'm also surprised to find out that zig seems to take 2.6 seconds to compile the above example.

Re: Zig 0.6.0 Release Notes

#12
post #10

There are hundreds of changes listed here and still no mention of fixing the fact that zig purposely errors out on tabs and carriage returns. This might sound too ridiculous to believe, but if you use tabs or save a file out of windows text editor with normal settings, zig just won't compile. It would be trivial to do what every other compiler in history does, but they want to screw with windows users or anyone you u…

Nim also disallows tab: https://play.nim-lang.org/#ix=2hW9

Re: Zig 0.6.0 Release Notes

#13
post #11

I am continuously surprised by the amount of work zig committers manage to put out every release. It is actually inspiring. How do they get to appear so productive? Anyway, here's a nitpick. In this release they've removed varargs, and now this is how a printf call looks like in zig: std.debug.warn("{}+{} is {}\n", .{1, 1, 1 + 1}); The ergonomics of typing .{} for every print seems pretty awful if you're a heavy user…

To be honest typing and remembering %d %f %c %s etc. seems like more hassle than typing {} and typing it for every case.

I think the real gotchas are that { is escaped as {{ and } as }} instead of \{ and \} (though it does follow from the old %%) and you must either include , .{} or rewrite the function call to something significantly different to do unformatted print.

Re: Zig 0.6.0 Release Notes

#14
post #10

There are hundreds of changes listed here and still no mention of fixing the fact that zig purposely errors out on tabs and carriage returns. This might sound too ridiculous to believe, but if you use tabs or save a file out of windows text editor with normal settings, zig just won't compile. It would be trivial to do what every other compiler in history does, but they want to screw with windows users or anyone you u…

This is the reason I can't stand zig: its so aggressively opinionated about something that doesn't matter at all.

Re: Zig 0.6.0 Release Notes

#15
post #10

There are hundreds of changes listed here and still no mention of fixing the fact that zig purposely errors out on tabs and carriage returns. This might sound too ridiculous to believe, but if you use tabs or save a file out of windows text editor with normal settings, zig just won't compile. It would be trivial to do what every other compiler in history does, but they want to screw with windows users or anyone you u…

Run "zig fmt" before "zig build-exe" and it's not a problem. Even Notepad supports unix line endings these days.

Re: Zig 0.6.0 Release Notes

#16
post #4

One very cool feature of Zig is that it supports calling async/await from any function [1], not just async functions, which avoids the famous function coloring problem altogether. [1] https://ziglang.org/#Concurrency-via-Async-Functions

I think function colouring is a positive thing. A synchronous function cannot yield; so calling an asynchronous function from it doesn't make sense since those cannot yield either.

Re: Zig 0.6.0 Release Notes

#17
post #10

There are hundreds of changes listed here and still no mention of fixing the fact that zig purposely errors out on tabs and carriage returns. This might sound too ridiculous to believe, but if you use tabs or save a file out of windows text editor with normal settings, zig just won't compile. It would be trivial to do what every other compiler in history does, but they want to screw with windows users or anyone you u…

Run "zig fmt" before "zig build-exe" and it's not a problem. Even Notepad supports unix line endings these days.

Or zig could do what every other compiler does and work by default. Why would I invest time in a user hostile language?

Re: Zig 0.6.0 Release Notes

#18
post #12
post #10

There are hundreds of changes listed here and still no mention of fixing the fact that zig purposely errors out on tabs and carriage returns. This might sound too ridiculous to believe, but if you use tabs or save a file out of windows text editor with normal settings, zig just won't compile. It would be trivial to do what every other compiler in history does, but they want to screw with windows users or anyone you u…

Nim also disallows tab: https://play.nim-lang.org/#ix=2hW9

As does F#.

Re: Zig 0.6.0 Release Notes

#19
post #10

There are hundreds of changes listed here and still no mention of fixing the fact that zig purposely errors out on tabs and carriage returns. This might sound too ridiculous to believe, but if you use tabs or save a file out of windows text editor with normal settings, zig just won't compile. It would be trivial to do what every other compiler in history does, but they want to screw with windows users or anyone you u…

What the fuck

It's kind of funny to me though that there's an actual language out there where you can do use-after-free and all sorts of other C-level stuff but can't use tabs.

Re: Zig 0.6.0 Release Notes

#20
post #10

There are hundreds of changes listed here and still no mention of fixing the fact that zig purposely errors out on tabs and carriage returns. This might sound too ridiculous to believe, but if you use tabs or save a file out of windows text editor with normal settings, zig just won't compile. It would be trivial to do what every other compiler in history does, but they want to screw with windows users or anyone you u…

[deleted]
Post reply on HN