3 ms·
I love Python too! The style of Scala used in this book is much closer to Python than Mathematica or Scheme, with many of the libraries involved being carbon co
by lihaoyi 7y ago
I love Python too! The style of Scala used in this book is much closer to Python than Mathematica or Scheme, with many of the libraries involved being carbon copies (os-lib, requests-scala, ujson) so you will feel right at home.
As to what you get going to Scala, it depends what matters to you.
Does 50x faster compute matter to you, for the code that’s CPU bottlenecked but inconvenient to rewrite in C?
How about easy parallelism, to trivially and fully utilize multiple cores without clunky subprocess management?
How about easy packaging? One builtin command to package your program as a single file that can run anywhere with a JVM, no other global installs required?
You do give up some things using Scala: compile times are slower than iterating on Python scripts, the JVM runtime takes a second or two to warm up when launched, and you don’t have quite the same numpy/scipy machine-learning ecosystem. Whether that is worth it is up to you!