Live data from Hacker News

"No way to prevent this" say users of only language where this regularly happens

xeiaso.net

201–210 of 342 posts

Re: "No way to prevent this" say users of only language where this regularly happens

#201

Earlier quoted context omitted.

> It is actually insane how people is still unconvinced about sum types. Oh don't even get me started on this but I agree sooooo much. > No, more people should be using memory managed languages like Java and Golang. Well, I use both Golang and Rust depending on the need. We can have both, it's not an either-or.

I'm feeling my lack of academic training here, but I needed to make sure. When you say sum types, are you referring to enums, or is it a broader concept than that? The Wikipedia article was quite archaic but seemed to support my initial understanding that you're talking about enums. Are you talking about enums?

In Rust they are called "enum", elsewhere "tagged union", "discriminated union" or "variant" (under the hood, all of those are just a C-style union bundled with a tag field which identifies the active content of the union). The rest is language specific syntax sugar which makes their usage more or less convenient and typesafe (and sometimes more memory efficient, for instance a pointer|null type doesn't need the tag since the set of valid pointers doesn't overlap with null)

Re: "No way to prevent this" say users of only language where this regularly happens

#202
post #169

Earlier quoted context omitted.

It's possible to write systematically safe code in C, no need to change language. People really just don't want to do it.

In theory, in 50 years of practice, not really.

If you mean those two godlike C programmers, that's not what I mean.

Re: "No way to prevent this" say users of only language where this regularly happens

#203

Earlier quoted context omitted.

It's possible to write systematically safe code in C, no need to change language. People really just don't want to do it.

Maybe it is but the last several years of periodic (and quite embarrassing) CVEs suggest otherwise.

What they suggest? What I and the discussed article claim is that safe code isn't written because programmers don't want it. CVEs aren't caused by desires, they are caused by unsafe code.

Re: "No way to prevent this" say users of only language where this regularly happens

#204
post #107

Earlier quoted context omitted.

> The issue I have with this narcisstic fatigue (similar to the author's point I assume) is that there is no reflection when they fuck up a codebase. Forgive my bluntness, but do you even know any C programmers? The ones I know are not at all a homogenous group (there isn't even anything resembling a "C community" - and IMHO that's a good thing btw). > The best code is the code that is safe and easy to read. These tw…

> C code is unsafe, but typically easy to read Are you joking?

Absolutely not, modern C code (eg C99 or later) looks a lot different than C89. One problem is that the C stdlib is stuck in the C89 era, but at the same time most of the stdlib isn't all that important for writing C code).

Re: "No way to prevent this" say users of only language where this regularly happens

#205
post #182

Earlier quoted context omitted.

[flagged]

Well, I'm glad that you volunteered to go live in Soviet Russia or Fascist Germany, or a disarmed Native American tribe. Disarming population leads to tyranny without consequences.

TIL almost every european country is in a state of tyrnanny. Also Yemen which is one of the only countries with somewhat similar gun ownership compared to usa (bit less than half as many guns per capita) must be the epitome of freedom and safety.

Re: "No way to prevent this" say users of only language where this regularly happens

#206
post #182

Earlier quoted context omitted.

[flagged]

Well, I'm glad that you volunteered to go live in Soviet Russia or Fascist Germany, or a disarmed Native American tribe. Disarming population leads to tyranny without consequences.

Most of the free democratic western world does not have a lax gun culture like the US has and yet there's no tyranny. Weird.

Re: "No way to prevent this" say users of only language where this regularly happens

#207
post #30
post #25

Earlier quoted context omitted.

I have a longer nuanced post to write out at some point about my feelings here, but here's the cliff's notes: We should not be developing new projects in C, and we should make it politically hard to make new projects written in C in distribution repositories. C is going to stay around for a long time and that's okay, but there are so many inherent problems of its design and implementation that make it unsuited for un…

> We should not be developing new projects in C I would give at least embedded development a pass, since you rarely do have a choice there

I agree. I regularly use Rust on embedded devices and what many advocates like to leave out is that you're just using regular old C under the hood anyway. It's bindings all the way down.

Re: "No way to prevent this" say users of only language where this regularly happens

#208
post #206

Earlier quoted context omitted.

Well, I'm glad that you volunteered to go live in Soviet Russia or Fascist Germany, or a disarmed Native American tribe. Disarming population leads to tyranny without consequences.

Most of the free democratic western world does not have a lax gun culture like the US has and yet there's no tyranny. Weird.

This isn't as clear cut of a case as you make it out to be. Britain's recently been on a path of overregulation bordering tyranny and limiting free speech. Canada is on a similar path. German green and red party politicians recently caught flack for trying to criminalize unpleasant critique. Press freedom and press independence are actively getting worse and Europe is setting course on a path of nationalism and conservative hardliners and there's an active war being fought on its borders. Islamic nationalism is on the rise and the issue concerning unregulated migration has a real chance to cause uprisings in the continent.

I do not like powerful guns in the hands of the population and I love the idea of a peaceful civilization without the need for violence, but you're living in a relatively short peaceful historic phase, which is just now starting to take a turn for worse again.

Re: "No way to prevent this" say users of only language where this regularly happens

#209
post #192

Earlier quoted context omitted.

It’s a cult, but you don’t have to join the cult. I use Rust both privately and more and more frequently professionally and I don’t really notice the cult community outside of smiling at it once in a while when it blows up on HN. We’re mostly adopting rust to replace our C, to protect us from ourselves. It’s just so much easier to hand off these sort of projects to developers who mainly work with things like Java or…

Mostly agreed with your comment though I still have to remark that every community has zealots and it's mystifying to me why are people so annoyed by Rust's. So it's hard to agree that "Rust is a cult". As you said, it's a pragmatic but also kinda niche language. I don't reach for it unless I can't do the job with others, easier and quicker to work with languages.

The C sphere is actually refreshingly free of zealotry (mainly I guess because there isn't such a thing as a "C community" and even despite C being the main attack target of language zealots - funny enough nobody complains about those pesky assembly coders and their hippie attitude towards memory safety lol).

The "religious zeal" was also an important reason why I switched back to C from C++ and why I don't have much interest in Rust. I can't quite stand the "holier than thou" attitude in.parts of those communities.

Re: "No way to prevent this" say users of only language where this regularly happens

#210

Earlier quoted context omitted.

I program MCUs as a hobby. I wish I could use something better than C. Even C++ with RAII would be better. But somehow, even C++ support is spotty, with unsupported features, broken debugging, etc. for seemingly no reason. And all device-specific libraries are written in C, so I'd have to write C++ wrappers for every little thing. Send help...

Rust only works for a few popular targets, but if it is just a hobby then Zig might be an option. C interop is pretty seamless, so you don't face the problem of having to reinvent the universe.

In my experience interop is rarely a language problem, lion share of time is consumed by reading the docs, testing if you understood the docs correctly, testing what's implied but not written in the docs and figuring out how to cope with idiosyncratic interface.
Post reply on HN