4 ms·
if it can't be build with Ansi C or perhaps old style C++ it is not self contained i think. depending a Language on some fast moving binarys is in my eye a bad
by Surac 8mo ago
if it can't be build with Ansi C or perhaps old style C++ it is not self contained i think. depending a Language on some fast moving binarys is in my eye a bad decission. Excuse my english. im not a native speaker.
- bandrami 8mo agoThere are self-hosted Forths
- anthk 8mo agoSubleq and Eforth can self-compile, yes. Being base.dec a subleq EForth image and eforth.fth the source code, to create a new one: ./subleq base.dec < tuned_eforth.fth > new.dec And Uxn partially. You can run the compiler as a UXN rom (Drimflim.rom). So by just having a recent working VM you can compile the rest with uxn2 or 'uxncli dribflim.rom app.tal app.rom'. Tal files are source files.
- rcxdude 8mo agoWhy are C and C++ special in this regard? I could just as well claim it's not self-contained unless you can start from source and a snippet of inspectable machine code, like Guix can (which still has fairly significant gaps in what you could call 'completely self contained', if you wanted to poke holes in it).
- ronsor 8mo agoC is special because it's possible to relatively easily implement a good-enough C compiler for bootstrapping if needed. It would be under 15,000 lines of code in most languages. C++ certainly isn't that special. It's a pain to implement, but so is Rust.
- pjmlp 8mo agoAnd how did you got the binary for that language? This argument can be pushed all the way down to build your own CPUs from sand, get to build the first hexdump monitor with electric switches, followed by writting the first Assembler in hexdump, and only then the first compiler for one of thoses languages in Assembly, and finally you get C.
- ronsor 8mo agoYes, that's how bootstrapping works. C is still easier to bootstrap than Rust, because it's simpler to implement and requires fewer steps. Of course, you trade off other features for that simplicity. Bootstrapping Rust would involve the same steps, only at some point you've got to write a Rust compiler in assembly, or write a C compiler in assembly that can compile mrustc, which probably means writing another C compiler in C so you can easily add all the needed features.
- pjmlp 8mo agoWell, if we are going hardcore nothing prevents to write a Ferrocene compliant Rust compiler in Assembly. Or even better, lets follow the hype, use bootstrap strategies from the 1960's, and use WebAssembly instead, like many bytecode based compilers on those days, having written a macro Assembler instead, thus mapping the bytecodes into macros for the specific home made CPU.
- LeFantome 8mo agogccrs, the Rust compiler for GCC, is written in C++. If you can compile GCC, it will build the Rust compiler for you. Presumably the NetBSD project can bootstrap to GCC.
- Narishma 8mo agoI think they use LLVM rather than GCC, which makes it even easier.