5 ms·
Run "zig fmt" before "zig build-exe" and it's not a problem. Even Notepad supports unix line endings these days.
by zamadatix 7y ago
Run "zig fmt" before "zig build-exe" and it's not a problem. Even Notepad supports unix line endings these days.
- BubRoss 7y agoOr zig could do what every other compiler does and work by default. Why would I invest time in a user hostile language?
- zamadatix 7y agoEver 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.
- BubRoss 7y agoFirst, 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?
- zamadatix 7y ago"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.
- BubRoss 7y ago