oh, apparently it's not possible to portably check for string-to-float conversion errors in standard c
47 points by seb
47 points by seb
Sometimes I get tired of working in higher-level languages like Python and I feel inspired to try my hand at something lower-level and closer to the machine. Go and Java are too corporate, Zig and Odin and Hare are too trendy, Rust is too industrial and C++ too Lovecraftian.
"I know", I say, "I'll use C - it's been around for fifty years, it's small and simple and got to be polished to a sheen by now." Then I read an article like this one.
Maybe I need to look more into Forth...
"Rust is too industrial" eh... I wouldn't characterize it like that...
It has a bit of a corporate feel
By design i think. I believe during the creation of rust it was always meant to be a production language and used at real companies rather than just a hobby so i think it developed its feel on purpose. (Nothing against it I love the language)
Honestly, assembly is fun...
That said, don't avoid trendy things only because they are trendy. I sympathize though.
Ada sits somewhere in the middle of all of those. Lower than Python, more abstract than C, not terribly trendy.
What do you plan to use it for? Go is more minimal than corporate. It has fewer built-in keywords than C.
I think "minimal" and "corporate" are different axis. Go was designed for a corporate environment after all (e.g. hot-swapping recent grads between projects).
No, Go was originally designed to replace C++ at Google:
https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html?m=1
Both can be true.
No. One is a myth and the other is true.
A quote from Rob Pike himself, creator of Go:
The key point here is our programmers are Googlers, they're not researchers. They're typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They're not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt.
whichever language you choose to program in, I will write and promote a new alternative standard library implementation for it that returns 9 for every function without side effects, and then write blogposts about the work needed to accommodate the various standard library implementations in it. Chances are, the older the language, the more likely someone already did that.
It's also amusing that float to int conversion in C is UB on overflow. It's actually exploitable in LLVM. Rust had to inject range clamping into its float casts to prevent it.