4 ms·
go doesn't have null safety or adts though? (sum types)
by mtelgon 4y ago
go doesn't have null safety or adts though? (sum types)
- 3a2d29 4y agoI think you can have null safety in Go and you certainly can have adts. But even then, what about Ada? I’m also not an expert, but I assume between C#/Typescript/haskell/swift that you can find all those things in many GC/safer languages.
- kinjba11 4y agoGo does not have compile-time null safety or sum types :) foo := Foo{"hello"} fooPointer := &foo fooPointer = nil fmt.Println(fooPointer.Bar) > panic: runtime error: invalid memory address or nil pointer dereference In a language like Kotlin a compile time error would prevent `fooPointer.Bar`, and in Rust `nil` does not exist. Go also does not have sum types, see for instance https://making.pusher.com/alternatives-to-sum-types-in-go/ https://making.pusher.com/alternatives-to-sum-types-in-go/
- Casperin 4y agoYes, Ada. Maybe. I will have to look at it. The rest all are missing basic things. Like, I love TS, but it's absolutely bonkers because js is js. I once worked on a 250k loc project of js/ts, and we had nothing but trouble