Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Oktokolo I'm guessing Go doesn't have metaprogramming, or it would be really easy to add an ADT layer on top of the current typesystem. But I'm sure there are thornier issues with that, but I'd be interested to see if anyone tried it.
-
VOID40494y@Oktokolo it kinda maybe could be a solution if you just want a type union, but the precise thing that pushed me over the edge was a project that required a round robin, which requires going for interface{}, and also made me implement the same method multiple times, because I needed to support channels, and lists, and structs with .Next(). Round robin could be done with parameterized type and the function could take any iterator. Neither of those can be done with Go, unless you just want to cast to interface{} and lose any type safety
-
@VOID404
I never did any GO, because back then, when i evaluated it (by reading the Wikipedia page only *g*), it looked like being dumbed down too much.
Simplicity was a design goal and type inference is certainly more easy when there is less to infer.
But yes, if you only have the most basic static type system possible, you obviously can't comfortably do some stuff that is pretty easy to pull off with languages having a more powerful type system...
You might have chosen the wrong language for your project.
If you really want to have type inference, go for OCaml or F#.
If that isn't a requirement, go for Rust.
If you can live with half to a quarter the speed (chances are, you can), you could also just use Java (the perhaps most boring language ever invented - but it is pretty mature now).
Related Rants
-
xorith19HTML: Hate This Meaningless Life CSS: Can't Style Shit JS: Just Shit Java: Just another vicious asshole PH...
-
nerd-san17Trying to come up with function names when it does more than one thing.
-
ObiSwagKenobi6> Receive sudden phone call in the middle of the night > Check caller, unknown number > "Either something ba...
I have very mixed feelings about Go's KISS policy. They did manage to keep a lot of stuff easy and they force dev's to not over complicate their code. But there is a line. Generics aren't that hard to grasp. I get focusing on *fearless concurrency*, but how about *fearless list processing* FFS
rant
kiss
generics
go