4 ms·
This might be wrong but can't you use cython and then compile python to speed it up? Obviously won't be as fast as Go but seems like it can have speed ups
by pid_0 6y ago
This might be wrong but can't you use cython and then compile python to speed it up? Obviously won't be as fast as Go but seems like it can have speed ups
- cb321 6y agoIf you think of Cython as a "new but related" language rather than just a Py compiler then you can sprinkle enough C-like `cdef` code into your Cython so that, when compiled, your code can run much faster than Go..as fast as any C, really. (EDIT: Pypy is usually a better way to make unadorned Python run faster.) That said Nim [1] provides nicer metaprogramming features than Cython and very nice overall ergonomics..I think more ergonomic than Python with, e.g. UFCS. Nim has almost all the safety/speed of Rust with better ergonomics than Python. What is not to love? [1] https://nim-lang.org/ https://nim-lang.org/
- pid_0 6y agoI’ll definitely check out nim. The best thing about python is the ecosystem and vast knowledge available. It makes it hard to move to something “better”
- cb321 6y agoThe Nim Forum and IRC channel are pretty helpful/rapid feedback. Maybe not as much as a canned StackOverflow answer for Python or an existing library to do exactly what you need, but the Nim ecosystem/userbase is growing all the time.