Re:LibBF – a small library to handle arbitrary precision flo...
by kazinator on Wednesday March 07, 2018 @10:05AM
(#16536843)
The cool languages themselves tend to have this kind of feature written in C "under the hood".
GHC Haskell Runtime:
Re:LibBF – a small library to handle arbitrary precision flo...
by skocznymroczny on Wednesday March 07, 2018 @09:36AM
(#16536616)
You 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).
Re:LibBF – a small library to handle arbitrary precision flo...
by isaachier on Wednesday March 07, 2018 @08:31AM
(#16536192)
In 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.
Re:LibBF – a small library to handle arbitrary precision flo...
by whyever on Wednesday March 07, 2018 @09:01AM
(#16536349)
> 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.
Re:LibBF – a small library to handle arbitrary precision flo...
by carlmr on Wednesday March 07, 2018 @10:56AM
(#16537230)
+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.
Re:LibBF – a small library to handle arbitrary precision flo...
by nomonomus on Wednesday March 07, 2018 @09:45AM
(#16536688)
then port it to gcc?
Re:LibBF – a small library to handle arbitrary precision flo...
by steveklabnik on Wednesday March 07, 2018 @11:25AM
(#16537429)
We’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.
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?