Earlier quoted context omitted.
Yes, Rust is a good systems programming language. Just not safe. Safer than most others, yes. Good enough, yes. But there exist safe systems programming languages. Safe systems were done in these languages. Just nobody cared, so they died or have no market share.
Which ones?
Garbage collection without unsafe code
81–85 of 85 posts
Re: Garbage collection without unsafe code
#82Earlier quoted context omitted.
Which ones?
Do I have to do osdev language research for you now? I'm certainly missing some, but out of my head: Mesa/Cedar, Concurrent Pascal, Smalltalk, Lisp, ADA, C#/M# for Midori/Singularity, Oberon, ...
Mesa/Cedar: LOOPHOLE inside an UNSAFE module
Smalltalk 80: You can access the built-in VM instructions directly using the syntax. E.g. basicAt:put: at avoids bounds checks and type checks.
Common Lisp: (safety 0)
Ada: Unchecked_Conversion, Unchecked_Deallocation
C#/M#: unsafe class MyClass where T : unmanaged
Oberon: the SYSTEM module
Rust isn't any different, and unsafe exists in Rust for the same reason it exists in all these other languages. You use it to create new constructs the language authors didn't foresee. Concurrent Pascal is the singular exception: You can't do anything the language doesn't provide out of the box. Need something Brinch Hansen didn't think of? Sucks to be you.
If you want the rusty version of Concurrent Pascal though, you can have that. Put #![forbid(unsafe_code)] in your crate's lib.rs, or your Cargo.toml. Done.
Re: Garbage collection without unsafe code
#83Earlier quoted context omitted.
Do I have to do osdev language research for you now? I'm certainly missing some, but out of my head: Mesa/Cedar, Concurrent Pascal, Smalltalk, Lisp, ADA, C#/M# for Midori/Singularity, Oberon, ...
All of those have unsafe-like escape hatches, with the notable and singular exception of Concurrent Pascal. In each of the others you can access their own version of `unsafe` as an escape hatch Mesa/Cedar: LOOPHOLE inside an UNSAFE module Smalltalk 80: You can access the built-in VM instructions directly using the syntax. E.g. basicAt:put: at avoids bounds checks and type checks. Common Lisp: (safety 0) Ada: Unchecke…
Re: Garbage collection without unsafe code
#84Earlier quoted context omitted.
Do I have to do osdev language research for you now? I'm certainly missing some, but out of my head: Mesa/Cedar, Concurrent Pascal, Smalltalk, Lisp, ADA, C#/M# for Midori/Singularity, Oberon, ...
All of those have unsafe-like escape hatches, with the notable and singular exception of Concurrent Pascal. In each of the others you can access their own version of `unsafe` as an escape hatch Mesa/Cedar: LOOPHOLE inside an UNSAFE module Smalltalk 80: You can access the built-in VM instructions directly using the syntax. E.g. basicAt:put: at avoids bounds checks and type checks. Common Lisp: (safety 0) Ada: Unchecke…
There's a lot you can do in Ada without resorting to them, and even with using them it can be perfectly fine, such as (eg) "view conversion" of a register or memory-mapped location -- remember that a lot of APIs (and ABIs) have been kneecapped by catering to C's inabilities, so even if the idea is directly expressible in some higher level language it will be exposed at the lower level.
Re: Garbage collection without unsafe code
#85Earlier quoted context omitted.
All of those have unsafe-like escape hatches, with the notable and singular exception of Concurrent Pascal. In each of the others you can access their own version of `unsafe` as an escape hatch Mesa/Cedar: LOOPHOLE inside an UNSAFE module Smalltalk 80: You can access the built-in VM instructions directly using the syntax. E.g. basicAt:put: at avoids bounds checks and type checks. Common Lisp: (safety 0) Ada: Unchecke…
While Ada does have `Unchecked_Deallocation` and `Unchecked_Conversion`, Ada out-of-the-box provides safety roughly on-par with the high-integrity C++ style-guide. For provable safety, the SPARK subset/provers are used. There's a lot you can do in Ada without resorting to them, and even with using them it can be perfectly fine, such as (eg) "view conversion" of a register or memory-mapped location -- remember that a…
I'm not trying to fight some religious war here. You want to use Ada? Great! But don't pretend that the existence of the unsafe keyword somehow makes Rust unacceptably impure. The same escape hatches exist in every other "safe" language outside of the one toy example whose entire niche purpose was to avoid unsafe, and which no one uses now because the language is ossified and non-extensible.