r/functionalprogramming • u/Voxelman • Feb 15 '24
Question Scripting language like Python, bur with the feeling if Rust
Rust is a great language, but sometimes I wish to have something more like Python, but with a more "Rusty" feeling.
With "Rusty" feeling I mean project management with cargo, Error Handling with Result/Option, pattern matching, strong static typing with type inference, immutability by default and so on.
This means, I'm searching for a functional programming language. My problem is, that all functional languages I found until now compile to something intermediate like Beam, JVM, .NET, JS or build binaries like Haskell.
What I'm looking for is a scripting language like Python. Just an interpreter, that runs a script, but with the "if it compiles, it runs" experience of Rust. And yes, I know that compile time type checking and script interpreter are different kind of shoes, but who knows...
Any idea?
Thanks for all the comments. A lot of good suggestions, but I decided to go with F#. I think it comes closest to Python. It runs on Linux and Windows, can run in a Jupyter like notebook and has a nice syntax. I have some (rudimentary) experience and the book "domain driven design made functional" from Scott Wlaschin, which I really like. It is well documented and you can find lots of books, tutorials and videos. Languages like Mojo lack documentation.
It is not as "Rusty" as I would like, but close enough. So if someone is searching for an alternative to Python, try F#
View all comments
Show parent comment
2
u/amplikong Feb 18 '24
I regularly see Nim mentioned in threads like these. What would you say is the best learning resource?
Nim unfortunately seems to not be nearly as popular as its strengths warrant. Maybe because it got stuck in a "not popular because it's not popular" trap. Julia seems to have the same issue; it's objectively sooooo much better than Python, but has not taken off in the way it deserves to.