Live data from Hacker News

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

news.ycombinator.com

21–30 of 38 posts

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

#22

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…

> Python-esque experience if you make many one-off programs as you can simply write Main as python script

For simple scripts, you don't even need to bother with a `Main` method anymore; you can just write statements outside of any structure like in PHP or JS: https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals...

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

#23
post #14

If you're looking for a high-level scripting language for small projects that you keep to yourself, Ruby is the obvious alternative to Python. Lua not so much - it's fine when embedded but doesn't have the ecosystem for standalone use. However, if you want to make programs for others to download and use, I'd recommend a language that can be compiled into easily-distributable binaries. As long as the overhead of a gar…

An important note: If you plan on sticking to an editor that has LSP integration like Vim/VSCode and so, stay away from Ruby as Ruby's language server solargraph is just not good. Personally, this is my main reason for staying away from languages like Ruby, Kotlin etc.

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

#24
post #4

Recently taught myself Python and now I just love it. Sorry you had a bad encounter with it.

I taught myself Python as my first language and now I’m starting feel that there are core coding concepts that Python abstracts away from the user that are probably important to know for good code hygiene.

That being said, for personal projects that don’t really see the light of day, Python is a perfect multi-tool type language

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

#25

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 =…

Swift is not Mac OS only, it’s actually cross platform. Maybe you’re referring to Mac OS/ios swift sdk that is platform specific

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

#26

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 ?

For desktop apps you could try Godot with C#.

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

#27
post #23
post #14

If you're looking for a high-level scripting language for small projects that you keep to yourself, Ruby is the obvious alternative to Python. Lua not so much - it's fine when embedded but doesn't have the ecosystem for standalone use. However, if you want to make programs for others to download and use, I'd recommend a language that can be compiled into easily-distributable binaries. As long as the overhead of a gar…

An important note: If you plan on sticking to an editor that has LSP integration like Vim/VSCode and so, stay away from Ruby as Ruby's language server solargraph is just not good. Personally, this is my main reason for staying away from languages like Ruby, Kotlin etc.

I will keep it in mind, though a quick search returned a project that resemble LSP integration for Ruby : https://github.com/Shopify/ruby-lsp.

Also RubyMine (IDE from Jetbrains) seems to have its own LSP integrated.

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

#28

I authored this site to help with this exact question: https://cdaringe.github.io/programming-language-selector/ Try it out, give me (friendly) feedback!

I tried it just now, my main issue is that I am looking for a general purpose language and you can only select a single use case with your tool :/

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

#29
You didn't say that isn't PHP, so can we explore that further? I write a lot of my own little php shell scripts to do things. I use laravel zero for a framework of related tools. I wrote a cli RAG app for LLMs using it. You might look into TUIs people are coming out with like from Charm.sh, written in Go.

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

#30

Earlier quoted context omitted.

How is Nim for cli scripting? I tend to use Bash for simple scripts, and Python once I need more than one command line argument. I've been looking for a compelling case to try out Nim.

It's Python-like, but it compiles, so you get a stand alone exec like go, that you can copy on other machines without having to provide an interpretter. It's better than bash for anything longer than 5 lines, works on Windows and Unix and has a lean syntax. Now I would use Python for scripting, especially since uv and hatch have inline deps support now, so it's a blast. But OP is looking for something new, so I list…

When making small Nim programs for the CLI, https://github.com/c-blake/cligen makes for a pretty simple API (just 1 line of code) that gets you nice CLI syntax, color auto-generated help messages, etc.
Post reply on HN