Live data from Hacker News

Zig 0.6.0 Release Notes

ziglang.org

21–30 of 33 posts

Re: Zig 0.6.0 Release Notes

#21
post #17

Earlier quoted context omitted.

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?

Ever used or read about Fortran, Haskell, or Python? The idea that whitespace does not matter and will just be handled as-is is and has been a language design choice before and after Zig regardless how many times you pose the question. That Zig or any other language did not make the choice to treat whitespace the way you'd prefer in the compiler and instead left that it to the formatter does not make them "user hostile". The Zig docs link to the reasons they made the choice not to support varying whitespace (and other character and syntax choices), if you don't like those reasons feel free not to use it but it's a bit rude to make it out like they did it to "screw Windows users" when it's neither technically true nor the actual motive.

This is all coming from a guy who has only messed with Zig on a Windows box with a preference for tabs over spaces (except post indent alignment). Zig fmt works great, haven't had an issue, less difficult to get going than mingw or vs that's for sure.

Re: Zig 0.6.0 Release Notes

#22
post #17

Earlier quoted context omitted.

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

Ever used or read about Fortran, Haskell, or Python? The idea that whitespace does not matter and will just be handled as-is is and has been a language design choice before and after Zig regardless how many times you pose the question. That Zig or any other language did not make the choice to treat whitespace the way you'd prefer in the compiler and instead left that it to the formatter does not make them "user hosti…

First, I said screw with windows users. Second, none of those languages error on carriage returns. Third, whitespace being significant is not the same as erroring out when your users don't use your preferred white space. I don't use tabs for anything, but it is all trivial to handle and they bomb out anyway. It's a slap in the face to users and it's "rude" to waste people's time by making them deal with nonsense. It is not "rude" to point out that a piece of software does this.

Also none of what you put here is an an actual justification for stuff like this. This is like being in the twilight zone, why would anyone defend this?

Re: Zig 0.6.0 Release Notes

#23
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…

Fwiw, the "{}" formatting is common in python, so that might be a reason they went that route.

Re: Zig 0.6.0 Release Notes

#24
post #22

Earlier quoted context omitted.

Ever used or read about Fortran, Haskell, or Python? The idea that whitespace does not matter and will just be handled as-is is and has been a language design choice before and after Zig regardless how many times you pose the question. That Zig or any other language did not make the choice to treat whitespace the way you'd prefer in the compiler and instead left that it to the formatter does not make them "user hosti…

First, I said screw with windows users. Second, none of those languages error on carriage returns. Third, whitespace being significant is not the same as erroring out when your users don't use your preferred white space. I don't use tabs for anything, but it is all trivial to handle and they bomb out anyway. It's a slap in the face to users and it's "rude" to waste people's time by making them deal with nonsense. It…

"With" or not with you don't find it a bit ridiculous to say that a group designed a C compatible language that can cross compile to/from Windows easier than any existing C compatible language to this point yet they specifically chose the whitespace as they did because they want to screw with Windows users - no better reason?

Again Unix newline style is the least of the worries for whitespace, Windows and built-ins like Notepad handle it just fine for years now if that's what you code in. Try inserting tabs in place of spaces as you please in Python or Haskell though and yes you are likely to run into problems trying to run a program. It's not called "significant whitespace" in those languages because it's ignored.

It's fine to point out you think something is harder to use than it needs to be but the way you've done it says more about you than the language. You won't a whole language because it requires you run the built in formatter to compile? Might as well not use GCC either it forces you to use -- for options instead of / and other tools handle it just fine they just want to screw with Windows users that's it! What's left to talk about except these kind of nitpicks if that's where you draw the line for ignoring whole projects with years of effort put in them at?

None of what I put here was claimed as justification I said the Zig docs link to the reasons. Specifically (in case you'd rather I'd bring them up for you) the reasons were around ease of parsing as a large portion of the syntax was. The whole language specification is actualy very specific about making sure each line can be simply tokenized individually and parsed one way regardless of convetion - not actually so picked just to screw with people that like tabs or Windows. Zig fmt is allowed to "eat" any complexity in normalizing code (referencing ICU data, normalizing whitespace and other syntax, and so on) so zig build-exe doesn't have to. This philosophy of keeping as much functionality out of the core compiler and language is a big part of what allows Zig to target many places e.g. Rust doesn't even though Zig is still very fresh.

If running "zig-fmt" as part of your custom build process or using one of the editor plugins ziglang maintains that does this for you is "a slap in the face to users" I'm not sure there is any language those users would be happy with as there are other things they are going to like less than it replacing their whitespace on them. It's certainly not harder to do than post scathing reviews about how you couldn't just use tab on the release discussions though.

Re: Zig 0.6.0 Release Notes

#25
post #22

Earlier quoted context omitted.

First, I said screw with windows users. Second, none of those languages error on carriage returns. Third, whitespace being significant is not the same as erroring out when your users don't use your preferred white space. I don't use tabs for anything, but it is all trivial to handle and they bomb out anyway. It's a slap in the face to users and it's "rude" to waste people's time by making them deal with nonsense. It…

"With" or not with you don't find it a bit ridiculous to say that a group designed a C compatible language that can cross compile to/from Windows easier than any existing C compatible language to this point yet they specifically chose the whitespace as they did because they want to screw with Windows users - no better reason? Again Unix newline style is the least of the worries for whitespace, Windows and built-ins l…

> The whole language specification is actualy very specific about making sure each line can be simply tokenized individually and parsed one way

This is the rationalization given, but it doesn't make any sense. Carriage returns could just be ignored. It is completely trivial, especially compared to all the other changes. Can you explain how this explanation actually connects to reality?

Re: Zig 0.6.0 Release Notes

#26
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.

A synchronous function cannot yield, but it can make sure another thread is available to take its place before it issues a blocking syscall. If properly constructed, synchronous stdlib functions would be safe to call from async functions. Any "executor" implementation that uses a fixed-size thread pool and is vulnerable to all threads in that pool being tied up this way at once is BROKEN.

Re: Zig 0.6.0 Release Notes

#27
post #25

Earlier quoted context omitted.

"With" or not with you don't find it a bit ridiculous to say that a group designed a C compatible language that can cross compile to/from Windows easier than any existing C compatible language to this point yet they specifically chose the whitespace as they did because they want to screw with Windows users - no better reason? Again Unix newline style is the least of the worries for whitespace, Windows and built-ins l…

> The whole language specification is actualy very specific about making sure each line can be simply tokenized individually and parsed one way This is the rationalization given, but it doesn't make any sense. Carriage returns could just be ignored. It is completely trivial, especially compared to all the other changes. Can you explain how this explanation actually connects to reality?

Again the thought was Zig could take a stance on supporting multiple of the 5-ish line endings and let every tool that is written deal with it and dozens of other whitespace decisions or it could be normalized to 1 way to represent it with no variability in whitespace characters as part of the built in language tooling. Allowing 2 ways is not an alternative path to having 1 way. This concept is extended to all sorts of whitespace characters it's not just about newline and tab.

You write about the line ending like you get paid per \r\n you push up to Git, there is no reason to care which whitespace character the formatter outputs for you. Zig init-exe is literally going to do this for you when you make a project. Build.zig can literally run zig fmt for you as part of the build process.

Re: Zig 0.6.0 Release Notes

#28
post #25

Earlier quoted context omitted.

> The whole language specification is actualy very specific about making sure each line can be simply tokenized individually and parsed one way This is the rationalization given, but it doesn't make any sense. Carriage returns could just be ignored. It is completely trivial, especially compared to all the other changes. Can you explain how this explanation actually connects to reality?

Again the thought was Zig could take a stance on supporting multiple of the 5-ish line endings and let every tool that is written deal with it and dozens of other whitespace decisions or it could be normalized to 1 way to represent it with no variability in whitespace characters as part of the built in language tooling. Allowing 2 ways is not an alternative path to having 1 way. This concept is extended to all sorts…

There is no "taking a stance". There are two line endings being talked about here, with carriage returns and without. Why are you so desperate to change the goal posts? This change log is hundreds of lines long, you think ignoring carriage returns is a big deal?

Why would it matter for tools? Have the tools run zigfmt. Why make users build a script to compile a hello world program? Does zig only allow a single space between tokens?

Again you are trying anything you can think of to justify a ridiculous choice because you want to defend zig as a whole. Nothing ads up here.

> there is no reason to care which whitespace character the formatter outputs for you.

I never said anything about that. I have only talked about the compiler erroring out on carriage returns as an intentional design choice.

Re: Zig 0.6.0 Release Notes

#29
post #28

Earlier quoted context omitted.

Again the thought was Zig could take a stance on supporting multiple of the 5-ish line endings and let every tool that is written deal with it and dozens of other whitespace decisions or it could be normalized to 1 way to represent it with no variability in whitespace characters as part of the built in language tooling. Allowing 2 ways is not an alternative path to having 1 way. This concept is extended to all sorts…

There is no "taking a stance". There are two line endings being talked about here, with carriage returns and without. Why are you so desperate to change the goal posts? This change log is hundreds of lines long, you think ignoring carriage returns is a big deal? Why would it matter for tools? Have the tools run zigfmt. Why make users build a script to compile a hello world program? Does zig only allow a single space…

There is stance to take you just disagree with the choice. I think at this point you understand the initial aims and reasons of why Zig chose the syntax it did so here's a question about your stance both line endings should be supported by the compiler: why is it more important than the reasons Zig gave? Sure everything can be made to support variations in line endings but why? It's not that a formatter is hard to come by, it ships with the build tools. It's not that it's hard to initialize, it ships with the build tools. It's not that editors don't support the line ending, even Notepad does. It's not that existing tools that look for multiple types of line endings don't work, they still see the \n as is. Is it literally just because if you go to write your first hello world on some machines you get a syntax error telling you what needs to be changed for it to be a valid Zig source file or are there other reasons?

It's not like there is an enormously "wow this would change everything about using the language" _either way_ (which is part of why it's so confusing it's the hill you're willing to die on about using Zig) it's literally "there was an option for simplifying syntax and parsing at the cost of making \r\n a syntax error". You may not agree with it but there were reasons and a path was taken. It's not the Twilight Zone, ridiculous, nonsense, user hostile, or to screw with Windows users it's a minor choice you don't agree with in a project with millions of choices to make.

Re: Zig 0.6.0 Release Notes

#30
post #28

Earlier quoted context omitted.

There is no "taking a stance". There are two line endings being talked about here, with carriage returns and without. Why are you so desperate to change the goal posts? This change log is hundreds of lines long, you think ignoring carriage returns is a big deal? Why would it matter for tools? Have the tools run zigfmt. Why make users build a script to compile a hello world program? Does zig only allow a single space…

There is stance to take you just disagree with the choice. I think at this point you understand the initial aims and reasons of why Zig chose the syntax it did so here's a question about your stance both line endings should be supported by the compiler: why is it more important than the reasons Zig gave? Sure everything can be made to support variations in line endings but why? It's not that a formatter is hard to co…

You can say it's just a "disagreement" but there are no benefits to doing this. No one has actually out forward reasoning that makes sense. You have just thrown out flimsy arguments and then moved on to more flimsy arguments when I point out how absurd they are.

This is a typical thing people do when they can't directly confront something. They throw out as much as they can and don't acknowledge when what they said was shot down, they just throw out more and hope something sticks.

https://en.m.wikipedia.org/wiki/Gish_gallop

You said so much and none of it made sense, but instead of backing up claims of "parsing being easier" or "can't support multiple line endings" or any other nonsense, you just make be on to more nonsense. Literally no other compiler intentionally breaks by default. There is no reasonable reason to do this and you haven't even come close to mentioning one and infact have had to go into bizarre concoctions because you don't want to admit how silly this is.

Post reply on HN