You mean a interpretative language with similar role to Python, but more like Rust/C++ style? I actually want that so that I can ditch Python even if I learned it and use this instead.
Rust
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
Not necessarily interpreted, but possibly. I think a more likely path is something like Go that's compiled but still has a garbage collector.
If you use a garbage collector the whole borrow checker would not make any sense.
Do you want to have error handling and functional paradigms in go? I think you should start there and ask go Devs why their language is lacking such basic stuff.
Not sure if this is what OP is seeking, but I would be fine to have borrow checker removed, replaced with Garbage collector like Go/Python in such a language.
To build prototypes, I don't want to fight with borrow checker and neither I care for efficiency much. But I do want the macro system, traits, lazily asynchronous runtime, cargo like package manager, easy build system, etc.
Rust has so many powerful features, but only because of borrow checker (IMO) we can't use it for rapid prototyping like Python. With that replaced, this subset of Rust would be something which can be a great contender to Python/Go, etc.
To build prototypes, I don’t want to fight with borrow checker and neither I care for efficiency much.
Then use .clone()
or Arc
everywhere?
Why would you want to prototype incorrect code? You don't fight with the borrow checker. The borrow checker prevents stupid mistakes. Anything that is correct that the borrow checker rejects is almost certainly a very bad idea in a prototype
I spend an inordinate amount of time at my C# day job adding documentation comments about exclusive access and lifetimes and ownership… things which are clearly important but which dotnet provides little or no useful support for, even though it has a perfectly good garbage collector. The dotnet devs were well aware that garbage collection has its limits, especially when interacting with resources managed outside of the runtime, and so they added language features like IDisposable and finalisers and GCHandle and SafeHandle and so on to fix some of the things GC won’t be doing for you.
I’d happily use a garbage collected language with borrow checking.
Sounds like you're using C# for something that it wasn't designed for. You can, of course, but it is obviously painful
F#? It's compiled, statically typed, somewhat fast, garbage-collected, and supports Rust-style error handling
I didn't love that article - Rust isn't strictly a systems language. It's general purpose, and a lot of the mechanics are very useful for general programs.
I feel like you may have missed the point, then? Or at least interpreted the article very differently? Rust isn't "strictly" a systems language, but neither is C or C++; people use them for application development all the time. But all three languages have very specific limitations (most obviously, that adding a garbage collector would be an unwelcome change) imposed by the need to fulfill the "systems" niche.
Compare Golang: it can't replace C++ for every use-case, because it has a garbage collector, and because you need cgo to use FFI. But it's otherwise a very flexible language that can be used for most types of software.
What I would like to see is something that shares these advantages with Go:
- quick to build
- easier to teach & learn than Rust
- easier to quickly prototype with than Rust (though of course it's debatable how well Go does at this one)
...but I don't like the actual language design of Go, and I think it's possible to design a language that's more Rusty but still simpler than actual Rust.
For instance, error handling in Rust is both more ergonomic and more rigorous than in Go. That's huge! A language like Go but with sum types, Result
, and the question-mark operator would be leaps and bounds nicer than Go itself.
To be clear, I don't imagine that a "smaller Rust" would replace Rust. But I also don't think we've reached optimal language design when the language I'd pick to write an OS is also the language I'd pick to write a small CLI app.
The designers of Go actually discussed civilised error handling (like Rust and others), but in order to make it useful they'd have to include other features like ADTs and something like an Either
monad (Result type), which they felt would make Go too difficult to learn for the developers they envisioned Go to be used by.
One of the most important reasons for the popularity of Go is exactly that it is extremely limited, and can be picked up by any developer in a few hours. It takes no time to learn because there is nothing there that would need to be learned. This isn't a limitation, it's a feature (opinion of Go designers, not mine).
The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt.
- Rob Pike
If you want a high-level, convenient Rust, it's already there: It's Rust with liberal use of Arc
and .clone()
and Box<dyn Trait>
and so on. If you want things to be convenient instead of efficient, Rust already has everything you need.
If you think that's convenient, then I fear you may never have experienced a convenient language.
I guess we're coming at this with different opinions on what is convenient. Python is extremely easy and quick to write - but then writing more code for tests than the actual program itself because the compiler catches next to nothing and still dealing with the occasional runtime error is highly inconvenient to me. I look at the "ease of use" - or painlessness if you will - of a programming language over the whole lifecycle of the program, not just initially writing it.
Initial development is like 2% of the total effort over the whole lifecycle of a program, at most. The vast majority of time is refactoring, troubleshooting, changing, testing, building, deploying, monitoring.... and so on. With Rusts strong type system, I will probably spend 30% more time developing than with an easier language like Python/Go/Kotlin, but I will save 300% of time debugging, troubleshooting, deploying. Moreover, writing code is something I enjoy, while debugging is something I'd rather avoid. Any language that enables me to spend less time teoubleshooting runtime errors and debugging edge cases is a desirable language for me.
What would you consider a convenient language, and why?