Live data from Hacker News

Ask HN: Which alternative to Python for personnal use would you recommend?

news.ycombinator.com

1–10 of 38 posts

Ask HN: Which alternative to Python for personnal use would you recommend?

#1
As a professional fullstack dev that specialize in PHP backends (Symfony and Laravel mostly) and does a bit of Bash when required, I am looking for a general purpose programming language to use for fun little personal projects at home (essentially API consuming, local LLM use and I/O interactions through either websockets or similar tools)...

... that isn't Python !

I had a really bad first experience with the language and find it quite messy in terms of syntax and debugging, so ideally I would like to avoid it.

Looking at popular and/or similar languages, I found quite a few that seems like they could match what I am looking for, but I would love to have some feedback from people who used them in order to make an educated pick.

Here are the languages :

- Rust (seems rather complex and inadequate for "fun little projects on the side" but powerful) - Go (fast, reliable, with quite a few community packages to extend its capabilities) - Ruby (a personal preference probably because I am using PHP at work, syntax looks really appealing)

- Kotlin (apparently good for GUI, much more than Rust for example, surprised that it was recommended but who knows...) - Lua (another one that was recommended to me, could be useful as I am also interested in modding some games in the future)

Thanks in advance for your feedback and help :D

Re: Ask HN: Which alternative to Python for personnal use would you recommend?

#3
This list is not meant to say "this is the best language for this", but rather, "you'll have an interesting learning experience with this":

- web backend => ruby (with RoR)

- web frontend => JS

- network => go

- gui => dart

- perf sensitive => rust

- mac os only => swift

- windows only => F#

- cli scripting => nim

- embed => zig

- new perspective on programming => lisp

- want to experience clean theoretical concept => haskell

- need super reliable service => erlang

- lots of data processing => julia

- lots of number exploration => j

- video game => C# (with unity)

And I say this as someone who would likely use Python for 80% of those.

Re: Ask HN: Which alternative to Python for personnal use would you recommend?

#5
You will probably like .NET's CLI tooling after Python:

    brew install dotnet-sdk
    # or
    sudo dnf/apt install dotnet-sdk-8.0
    dotnet new web
    dotnet run
    curl localhost:5050
C# will give you, in some ways, Python-esque experience if you make many one-off programs as you can simply write Main as python script but with 10-50x performance. You can also go very low-level with C syntax with unsafe, or take a middle ground with performance-oriented APIs - it's a language closer to the metal than Kotlin or Go.

To build a native binary, just make a template with --aot arg. like dotnet new console --aot or do dotnet publish -p:PublishAot=true -o. {folder} (if template doesnt have it). .NET 8 build toolchain sometimes not the fastest (it's seconds but still) but .NET 9 improves upon that quite a bit.

Great for back-end, gamedev, crossplat GUI apps, low-level data-crunching with SIMD and high-level data crunching with Parallel and Task APIs, all kinds of background daemons.

Re: Ask HN: Which alternative to Python for personnal use would you recommend?

#6

You will probably like .NET's CLI tooling after Python: brew install dotnet-sdk # or sudo dnf/apt install dotnet-sdk-8.0 dotnet new web dotnet run curl localhost:5050 C# will give you, in some ways, Python-esque experience if you make many one-off programs as you can simply write Main as python script but with 10-50x performance. You can also go very low-level with C syntax with unsafe, or take a middle ground with p…

Thanks for the run down !

Though I was under the impression that C# was closely related to Microsoft services and thus Windows OS ?

Not that I mind as I also run Windows on my personal machines but could be an issue for specific projects if it was the case.

Re: Ask HN: Which alternative to Python for personnal use would you recommend?

#8

You will probably like .NET's CLI tooling after Python: brew install dotnet-sdk # or sudo dnf/apt install dotnet-sdk-8.0 dotnet new web dotnet run curl localhost:5050 C# will give you, in some ways, Python-esque experience if you make many one-off programs as you can simply write Main as python script but with 10-50x performance. You can also go very low-level with C syntax with unsafe, or take a middle ground with p…

Thanks for the run down ! Though I was under the impression that C# was closely related to Microsoft services and thus Windows OS ? Not that I mind as I also run Windows on my personal machines but could be an issue for specific projects if it was the case.

It hasn't been the case for about 8 years already :) And even before that with Mono!

The windows-only thing is a sad lie spread by people with irrational dislike to something that can make their life much better.

I daily drive it with macOS and it's awesome, a friend of mine uses it with Neovim and csharp-ls.

Re: Ask HN: Which alternative to Python for personnal use would you recommend?

#9

Ruby is the closest match from Python and PHP. Have you considered JavaScript too?

I am already using Javascript professionally and for Discord bot development through node.js

Ideally I would like to have another language in my dev pocket and take a break from the languages I use at work.

Also Javascript doesn't seems like a good choice for desktop apps (apart from Electron that suffers in the performance field) or CLI tools (unsure about this one as I never used it in this field) does it ?

Re: Ask HN: Which alternative to Python for personnal use would you recommend?

#10

Earlier quoted context omitted.

Thanks for the run down ! Though I was under the impression that C# was closely related to Microsoft services and thus Windows OS ? Not that I mind as I also run Windows on my personal machines but could be an issue for specific projects if it was the case.

It hasn't been the case for about 8 years already :) And even before that with Mono! The windows-only thing is a sad lie spread by people with irrational dislike to something that can make their life much better. I daily drive it with macOS and it's awesome, a friend of mine uses it with Neovim and csharp-ls.

I see !

I will look into it as I did a bit of Java and a tiny bit of C# during my education and liked both the syntax and the OOP approach !

Post reply on HN