Rust is really appealing as a C++ replacement, but it has too many rules to replace Python for one-off scripts. Still need to try Nim and Swift, I guess...
Rust is really appealing as a C++ replacement, but it has too many rules to replace Python for one-off scripts. Still need to try Nim and Swift, I guess...
It's worth noting that Julia is very similar to go, despite superficial differences. They're both small languages with big libraries, use the same concurrency model, use a mark-and-sweep GC with an emphasis on making it easy for the programmer to reduce garbage/allocations, and both use structs + functions rather than classes.
Though honestly if you don't want a REPL or notebook-centric workflow, I would probably recommend a different language.
I've worked on C# code where db.open was a test to check for a database connection, but assigning to it would open or close the database. It should simply not be possible to hide that behind an assignment symbol. It's like having db.Query(...) delete the data.
I think the best we can do at the moment is runtime expression evaluation with something like this:
https://github.com/expr-lang/expr
or this: https://github.com/Knetic/govaluate
It's not hard to remember that `__add__` is using extra resources when I'm working with big matrices in NumPy.
[0] - https://github.com/google/starlark-go or alternatively https://github.com/facebook/starlark-rust
In Go, you can generally look at any snippet of code and know precisely what it does.
Go does have operator overloading, for example + is overloaded for float.., int.. and even non numeric types like string.
And it does so for a very good reason: having operator overloading makes code much more readable when used correctly. It's just that the language designers didn't trust their users.
As long as you know the types of x and y you always know precisely what x + y does, same as you know what x.Add(y) does. There's no difference.
And verbosity helps, forcing users verbosity helps the general level of quality. Programmers could overestimate themselves and think they are doing it correctly. Looking back in my code from a year ago I see things I should have done differently. I like languages that avoid me making real dumb mistakes