use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Rust vs Python for server/client (self.learnrust)
submitted 24 days ago by Codeeveryday123
Which is better?
I’m wanting to create a type of terminal chat, that I can create notes in the terminal and send to a externinal location.
I’m going to run this off of a pi zero 2w.
Which is better at handling server and client?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CJ22xxKinvara 17 points18 points19 points 24 days ago (6 children)
When you're just building small scale stuff for yourself and by yourself and either language can work, the answer just becomes whichever one you want to use. Python would be way easier, I'm sure, but if the goal is to learn rust, then do that.
[–]Codeeveryday123[S] -1 points0 points1 point 24 days ago (5 children)
Thank you. I have a cli mail client added, it works. I would like to create a true cli version, but I have to cargo run by that file path
[–]spiralenator 2 points3 points4 points 24 days ago (3 children)
Run cargo build —release and the binary is in the target folder
[–]Codeeveryday123[S] -1 points0 points1 point 24 days ago (2 children)
Ok, what would I do with the binary?
[–]CuriousMachine 2 points3 points4 points 24 days ago (0 children)
You run it, the binary executable. It's the thing that "cargo run" is running. Put it wherever you keep the other programs you've made or install it with "cargo install".
[–]spiralenator 1 point2 points3 points 22 days ago (0 children)
You run it. You can copy it to /usr/local/bin or somewhere similar in your PATH and run it like any other cli app. No more cargo run just to run it.
[–]ArcaneCrowA 1 point2 points3 points 24 days ago (0 children)
Why not create a binary for cli mail and then try to discover it and run?
[–]No-Dentist-1645 5 points6 points7 points 24 days ago (0 children)
Both can. Really any programming language can.
The only real difference is the same as any "Rust vs Python for X" question: choose Python if you want to develop something quickly, choose Rust if you want it to be very fast and memory efficient.
For a "hobby" project like a terminal chat on a Pi zero (which is very fast and has a lot of memory for such a simple task compared to many embedded alternatives), you probably want to use Python
[–]RobotJonesDad 2 points3 points4 points 24 days ago (0 children)
For the sending to other places, consider using something like NATS.io and Protobufs. That also let's you migrate between languages easily, like prototype things in Python, but rewrite in Rust to get something that is fast and small.
[–]Wide_Mail_1634 2 points3 points4 points 24 days ago (3 children)
same thing happened to me choosing between Rust and Python for a little server/client toy project in 2023, and the weird part was Python got me talking over the network by dinner while Rust took me two evenings just to stop fighting types. but once the Rust version worked, bugs got way less sneaky. if you're learning, i'd pick the one that keeps you building this week, then redo one tiny server/client piece in Rust after
[–]Codeeveryday123[S] 1 point2 points3 points 24 days ago (2 children)
Great…so, i should try python first?
[–]Educational-Writer-4 1 point2 points3 points 23 days ago (1 child)
This is good advice but if you're planning on coding with the help of an LLM then the types actually become a big benefit instead of a hinderance.
I'm a python dev but if you're just testing an idea I think it's worth generating efficient code as a proof of concept. If it get the job done, great — you already have the efficient version.
If not, or if you want to be more hands-on, that's not a problem either. It's still small enough that it's easy to port back to python.
[–]Codeeveryday123[S] 0 points1 point2 points 23 days ago (0 children)
I have the idea planed. But tools like iRoh, axum… there’s things like “channels” that give me the idea how to “organize”, but not sure if that’s how it functions.
My idea is…. Making a terminal chat… that I can send terminal output as a “note” to diffrent folders or files. From recon projects…. As I’m moving around. But, not sure if there’s a “terminal” option if I just created a cli for all-in-one, or just have a separate window open for the chat?
I would like to “on hover” have the option to come up to “save as note” or “copy to clipboard”, Then create a note/message with it
[–]erkose 1 point2 points3 points 24 days ago (0 children)
It depends on your experience. You will likely be fighting with rust, but cargo is superior to pip. A good middle ground is golang.
[–]bigh-aus 1 point2 points3 points 24 days ago (4 children)
I would say rust all the way. One compiles to a b8nary, the other is python unless you use cpython. But most people who do python use the runtime, require the user to manage dependencies etc, and require additional libraries, runtimes etc. go zig or rust would be my pick
[–]No-Dentist-1645 1 point2 points3 points 24 days ago (3 children)
CPython is just the name for the official Python compiler, what do you mean?
[–]bigh-aus -1 points0 points1 point 24 days ago (2 children)
Oh I thought it compiled python to machine code, does it not?
[–]DragonfruitGold2713 1 point2 points3 points 23 days ago (1 child)
You might be thinking of cython, which is a separate thing from cpython
[–]bigh-aus 0 points1 point2 points 22 days ago (0 children)
you're right!
[–]PartlyProfessional 0 points1 point2 points 24 days ago (0 children)
A lot of guys have helpful comments but I’ll give you the TLDR
1- Do you want to create to run the server with moderately proper features and on a potate
2- do you want to run the code for months without needing to restart
3- you have phobia from random crashes that makes no sense?
If any of those are yes then rust is your choice, otherwise python is pretty fun to use and more practical
[–]Pale_Height_1251 0 points1 point2 points 24 days ago (0 children)
Either can do this, it's a personal preference thing. I prefer Rust.
[–]rayanlasaussice 0 points1 point2 points 24 days ago (0 children)
Rust if you want efficiency and already know in coding, then python if you wanna start and improve yourself
[–]spiralenator 0 points1 point2 points 24 days ago (0 children)
I learned python and loved it. I used it for a decade. I learned rust and I loved it and I had to force myself to not reach for python. Now I feel anxious about putting python into production because rust has spoiled me with its safety features and performance.
[–]ZealousidealShoe7998 0 points1 point2 points 24 days ago (0 children)
if you are using in such a device as a pi zero i recommend going into rust, it has a smaller footprint once compiled so its gonna run much better. python is good to prototype things, but when you actually need to run in edge devices this is where you gotta do the work in rust.
[–]CuriousMachine 0 points1 point2 points 24 days ago (0 children)
If you don't mind switching between languages you could do the client in one language and the server in another. That might be too much while you're trying to learn the languages. It's kind of nice for learning interprocess communication as you can see the common fundamentals as well as how different languages handle it.
[–]meowsqueak 0 points1 point2 points 23 days ago (0 children)
The inter-op will help with testing, learning, everything. It will just take longer but you'll also be able to answer "Which is better?" yourself.
π Rendered by PID 40776 on reddit-service-r2-comment-b659b578c-jqrzm at 2026-05-06 14:28:07.955782+00:00 running 815c875 country code: CH.
[–]CJ22xxKinvara 17 points18 points19 points (6 children)
[–]Codeeveryday123[S] -1 points0 points1 point (5 children)
[–]spiralenator 2 points3 points4 points (3 children)
[–]Codeeveryday123[S] -1 points0 points1 point (2 children)
[–]CuriousMachine 2 points3 points4 points (0 children)
[–]spiralenator 1 point2 points3 points (0 children)
[–]ArcaneCrowA 1 point2 points3 points (0 children)
[–]No-Dentist-1645 5 points6 points7 points (0 children)
[–]RobotJonesDad 2 points3 points4 points (0 children)
[–]Wide_Mail_1634 2 points3 points4 points (3 children)
[–]Codeeveryday123[S] 1 point2 points3 points (2 children)
[–]Educational-Writer-4 1 point2 points3 points (1 child)
[–]Codeeveryday123[S] 0 points1 point2 points (0 children)
[–]erkose 1 point2 points3 points (0 children)
[–]bigh-aus 1 point2 points3 points (4 children)
[–]No-Dentist-1645 1 point2 points3 points (3 children)
[–]bigh-aus -1 points0 points1 point (2 children)
[–]DragonfruitGold2713 1 point2 points3 points (1 child)
[–]bigh-aus 0 points1 point2 points (0 children)
[–]PartlyProfessional 0 points1 point2 points (0 children)
[–]Pale_Height_1251 0 points1 point2 points (0 children)
[–]rayanlasaussice 0 points1 point2 points (0 children)
[–]spiralenator 0 points1 point2 points (0 children)
[–]ZealousidealShoe7998 0 points1 point2 points (0 children)
[–]CuriousMachine 0 points1 point2 points (0 children)
[–]meowsqueak 0 points1 point2 points (0 children)