Live data from Hacker News

Integrating “safe” languages into OpenBSD?

marc.info

271–280 of 344 posts

Re: Integrating “safe” languages into OpenBSD?

#271

Earlier quoted context omitted.

> The system being secure is a secondary benefit to it being comprehendible and coherent to an individual. This is a really interesting and compelling philosophy to me, but it’s the first time I’ve heard OpenBSD described this way! Why is this not mentioned on the project’s homepage?

https://www.openbsd.org/goals.html

Nothing in that list says anything about being "comprehendible and coherent to an individual". I'd agree those are useful and good things, but security is indeed mentioned and emphasized there, and not as being secondary to aesthetic concerns.

Re: Integrating “safe” languages into OpenBSD?

#272

I have spent a long time using alternative languages. I'm a compiler geek. However, most of these languages ultimately lead to disappointment. Not because they necessarily fail, but rather because the problem of writing software is not a problem of language or platform. It is a problem of thought and abstraction. So, the big promises that these new languages and platforms make will ultimately only be fulfilled for a…

You're missing high-level languages such as Modula-2 or Free Pascal that are safe-by-default while being close to the machine. They compile faster. They're easier to analyze. Someone who understands C could easily port it to one of these languages or even write a translator that converts them to C for easy integration of incrementally-rewritten pieces of the OS. They don't because they like C for non-technical reason…

Cyclone is an interesting example. Something that is backward-compatible with C and does not incur significant compile-time overhead, like C++ does, is a potential alternative. Unfortunately, Cyclone was abandoned. It only has support for 32-bit architectures, and it is not being actively maintained. One of the biggest reasons why C is so popular is that it works on practically every platform, even those that Cyclone, Modula-2, and Free Pascal do not.

Of course, if OpenBSD eliminates support for a bunch of the platforms it currently supports, such alternative languages become viable. However, the OpenBSD team purposefully maintains these platforms because they expose errors that would otherwise be missed by a scaled-down release. Software errors missed in x86_64 or x86 may be picked up in MIPS or SPARC because of endianness.

An alternative that I think is more tenable is a language that compiles to C. Such a language can piggy-back off of C's incredible market penetration while adding safety features. Barring some extensions to Cyclone, most of Cyclone's features, for instance, could be implemented as a source-source compiler that targets ANSI C99 or ANSI C11.

Re: Integrating “safe” languages into OpenBSD?

#273
post #251
post #158

Earlier quoted context omitted.

> i386 is supported, the issue is compiling the compiler on i386. which is required for the system to be self hosting seriously - what is being said is this: " oh hey lets throw away the functional and perfectly good entire base set of utilities for this 1/2 complete project on github using a language that doesn't even natively build on all of our supported platforms and wouldn't even remove the need for a C complile…

> every few days (hours?) some noobish person desides to ask some fantasy question about whatever topic of interest they are noobing about on openbsd (and other OS) discussion lists, and then gets whiny when they are being called out for being 'green' about life itself. this is another of those cases, and I have no idea why it got crossposted here or upvoted. this sort of attitude is astoundingly hostile and toxic fo…

I agree, but understand how tiresome it can get when people who -- understandably -- don't know any better do a drive-by of your project and suggest things, things which have often already been discussed to death, or don't even need to be discussed because anyone knowledgeable about the project would immediately see there's no need for discussion.

Now, that doesn't mean that a hostile rebuff is required or good policy, but random people who actually do not know what they are talking about, and haven't taken the time to learn enough to know what they're talking about, don't really deserve a long, in-depth, drawn out rebuttal or discussion.

Re: Integrating “safe” languages into OpenBSD?

#274

Seems most os developers don’t care about the users and only about their maintenance and adoption cost. I WANT my computer and files protected by software written in a safe way using safe languages. I don’t care about the compile time of grep, I stopped caring about that kind of dick measurement competitions a long time ago. Give me a safe, open operating system and I’m willing to trade Posix compatibility and compil…

Curious, but this kind of shitty attitude won't work with OpenBSD nor with any other open source that I know. It is not about what you care, but about what they care. Like if they own you something.

That being said, I wonder in what safe language the OS you used to write this is written.

Re: Integrating “safe” languages into OpenBSD?

#275

Earlier quoted context omitted.

You're missing high-level languages such as Modula-2 or Free Pascal that are safe-by-default while being close to the machine. They compile faster. They're easier to analyze. Someone who understands C could easily port it to one of these languages or even write a translator that converts them to C for easy integration of incrementally-rewritten pieces of the OS. They don't because they like C for non-technical reason…

Cyclone is an interesting example. Something that is backward-compatible with C and does not incur significant compile-time overhead, like C++ does, is a potential alternative. Unfortunately, Cyclone was abandoned. It only has support for 32-bit architectures, and it is not being actively maintained. One of the biggest reasons why C is so popular is that it works on practically every platform, even those that Cyclone…

That's actually what I said here in my more thorough comment below plus some of other replies:

https://lobste.rs/s/4cf21p/re_integrating_safe_languages_int...

Ill be replying to followups on that later tonight or in the morning. I totally agree it should be default. I'll go further to say it should have C datatypes/sizes, calling convention, FFI with little to no annotations required, and compile to C. Each check should be removable per midule with a compiler option, pragma per module, or equivalent keyword/operator marked unsafe . It also needs inline ASM. For its own advantages, add macros, safe linking, and a REPL with incremental compilation.

That by itself would be better and faster to develop than with C with seemless integration with legacy codebases. Side benefit like in my Brute-Force Assurance method would be it benefiting from all tooling C ecosystem has to offer esp static analysis and certifying compiler.

What you think on that?

Re: Integrating “safe” languages into OpenBSD?

#276
post #126

I remember I stopped frequenting /r/programming when it became this weird Haskell echo chamber. It was a bubble where a small but vocal faction inside the community seemed to over react to any criticism. They methodically and tirelessly responded to every comment with an endless litany of "facts" showing how Haskell could do anything from os kernels to game programming. They touted every industry mention of Haskell u…

> I sometimes get the feeling people spend more time writing defences of these languages than they spend time writing programs in them. Programmers love language wars.

In WWII it was famously true that fighter pilots would fiercely argue for the absolute superiority of whatever plane they had been flying for a few months. For example, Thunderbolt pilots hated being moving to Mustangs (etc) - even though to our eyes the Mustang is obviously a superior plane.

Once your instincts adapt to something intimately (and programming languages require that); that's what feels right. You'll argue vociferously against a change and use what are objective reasons. (The Thunderbolt could dive faster, it was a brick.)

Of course, in the United States Army Air Force, you still had to switch.

The old hands usually remain convinced of the superiority of what they know, and irritated by Young Turks telling them something else, nicely or not. Because the Young Turks can't be right. But they are, often.

Re: Integrating “safe” languages into OpenBSD?

#277

I remember I stopped frequenting /r/programming when it became this weird Haskell echo chamber. It was a bubble where a small but vocal faction inside the community seemed to over react to any criticism. They methodically and tirelessly responded to every comment with an endless litany of "facts" showing how Haskell could do anything from os kernels to game programming. They touted every industry mention of Haskell u…

Hey, better the Rust Evangelism Strikeforce than the C Org, whose members are bound to that billion-year contract maintaining legacy embedded code riddled with buffer overflows and undefined-behavior traps, not to mention broken or brittle build tools. (The billion-year contract is there because that's a lower bound on the expected lifetime of that code base.)

Re: Integrating “safe” languages into OpenBSD?

#278

Earlier quoted context omitted.

In the OpenBSD world i386 == x86. And it's pretty easy to find an x86 processor now a days.

… such as? You're merely restating the claim, without providing any proof. Consumer machines, AFAICT, are all amd64 (or x86_64, if you prefer that name). I understood the original post to mean i386 == x86, and I agree — where do you even find an x86 today (for sale, in a non-niche use case, i.e., "pretty easy")?

OpenBSD has as a goal to run on much more than just standard currently-sold consumer hardware. You can certainly disagree with that goal, but that doesn't make it go away.

Re: Integrating “safe” languages into OpenBSD?

#279
post #270

Earlier quoted context omitted.

There is a difference between constructive criticism and/or correction (which I am all for), and belittling, demeaning, insulting, and cursing at people. IME a lot of thin skinned people on the internet always view the former as the latter. It's equally as tiresome.

IME a lot of people use "people need to be less thin skinned" as a weak rationalization for dickish behavior that would get them fired from their job and/or ostracized from their real-life social circle. But since it's online and no one knows who you really are, it's somehow "acceptable". No, it isn't, and communities that encourage or allow that type of behavior are incredibly toxic.

I'd say wounded, passive aggressive responses like this are far more damaging to a community than bluntness or the occasional swear word. They're much more insidious and subtle. No one will ever really ban you for talking like that, but it changes the whole tone of a place much more than the occasional heated discussion.

Re: Integrating “safe” languages into OpenBSD?

#280
post #237

Earlier quoted context omitted.

> large advantage How is this a large advantage? When was the last time someone actually did this?

In my experience, a new toy c compiler pops up roughly once a year. https://github.com/Wilfred/babyc http://www.sigbus.info/how-i-wrote-a-self-hosting-c-compiler... http://zserge.com/blog/cucu-part1.html https://c9x.me/qcc/ https://github.com/alexfru/SmallerC

Sure, and most people do this as an exercise, whether it's to learn how to write a compiler, or to see how small they can make the compiler, or something like that. No one does it because they really have a strong practical need to.
Post reply on HN