Aha. I have a web server written in rust that literally uses about 5Mb memory on RPi. And that one actually has a proper web framework, not something barebones.
Good luck doing that in Python.
On top of that, that server doesn't actually use any sorts of downgraded language version that Java EE is.
You literally get that for free with Rust.
I still don't understand why people argue against this. Rust is a better language in so many aspects (tooling, language capabilities) it's really hard to argue against it.
I'm looking at REST API frameworks for rust these days, but nothing looks decent...
python3 -m http.server
Note also that Python is primarily reference counted, with GC used only to detect cyclic references.On top of this, you can do the same with docker run nginx -v.:/var/www (which btw is a similar number of symbols). Also python’s http module barely supports anything but the most basic content-types (so good luck with eg SVGs).
Tradeoffs everywhere, which make sense or not depending on your requirements.
But Python's ref counting isn't a significant factor in its memory use.
Are you implying nginx uses more memory than a python interpreter? :)
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 23612 1.2 1.7 62412 17492 pts/1 S+ 12:38 0:00 | \_ python3 -m http.serverNo GC forces the programmer to think about memory, this is a good thing because you need to to that in all garbabe collected languages anyway - or you will get bloat.
For most use cases I consider garbage collection to be a mistake. Scripting languages or small one-off applications exempted.
- single binary deploy(unlike Python)
- fast (llvm)
- memory efficient (no GC)
- newer (by virtue of the newness of the language itself).
Nothing wrong with setting expectations in title ;-)