5 ms·
Perhaps a side digression to this conversation, but... in spite of all the cool languages we talk about that have many on-paper advantages of either safety, con
by peatmoss 9y ago
Perhaps a side digression to this conversation, but... in spite of all the cool languages we talk about that have many on-paper advantages of either safety, convenience, or support of paradigms, is there really any option besides C for this kind of thing?
It still seems that, if you want to write Core Infrastructual Code that can be run anywhere, on anything, that links with any other software without any caveats, disclaimers, or compromise, C is still king.
Could this have practically been written in rust? haskell? ...and still have the same degree of embeddability and reach?
- isaachier 9y agoIn my limited experience, no. All of the languages you mention put developer experience above portability, so usually require a basic runtime. C on the other hand is not interested in saving you from the machine, which allows for extremely minimal programs. Even C++ isn't great here compared to C. Then again, debugging segfaults isn't for everyone, so most are fine giving up C.
- whyever 9y ago> All of the languages you mention put developer experience above portability, so usually require a basic runtime. Rust's runtime is comparable to C's. It is less portable because it uses LLVM as a backend, not because of the runtime. > Then again, debugging segfaults isn't for everyone, so most are fine giving up C. Depending on the application, having vulnerabilities due to undefined behavior is a much bigger problem than having to debug segfaults.
- nomonomus 9y agothen port it to gcc?
- steveklabnik 9y agoWe’d love to see a gcc front end for Rust. Someone attempted one in the pre-1.0 days, which was... not simple. Someone has to step up and do it though.
- carlmr 9y ago+1 for mentioning Rust. Which in contrast to C++ has all the goodies without the runtime dependencies. I wouldn't say LLVM is such a great restriction, except when talking about embedded (too few architectures supported here). The major desktop and server architectures are supported (AFAIK), even WASM.
- skocznymroczny 9y agoYou could use D in -betterC mode. It allows compiling code that doesn't rely on runtime (has some limitations though, most notably lack of garbage collector, forcing you to use manual allocation).
- kazinator 9y agoThe cool languages themselves tend to have this kind of feature written in C "under the hood". GHC Haskell Runtime: https://github.com/ghc/ghc/tree/master/rts https://github.com/ghc/ghc/tree/master/rts
- blt 9y agoFortran, assembler