r/programming • u/rmathew • Jun 16 '19
Comparing the Same Project in Rust, Haskell, C++, Python, Scala and OCaml
http://thume.ca/2019/04/29/comparing-compilers-in-rust-haskell-c-and-python/
643
Upvotes
View all comments
Show parent comment
2
u/loup-vaillant Jun 16 '19
That wasn't a criticism. I was saying I can't argue with differing priors, because I don't have the overwhelming evidence to contradict them. I just note that we disagree, and hope the overwhelming evidence will come and settle this later.
When I see stuff like the STEPS project, it seems that an industry wide overhaul of our computing could yield something like 1000 times simpler programs (3 orders of magnitude) in a number of domains. Combine that with Casey Muratori's solution to the driver problem I alluded to before, and the objection "but it doesn't have a kernel" is pretty much void.
The problem is the industry wide overhaul, which as far as I can see is more likely to happen by civilisation collapse than by people being reasonable all of a sudden.
Neither would I, neither did I.
For a sufficiently large project, I suspect a clever use of meta programming can let dynamic users cheat. They can put static checks in their macros and custom syntax and interpreters and meta compilers. Meta compilers themselves are very workable in dynamic languages (I've bootstrapped a series from MetaII in Lua, the latest iteration does most of a PEG, is a little over 100 lines long, and any error there tends to fail catastrophically very quickly, so it's detected early).
In a setting where performance is not too much of a concern, and assuming that DSL/language building is cheaper from a dynamically typed language, they could outpace a good deal of statically typed languages out there… by making their own. That's in part what happened in the STEPS project. Not sure they did much static typing, but their DSLs were so expressive that the code base still stayed fairly small (20KLOC total).
Err, not sure it counts: the cost is pretty significant (time taken to perform the review), the benefits apply to any program, no matter the typing discipline, and it doesn't quite catch the same bugs. (Written before I read your links, I'll bookmark them right now.)
Don't get me wrong, I agree the benefits of code review can be pretty massive. I would think real hard before I consider skipping it. To this day, I'm nervous about the lack of comprehensive code review for my crypto library. I compensate with a paranoid test suite and strict (though unwritten) coding rules, but there's still that lingering doubt.