this post was submitted on 21 Dec 2023
1 points (100.0% liked)

Linux

47347 readers
1268 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

This isn't Linux, but Linux-like. Its a microkernel built from the rust programming language. Its still experimental, but I think it has great potential. It has a GUI desktop, but the compiler isn't quite fully working yet.

Has anyone used this before? What was your experience with it?

Note: If this is inappropriate since this isn't technically Linux, mods please take down.

you are viewing a single comment's thread
view the rest of the comments
[–] velox_vulnus@lemmy.ml 0 points 9 months ago* (last edited 9 months ago) (2 children)

But what is wrong with C and C++ apart from the ISO fuck-up (ahem, slow updates)? There's a lot of technical debt, so wouldn't it be better to create an alt-language compiler that adds improvement over C, so that migration is possible in multiple stages?

Something like:

  1. Fix shitty imports
  2. Improve syntax rule
  3. Improve memory management
  4. Other new misc features
[–] callyral@pawb.social 0 points 9 months ago (1 children)

(notice: I am not a Rust or C/C++ expert)

Doing all that is creating a completely separate programming language from C. Rust is that programming language.

Fix shitty imports

Rust does that with modules and crates.

Improve syntax rule

You mean having consistent/universal style guidelines? Rust pretty much has that with rustfmt.

Improve memory management

Safe Rust is memory safe (using things like the borrow checker), and Unsafe Rust is (usually?) separated using the unsafe keyword.

Although Unsafe Rust seems to be quite a mess, idk haven't tried it

Other new misc features

Rust has macros, iterators, lambdas, etc. C doesn't have those. C++ probably has those but in a really weird C++ way.

[–] velox_vulnus@lemmy.ml 0 points 9 months ago* (last edited 9 months ago) (1 children)

I should have framed my words better, I guess. Rust is a radically different language, and honestly, none of the feature it offers fixes the main issue, that is technical debt - I mean yes, there's incline C or FFI, but that's still going to be a radical migration.

What I'm trying to propose is an alternative project, independent from the ISO. Maybe it could be a C-to-Rust, or a C-to-Vale migration project. It could be any of the modern language, I don't really care. But that particular compiler/transpiler/migrationpiler/-piler should have the ability to do step-by-step migration.

[–] Killing_Spark@feddit.de 0 points 9 months ago

Those do exist for rust. https://github.com/immunant/c2rust

It produces a pretty much 1:1 mirror of the c program which means that it's still wildy unsafe and nonidiomatic rust.

But then you can go ahead and part by part convert to safe and idiomatic rust.

[–] agressivelyPassive@feddit.de 0 points 9 months ago

That would complicate things even more.

Rust has pretty sophisticated guarantees in terms of memory safety. If you'd add the step of another compiler, you'd have to guarantee that a) the transpiler still produces memory safe C and that a given C compiler actually turns that C code into memory safe assembler.

BTW: you don't have to rewrite everything immediately, you can integrate rust into existing C and vice versa. Apparently it's not trivial, but possible. See https://wiki.mozilla.org/Oxidation