Oh FFS!
Oh FFS!
Posted Nov 25, 2024 8:54 UTC (Mon) by Wol (subscriber, #4433)In reply to: Oh FFS! by Cyberax
Parent article: NonStop discussion around adding Rust to Git
WTF?
You're assuming a new OS springs out fully formed, like that greek goddess who sprang full grown out of her father's head when someone chopped it open (can't remember which legend, sorry).
If you're writing an OS from scratch, you start small! Personally, I'd probably use Forth as the most appropriate starting language, but ...
When you're a mouse, you don't worry about the elephants. Wait until you've grown a bit!
Don't get into circular arguments. Who cares if LLVM and gcc need a C++ compiler because C++ needs LLVM or gcc. Just don't use C++! What do you *NEED* it for? YOU DON'T.
Cheers,
Wol
Posted Nov 25, 2024 12:14 UTC (Mon)
by pizza (subscriber, #46)
[Link] (3 responses)
In the short term, you're cross-compiling anyway.
But it's a lot simpler to just port the parts of GCC/LLVM necessary for cross-compilation of C (including a very minimal libc) than it is to _also_ port the inftastructure neeed for C++ (and Rust) including their respective standard/runtime libraries.
Once you have the basics going, then you can go back and port a full-featured libc, then move on to the infrastructure needed for C++, Rust, and so forth as needed.
Posted Nov 25, 2024 18:04 UTC (Mon)
by Cyberax (✭ supporter ✭, #52523)
[Link] (2 responses)
Oh, absolutely. Interestingly, adding Rust is _easier_ than C++. You don't need to worry about a lot of gnarly stuff like multiple inheritance, member pointers, and so on.
Posted Nov 30, 2024 14:35 UTC (Sat)
by mathstuf (subscriber, #69389)
[Link] (1 responses)
Posted Nov 30, 2024 21:01 UTC (Sat)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Virtual table layouts, virtual tables during object construction, and so on. For member pointers: the way you represent pointers to virtual functions (via offsets in a vtable). Also various small things, like allocating storage for the array length so that delete[] can properly run destructors.
Nothing too complicated, but still a fair bit of work. And I assume that you don't want to just re-use the existing ABI for some reason, because it equally applies to Rust as well as C++.
Posted Nov 25, 2024 17:48 UTC (Mon)
by wittenberg (subscriber, #4473)
[Link] (1 responses)
Posted Nov 25, 2024 22:57 UTC (Mon)
by mirabilos (subscriber, #84359)
[Link] (8 responses)
Yes, precisely, starting small… but at the same time, once the initial bootstrapping is done, stay self-hosting, because only by dogfooding you can even run into all the bugs, so all the development will be moved to the new OS as soon as possible.
Posted Nov 25, 2024 23:24 UTC (Mon)
by Wol (subscriber, #4433)
[Link] (5 responses)
And?
To quote Ecclesiastes, "there is nothing new under the sun" ...
That was true of Basic, C, PL/1, etc etc etc.
(The OS I cut my teeth on was originally written in FORTRAN, and slowly got transmogrified into PL/1, PLP, SPL, C, ...)
And hasn't Rust been specified for ages? Just because it's not ISO, or IEEE, or "insert your quango here" of the day ... you just say "this code needs edition 2018", and there's your spec.
Cheers,
Posted Nov 25, 2024 23:51 UTC (Mon)
by pizza (subscriber, #46)
[Link]
The specification is "how [the latest version of] the official (and only) implementation does it"
Posted Nov 26, 2024 0:18 UTC (Tue)
by mirabilos (subscriber, #84359)
[Link] (2 responses)
And it wouldn’t be that bad if you could say edition 2018, and there’s an edition or two a decade.
Not multiple editions a day.
Posted Dec 13, 2024 19:51 UTC (Fri)
by sammythesnake (guest, #17693)
[Link] (1 responses)
There are necessarily caveats to do with bugs and unavoidable backward incompatibility to handle security issues or whatever, but the only way to guarantee avoiding those is never release any new code at all...
[1] https://doc.rust-lang.org/edition-guide/editions/
[2] 2015, 2018, 2021 and 2024 so far, that's one every ~1100 days on average, so the orders of magnitude less often than you suggested.
Posted Dec 14, 2024 7:57 UTC (Sat)
by sammythesnake (guest, #17693)
[Link]
Posted Nov 26, 2024 11:12 UTC (Tue)
by khim (subscriber, #9252)
[Link]
Nope. Rust reference says that in very red rectangle: Warning: This book is incomplete. Documenting everything takes a while. See the GitHub issues for what is not documented in this book. Ferrocene have specification. That one is good enough to present to various bureaucrats, but it's very imprecise. Rust doesn't work like that. I can use “Rust edition 2015” and yet still use facilities that weren't available in year 2023, easily. Rust edition is for breaking changes, not for supporting frozen-in-time toolchains. Rust community stance for the demand to provide support for ancient compilers in the various crates was always: “you invent artificial limitations, you support artificial limitations… could fork old versions of old crates or do whatever you want, that's not our problem”.
Posted Nov 30, 2024 15:38 UTC (Sat)
by mathstuf (subscriber, #69389)
[Link] (1 responses)
Posted Nov 30, 2024 20:19 UTC (Sat)
by viro (subscriber, #7872)
[Link]
1) no C back in '68 (or Unix either, for that matter; they hadn't started that until '69, and back in early days B had been "we might want to use it someday" thing - C had started as an implementation language for one of the rewrites of B compiler several years later, with "looks like it can be used for a lot of things we wanted to use B for" coming shortly after that).
2) the _total_ size of v7 source ('79, with most of the early C changes already behind) is 3.4Mb (and not quite all of that C either - ~0.2Mb is assembler, and there's some data as well). Yes, by v7 time there'd already been quite a bit of C sources around (2BSD, for example), but nowhere near the size of Rust codebase these days. Impact of language changes does depend upon the amount of programs that need to be updated, so that comparison is more than slightly disingenuous.
3) while we are at it, "somebody go tell K & R" is somewhat in a poor taste - dmr died 13 years ago ;-/
Yes, grandparent posting by mirabilos reeks with advocacy, but that's not a reason to stoop down to the same.
Advocate: n. Pack animal, tends to produce a lot of noise, especially when two groups greet each other with projectile vomit and long loud screams. Can imitate speech better than parrots, but can't be used as pets due to guano problems.
Oh FFS!
Oh FFS!
Oh FFS!
Oh FFS!
Oh FFS!
Oh FFS!
Oh FFS!
Wol
Oh FFS!
Oh FFS!
Oh FFS!
Oh FFS!
> And hasn't Rust been specified for ages?
Oh FFS!
Oh FFS!
Oh FFS!