4 ms·
Or you could use Scala
by kagakuninja 2y ago
Or you could use Scala
- PaulHoule 2y agoI did a couple of projects where I'd pick up a broken Scala system and fix it, it was usually "screw around for a week in Scala and it (1) still has race conditions and doesn't give the same answer every time, (2) has totally busted error handling (they seemed to think saying the word 'monad' meant you didn't have to think about error handling) and (3) used at most 2 CPUs out of 8." Rewriting it in Java with ExecutorService would solve all those problems in like... 20 minutes. But yeah, I think a lot of people would think Ferocity combines all the awful things about Java (verbosity) and Common Lisp (the "write once never edit" problem of metaprogramming)
- kagakuninja 2y agoThat's funny, because I've been taking servers full of large blocking thread pools, rewriting them to be non-blocking, idiomatic Scala, Cats Effect 3 and get +50% throughout. Blocked threads are seriously bad for performance. Yes, Java 21 project Loom will help with that (finally), if people get with the program. There aren't any race conditions, because our classes and data model are fully immutable. The problem with our legacy servers was that the original devs didn't know what monads were, and decided not to use them. Error handling is now great, by using... you guessed it, monads.