5 ms·
I've been programming in Python for over 6 years now and every week I learn something new. But recently I've been thinking about moving to a more capable langua
by behnamoh 3y ago
I've been programming in Python for over 6 years now and every week I learn something new. But recently I've been thinking about moving to a more capable language with proper concurrency for backend API requests (FastAPI sucked).
I also want types, so Elixir is not in the picture. I dabbled in Rust a bit. Although I was able to get the hang of things and build a CLI tool pretty quickly, I'm worried I'll have to deal with numerous quirks later if I keep using Rust (like numerous string types). Is that something to be worried about if all I want from Rust is Python+Types+Concurrency?
- jondwillis 3y agoSwift or Kotlin might be what you’re looking for but nobody uses Swift for backend really, and I’m not sure about Kotlin.
- kuschku 3y agoKotlin has basically replaced java for many spring shops. It's really common in backend nowadays.
- imbusy111 3y agoSounds like you want Julia. It looks like Python, but also has, what you ask for. You can even run Python from Julia, so that alleviates the problem with a lack of libraries somewhat.
- deleted 3y ago[deleted]
- sparks1970 3y agoGolang? Pretty easy to pick up coming from Python and proper concurrency.
- scubbo 3y agoPython supports types! https://www.mypy-lang.org/ https://www.mypy-lang.org/
- cmeacham98 3y agoThis seems a bit like saying "JavaScript supports types!" because of typescript.
- ralphist 3y agoIt's not a separate language, you can just start typing your programs right now.
- nextlevelwizard 3y agoexcept nothing enforces your types at run time, you can have typi hints all you want and everyone else cn ignore them
- aunderscored 3y agoSame exists with laws. And in most languages if I want to avoid the type system and hand you a goldfish instead of an int, I can. It just may take more effort. Other language will blow up too if you hand them strange things. Just like python those languages have ways to verify you're not passing goldfish, You just may need more or less effort to use them
- nextlevelwizard 3y agoThats a lot of words for: yeah, you are right
- aunderscored 3y agoA lot of words for "yes, but all languages have this problem." The amount of effort to break the type system is the only difference.
- nextlevelwizard 3y ago
- rightbyte 3y ago> Python+Types+Concurrency Sounds like Groovy. But I wouldn't recommend it. Also the career padding hype is gone.
- willcipriano 3y agoWhat sucked about FastAPI?
- behnamoh 3y agoNot fast enough! I used it to call llama.cpp server but it would crash if requests were "too fast". Calling the llama.cpp server directly solved the issue.
- dekhn 3y agoHonestly, that doesn't sound right. I'm curious what you mean by crash thoguh.
- ralphist 3y agoDid you get "connection reset by peer" when you sent a bit too many requests perchance? I've never found the source of that in my programs. There's no server logging about it, connections are just rejected. None of the docs talk about this.
- dumdedum 3y agoThis sounds like a layer 8 problem
- KaiserPro 3y agoInteresting, I've used fastAPI to serve many thousands of requests a second (per process) for a production system. How were you buffering the requests?
- deleted 3y ago[deleted]
- docc 3y agoi moved from python timo Rust and i really like it. moving to a staticly typed language is bit of a mind fuck but cargo is amazing and so is the speed and portability of rust.
- spprashant 3y agoAs someone in a similar boat, just pick Golang. People often dislike the basic syntax, explicit error checking and the lack of algebraic data types. I did. Rust just seems like it offers so much more and you fear missing out on something really cool. But once you get over it, you realize Golang has a good type system, concurrency model, package manager that's not pip, fast compile times, and static binaries. For most cases it will also offer great performance. It has everything you need to build APIs, CLI tools, web servers, microservices - pieces which will form the building blocks of your software infrastructure. I have heard numerous stories of people being productive in Go in a few days, sometimes even hours. If Python is 0 quality of life and Rust is a 100, Golang gets you all they way up to 80-90. That last bit is something you might never need. Rust is a great language and something I hope to be in proficient someday, but I ll save it for where I actually need that last microsecond of performance.
- seabrookmx 3y agoGoLang as others suggested is a good pick. If you're in the "I don't like coloured functions" camp it's likely your best bet for web workloads. If you're not a fan of GoLang's spartan syntax and are cool with async/await, C#/dotnet core is a great experience on all platforms. IMO it has the best async/await implementation (it originated there) on top of a multi-threaded event loop. ASP.NET is a great web framework and it has great library support for everything else. As someone who avoids "traditional" ORMs (Hybernate, Django) I really like Dapper.
- neonsunset 3y agoStrong recommendation to look into ASP.NET Core with C#. It gives static typing, easy first-class concurrency, it runs on all platforms and now can be AOT compiled if that's your thing, if not - can still produce just a single executable if you choose to. Also its CLI is nice and similar to cargo. Naturally, you won't be having performance issues.
- archargelod 3y agoYou might wanna try Nim [0]. Nim is a statically-typed compiled language with very pythonic syntax. It's easy to learn, especially if you already know Python, because Nim's stdlib is heavily inspired by it. For multithreading in Nim see: Weave - https://github.com/mratsim/weave https://github.com/mratsim/weave Malebolgia - https://github.com/Araq/malebolgia https://github.com/Araq/malebolgia [0] - https://nim-lang.org https://nim-lang.org
- agacera 3y agoDevX in Rust for backend development is quite good nowadays. Things are WAY easier than it was a couple of years ago. I migrated a couple of projects from Java, TS and Go to Rust and honesly, I couldn't be happier.