News for hackers. Stuff that matters.
Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by heavenlyblue on Saturday December 28, 2019 @07:43AM (#21898583)
>> GCs have come a long way

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.

Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by vips7L on Saturday December 28, 2019 @10:18AM (#21899285)
I suppose it depends on how low you need to go, I have a service written in Java EE that is using 13Mb of memory.
Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by heavenlyblue on Wednesday January 01, 2020 @04:52PM (#21930983)
I lied. My server actually uses 2.704mb memory.

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.

Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by gigatexal on Saturday December 28, 2019 @07:54AM (#21898633)
I was thinking about Go not Python when writing the above.
Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by dnpp123 on Saturday December 28, 2019 @08:23AM (#21898748)
Which crate/framework do you use ?

I'm looking at REST API frameworks for rust these days, but nothing looks decent...

Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by heavenlyblue on Saturday December 28, 2019 @09:46AM (#21899138)
I went with Rocket. Basically I wanted to control the switching of devices on my sound amplifier using USB infrared remote. So I built the UI using yew and the web server using Rocket - but I wanted to do it fast and only in Rust.
Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by kbutler on Saturday December 28, 2019 @09:37AM (#21899091)
But I bet it took a lot more code than:

  python3 -m http.server
Note also that Python is primarily reference counted, with GC used only to detect cyclic references.
Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by heavenlyblue on Saturday December 28, 2019 @09:43AM (#21899122)
I am not serving static content, so this reply is absolutely irrelevant.

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).

Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by kbutler on Sunday December 29, 2019 @01:34AM (#21904436)
At a few more orders of magnitude of memory use, sure.

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.

Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by heavenlyblue on Wednesday January 01, 2020 @04:48PM (#21930942)
>> At a few more orders of magnitude of memory use, sure.

Are you implying nginx uses more memory than a python interpreter? :)

Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by johnsoft on Saturday December 28, 2019 @12:44PM (#21900329)
Even just loading the base Python interpreter uses more memory than heavenlyblue's entire server.

  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.server
Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by chrisseaton on Saturday December 28, 2019 @11:58AM (#21899981)
Reference counting is a form of garbage collection.
Re:Ffsend – Share Files from the CLI: A Firefox Send Client ... by kbutler on Sunday December 29, 2019 @01:29AM (#21904415)
Sure, if you want to be pedantic, but the context was limited memory use, and ref counting does not increase the memory used for unreferenced objects (except in cycles) unlike most other garbage collection algorithms.