Hacker News new | ask | show | jobs
by rbanffy 686 days ago
A lot of these notes follow a similar pattern: we start with Python, get a working program, and then rewrite it in X with a huge performance gain.

That’s fair. We use the easy language to get a correct program, then we use the “hard” language to get a fast program, now that we know what a correct one looks like.

This is the key here. If you try to start with the lower level language, you might spend a much longer time getting to the correct program.

It’s much easier to optimise a program that’s working than to debug one that isn’t.

2 comments

Or just use something that offers both from the start.

One day, Python will finally catch up with 1990's Smalltalk, SELF, Lisp, Dylan and Scheme.

What would you recommend that gives both worlds? You can learn most of the syntax of python/go to a usable level in about a day.
Go I agree, as for Python using it on and off since version 1.6, that would be a very very basic knowledge after one day.

Since you mention Go, placing dynamic and static on the same basket.

Common Lisp, Scheme, Raket, Clojure, Scala, Kotlin, F#, OCaml, Pharo, JavaScript/Typescript.

There are other candidates, only listing the ones with good out of the box REPL experience, JIT/AOT toolchains in the reference implementation, and not going crazy with their type systems for strong typing.

One of the strengths python has is its ecosystem. All the languages you listed don’t come close to python’s ecosystem except perhaps TypeScript/nodeJS (whose quality of ecosystem is questionable although improving in recent times).
>This is the key here

No, this was very much NOT my point. The java version of my program was just as easy if not easier to write, precisely because I COULD write the naive version and trust that it would work out fine performance wise.

Hell, the java version didn't even require the extra library (Pillow/PIL) that python required!