I’ve always preferred the functional approach to programming, so OOP never really intrigued me. That’s one of the reasons why I never liked C++ or Java, but instantly fell in love with Rust. It lets me do a lot of functional style programming, while still being somewhat practical. (I’m looking at you, Haskell.)
I’ve been a long time believer that some problems are better solved via OOP, others through functional programming. The perfect language would be a successful blend of the two.
Many popular OOP languages are horribly lacking on FP or it looks like an eyesore (golang, python, etc). …and FP languages trying to do OOP are kinda awkwards (see common-lisp).
I thought Crystal Lang (a statically type checked dialect of Ruby) was going to be the “perfect language”… but the compile time performance and the lack of 3rd party libraries (like an aws SDK) really made it hard to use.
Hearing what you said about Rust has renewed my hope.
That said, I did notice that features like Coroutines have been “experimental” for nearly 9 years.
I hope I’m missing something obvious, but how would you create any sort of heavy-lifting, long running, multi-session daemon/application without having some sort of asynchronous mechanism that goes beyond threading (which is limited to the number of cores the host machine is running).
edit: cleaned up a few thoughts (prematurely hit submit)
I don’t think there’s an std-way of doing it, but the Rust ecosystem has this thing where people usually settle around one library. In this case, it is tokio. Afaik, most async stuff is done using tokio. What little async I’ve used, it’s been using tokio or some library like actix-web that uses tokio under the hood.
Also, side note, I never understood the idea of why golang is ugly. I think it’s fine, except for maybe the repeated if err != nil guards. Those are ugly. I wish it used additive types for error handling.
As a passionate Golang hater, I can gladly explain!
It’s not just the repeated if err != nil, even though that’s already bad enough. But the really fucked up part is the := bullshit. It makes moving code around unnecessarily annoying, and it’s telling that few other languages share Golang’s approach.
The lowercase/uppercase rules for private/public stuff is theoretically not a horrible idea, but it makes the code look much more inconsistent. I find _ much easier to read, and this leaves upper/lower to signal other details. But I see that this is mostly personal preference.
Fairly basic operations take much, much more code than they should (e.g. deserializing JSON while handling extra args, or basic functional operations - though that should change sooner rather than later with the new generic methods, right?)
The decision to initialize every non-pointer primitive with the “bottom value” (or whatever it’s called again) makes sense in isolation, but it’s really unfortunate that they don’t support additive types, because this means a bunch of common tasks need to use pointers, and unfortunately the type system is worthless when it comes to preventing segfaults caused by bugs with pointers.
I find that most Go libraries have basically no documentation, if you’re lucky you get an example that might vaguely be related to whatever you want to know. I’ve had much better experiences in other languages.
All in all IMO most Go code is 5x longer than necessary to actually express itself in a readable manner, all because the language still doesn’t have proper error handling or generic support (until recently at least). At the same time it’s fairly inflexible, the type system is still shallow and basic, and it’s still way too easy to shoot yourself in the foot.
The only good thing Go has going is the single file deployments, but I’ll gladly spend one hour of every remaining day of my life setting up containers, if it means I never have to touch anything Go again.
Quite a while ago, I wrote this to document my understanding what OOP actually is.
This sentence at the end is interesting:
On the other hand it sounds unlikely that there will be a popular language without object-oriented influences some day, so at least minimal syntax-level support is desirable.
Rust was published like one year later and it can be considered popular by now. Does Rust support OOP via traits? Kind of yes, but so does Haskell with typeclasses.
I’ve always preferred the functional approach to programming, so OOP never really intrigued me. That’s one of the reasons why I never liked C++ or Java, but instantly fell in love with Rust. It lets me do a lot of functional style programming, while still being somewhat practical. (I’m looking at you, Haskell.)
I’ve been a long time believer that some problems are better solved via OOP, others through functional programming. The perfect language would be a successful blend of the two.
Many popular OOP languages are horribly lacking on FP or it looks like an eyesore (golang, python, etc). …and FP languages trying to do OOP are kinda awkwards (see common-lisp).
I thought Crystal Lang (a statically type checked dialect of Ruby) was going to be the “perfect language”… but the compile time performance and the lack of 3rd party libraries (like an aws SDK) really made it hard to use.
Hearing what you said about Rust has renewed my hope.
That said, I did notice that features like Coroutines have been “experimental” for nearly 9 years.
I hope I’m missing something obvious, but how would you create any sort of heavy-lifting, long running, multi-session daemon/application without having some sort of asynchronous mechanism that goes beyond threading (which is limited to the number of cores the host machine is running).
edit: cleaned up a few thoughts (prematurely hit submit)
Async has been stable for a long time. Coroutines are just syntax sugar AFAIK.
I don’t think there’s an
std-way of doing it, but the Rust ecosystem has this thing where people usually settle around one library. In this case, it istokio. Afaik, most async stuff is done usingtokio. What littleasyncI’ve used, it’s been usingtokioor some library likeactix-webthat usestokiounder the hood.Also, side note, I never understood the idea of why
golangis ugly. I think it’s fine, except for maybe the repeatedif err != nilguards. Those are ugly. I wish it used additive types for error handling.As a passionate Golang hater, I can gladly explain!
if err != nil, even though that’s already bad enough. But the really fucked up part is the:=bullshit. It makes moving code around unnecessarily annoying, and it’s telling that few other languages share Golang’s approach._much easier to read, and this leaves upper/lower to signal other details. But I see that this is mostly personal preference.All in all IMO most Go code is 5x longer than necessary to actually express itself in a readable manner, all because the language still doesn’t have proper error handling or generic support (until recently at least). At the same time it’s fairly inflexible, the type system is still shallow and basic, and it’s still way too easy to shoot yourself in the foot.
The only good thing Go has going is the single file deployments, but I’ll gladly spend one hour of every remaining day of my life setting up containers, if it means I never have to touch anything Go again.
Quite a while ago, I wrote this to document my understanding what OOP actually is.
This sentence at the end is interesting:
Rust was published like one year later and it can be considered popular by now. Does Rust support OOP via traits? Kind of yes, but so does Haskell with typeclasses.