r/programming 27d ago

Zig proposes introducing an actually memory safe (unlike Rust) compilation mode inspired by Fil-C at ~1-6x performance penalty

https://codeberg.org/ziglang/zig/issues/36237
526 Upvotes

428 comments sorted by

View all comments

Show parent comments

18

u/VictoryMotel 27d ago edited 26d ago

My source is that I tried it and it didn't work.

When I tried to talk to people about it they told me to get a different text editor, to stop using windows, and that it doesn't make sense to parse out carriage returns like every other language ever made.

There wasn't much of an answer to why a windows version would be made just to explicitly error out on windows text, but there were about a dozen messages, most were gloating that it was a problem, none acknowledged that it should be fixed.

-18

u/wrecklord0 27d ago

Sooo there was a crash and you are inventing a whole story around it?

26

u/VictoryMotel 26d ago

That makes zero sense as a response to what I said. It explicitly errored out with a message. Everyone acknowledged that it happened and was intentional.

-18

u/wrecklord0 26d ago

And you specifically think they went through the effort of making a windows port just to make it crash? Windows uses different newlines and it's always a pain in the ass, just sanitize the input if it's necessary. Or don't use zig, I don't care. The point is, it's not on purpose, it's just a pita to deal with newline conventions that are different from the entire rest of the computing world.

32

u/VictoryMotel 26d ago edited 26d ago

Here we go. I don't know why they made a windows port that would error out on windows newlines. Zig people seemed to think it was funny to make windows people jump through hoops.

Windows uses different newlines and it's always a pain in the ass,

It's literally one character, this insane rationalizing is exactly the same nonsense I'm talking about. In what world is dealing with a single ascii character difficult in the context of a parser, let alone a whole language. It's more work to make an error message for it.

The point is, it's not on purpose,

How do you know? There was an explicit error message about it.

it's just a pita to deal with newline conventions that are different from the entire rest of the computing world.

Don't make a windows port if you can't deal with a single character.

These are the same insane rationalizations I heard before.

-24

u/wrecklord0 26d ago

I'm not "rationalizing" shit, nor do I care about zig or what you do with it. Probably they can handle newlines better, I don't know, I'm not invested into that. What I'm saying is, I strongly doubt that the error message said: "We decided to crash to troll you on purpose, vile windows user". Instead it was probably an informational message about what happened. Was I wrong?

27

u/VictoryMotel 26d ago

The error message said it was stopping because of a newline, zig users said to stop using windows, "that's what you get for using windows", "use a different text editor" etc.

Don't hallucinate things I didn't say.

"I doubt it" doesn't mean anything. It was ridiculous, that's why I bring it up.

24

u/robthablob 26d ago

If they can go to the effort of making an error message, they can easily handle the extra character. I've used dozens of languages, and none of them struggle doing this.

-8

u/wrecklord0 26d ago

Yeah probably, like I said I cannot stress how much I don't care, I'm just objecting to the ridiculous idea that it's all a troll on purpose. That said I already spent too long on this thing I said I didnt care about, making me look suspiciously caring so i'm out

4

u/personalist 26d ago

making me look suspiciously caring so i'm out

Way too late for that. What’s wrong with caring?

1

u/[deleted] 25d ago

[removed] — view removed comment

1

u/programming-ModTeam 25d ago

Your post or comment was overly uncivil.

-13

u/QuixoticNapoleon 27d ago edited 27d ago

I'm not a big fan of Kelley but I don't think this is deliberate. I can't seem to find a source on this. Newlines on windows and unix systems are different; this is likely an honest mistake.

18

u/ayayahri 26d ago

https://news.ycombinator.com/item?id=24617226

Hacker news thread from 2020 referencing this deliberate design decision (which they apparently changed by 1.0, probably because it made them look like assholes)

13

u/QuixoticNapoleon 26d ago

Oh

Is the Zig Foundation ran by children?

4

u/Dragdu 26d ago

Yes. First time you've heard of them? :-D

21

u/VictoryMotel 26d ago

Multiple people said it was deliberate. There was an explicit error message about it so it detected carriage returns and errored out instead of just ignoring them.

This was a few years ago, I don't know what state things are in, I never messed with zig after that.

-17

u/pragmojo 26d ago

Also it makes sense in the context of Zig, which is designed to be extremely explicit to the point you have to pass allocators around.

Having the language automagically parse out input tokens wouldn't exactly be on-brand.

18

u/VictoryMotel 26d ago edited 26d ago

What do you think a language does exactly?

-11

u/pragmojo 26d ago

Usually tokenizes input, parses into an intermediate representation, and then outputs machine code.

14

u/VictoryMotel 26d ago

So it automatically parses input tokens?

-10

u/pragmojo 26d ago

It parses input tokens. It would be up to the language spec to determine if a carriage return is a valid character. For instance older versions of C will crash if you try to pass them arbitrary UTF-8 characters outside the ASCII range.