I'd like some recommendations for this from the community. As productive as Python but faster execution is the kind of sweet spot I want to explore and learn. Any specific examples or recommendations for such programming languages?
I'd like some recommendations for this from the community. As productive as Python but faster execution is the kind of sweet spot I want to explore and learn. Any specific examples or recommendations for such programming languages?
zig and nim for tries to feel like a scripting language while still being fast.
Personally I like clojure for such things.
The type system uses a lattice, which can be a bit unfamiliar, but once you get it under your belt, it's the jam. I highly recommend getting to know it.
Small example of Nim code (from relevant article [2]):
var gc = 0
var total = 0
for line in lines("orthocoronavirinae.fasta"):
if line[0] == '>': # ignore comment lines
continue
for letter in line:
if letter == 'C' or letter == 'G':
gc += 1
total += 1
echo(gc / total)
[0] - https://nim-lang.org
[1] - https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
[2] - https://benjamindlee.com/posts/2021/why-i-use-nim-instead-of-python-for-data-processing/Once you've got a repl up and running the JVM launch time isn't an issue and repl driven development lends itself well to data munging/exploration
Clojure's data centricity (functional, everything's a sequence, strong data manipulation std lib) really makes it a dream for these quick and dirty data transformation/exploration jobs
If you want to get fancy, https://github.com/nextjournal/clerk (notebook interface) and https://github.com/techascent/tech.ml.dataset (data frame library) will get you there
Python isn't a particularly good force multiplier purely as a language these days. It was very wise to not go full OOP, so we are spared from the truly horrible, but python is basically C with lists and new syntax as most people use it.
It is significantly faster than Python but has a similar vibe.
That being said, performance isn't really an aspect of the language but of the compiler and runtime. PyPy for example, has a Jit compiler.