5 ms·
> there are some that are as productive as Python, yet execute much faster I'd like some recommendations for this from the community. As productive as Python b
by blenderob 2y ago
> there are some that are as productive as Python, yet execute much faster
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?
- krona 2y agoLua? 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.
- jsheard 2y agoIt depends on what you're doing, but for web stuff Go is the popular middle-ground choice that's not quite as fast as Rust but is much faster than Python or Ruby. Go is garbage collected, unlike Rust, so you get the productivity benefits of not having to think too hard about memory management.
- mhh__ 2y agoUltimately it depends on the task but I'm more way more productive writing D than python (assuming it's not just gluing libraries together in which case python obviously wins) because of the metaprogramming and that the basics are done well enough that I can actually trust the results without constantly staring at stdout second guesssing the semantics. 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.
- empath75 2y agoFor data engineering -- R and Julia.
- JodieBenitez 2y agoIf you can stand some archaism, Go is this language for the web stuff. It has nice things too, like efficient concurrency and easy deployment.
- jinwoo68 2y agoOCaml? It has an advanced type system but you almost never have to annotate types in your code. So it feels like writing in a dynamic language, like Python.
- rpcope1 2y agoScala, once you get a feel for it.
- bobnamob 2y agoClojure (either native JVM or Babashka) 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 https://github.com/nextjournal/clerk (notebook interface) and https://github.com/techascent/tech.ml.dataset https://github.com/techascent/tech.ml.dataset (data frame library) will get you there
- greener_grass 2y agoIf you like functools, itertools and list comprehensions, you will probably like F#. It is significantly faster than Python but has a similar vibe.
- samatman 2y agoJulia 100%. Multiple dispatch and a proper macro system are a superpower. It also doesn't abstract over data in the same way: if you want a byte, you can have a UInt8. But it does abstract over data: a function can take a Number, and that is a very expressive supertype in Julia. 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.
- nicoburns 2y agoJavaScript is the obvious pick with those criteria.
- stonemetal12 2y agoJulia's whole thing is python but not slow. Crystal is the same but for Ruby. zig and nim for tries to feel like a scripting language while still being fast. Personally I like clojure for such things.
- archargelod 2y agoNim [0] IMO has syntax that's better than Python, while having a performance of C. See "Nim for Python Programmers" [1] for detailed comparison. 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/