5 ms·
> 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 rat
by BubRoss 7y ago
> 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?
- zamadatix 7y agoAgain 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.
- BubRoss 7y agoThere 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.
- zamadatix 7y agoThere 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.
- BubRoss 7y agoYou 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 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.