Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
retoor25341dThis is how to create a websocket server form A to Z using Python:
https://molodetz.nl/retoor/gists/...
I tested it to be sure. But it was literally 3 minutes or smth. I didn't have to do the apt stuff ofc. I already had python.
Edit: whoops, forgot the pip. Applied that. -
retoor25341d@tosensei still, it's a lot compared to Python. I do know you can implement the socket directly in Program.cs tho like in my socket example. I played with it while ago. I'm happy that C# came to Linux. It's decent.
-
lorentz1540722hI tend to use Typescript when I don't want to make decisions about error handling and thread safety and just want something to work in the happy case with possible hidden assumptions in as few lines as possible. It has good enough types for accurate intellisense for non-library types and libraries for literally anything I'd ever want to do.
-
Demolishun3562422hI will have to look at our code to see how we do it in C#. I am fairly certain we don't use ASP.
-
@galena no, asp was the stuff back in the 2000s. before dotnet. the stuff where you wrote shitty pages with vbscript.
-
galena71785h@retoor Initially i focused on compiled languages, but this might acutally be a viable sölution 🤔
-
angerydev754h@tosensei we don't speak of asp classic! Let me forget about it please.
But app.UseWhatever() looks like ASP.NET Core -
retoor25343h@galena I also focus on those but for internet communication it's kinda bullshit. Python is not slow at all and even besides that old reputation, it made huge steps regarding performance. Python won't be the bottleneck of your application probably. If you would render big templates and many (few thousand) you can see it has some issues with it. But just for handling streams it does well. Biggest difference between a C server and Python server is memory usage and CPU usage. Python uses more CPU, but that's only local with heavy load tests. I even wrote a load balancer in python for HTTPS / SSH: https://molodetz.nl/retoor/...
With this weird app, you can host ssh and HTTPs both on port 443 so your ssh won't be discovered. Hide in plain sight ;) -
@retoor "Python is not slow at all" - is that why it needs a c-written library to handle anything numerically in any acceptable time?
the performance difference between "doing math in python" and "doing math with numpy" was a factor well above 1000, last time i checked.
Fucking hell! Why is it so hard to just create a simple websocket!
C#: Yeah, you should use ASP.Net with SignalR! But heres a totally undocumented mess of a lib to get it to work. J.k. Deadlock!
Rust: async while let OK((some)) = ws.create.unwrap_or_else().suckadick()
Why the fuck is Rust so fucking dense! I want one line that means one thing! If I would compress my code with gzip it would be less information dense than this!
Zig: Yeah, Its in Beta and shits semi stable. Atleast i got it to work? Nope!
I've ben fussing aound with these three Languages for more than a week now and can say: Just use an established way to webdev. Its not worth it to try and make it as simple as possible!
rant