3 ms·
I would argue Gin/Go isn't really statically typed. I mean sure you can specify that this var is a int32, but pretty much every tutorial, every code snippet ou
by hitpointdrew 3y ago
I would argue Gin/Go isn't really statically typed.
I mean sure you can specify that this var is a int32, but pretty much every tutorial, every code snippet out there, will do.
myvar := 10
And just let Go guess what the type should be. So yeah, Go CAN be statically typed, but in practice it rarely is.
- calderwoodra 3y agoAren't go types determined at compile time? That would make it static in my book. But regardless of that, are you also implying that Gin is as good as nodejs/Django/ror? There are lots of bad dynamically typed web frameworks, but I'm looking for a good one that's statically typed.
- htljwfasdf 3y agoWhat you are observing here is actually called "Type Inference".
- tom_ 3y agoBut the point is, the name is that type, a property enforced at compile time. If you do ``myvar:=10'', you can't then do ``myvar="fred"'', because the value of myvar must be an integer.
- Jtsummers 3y agoThat's type inference, not dynamic typing. The two are distinct language features. Many statically typed languages offer type inference: Haskell, C++, Rust, Java, D, SML, OCaml, C#, F#. Good luck convincing people that those are dynamically typed languages just because they have type inference.