5 ms·
I’m not a typescript person, but to be fair to typescript, its type system is still much more expressive than Go’s, even with the generics addition
by jamespwilliams 5y ago
I’m not a typescript person, but to be fair to typescript, its type system is still much more expressive than Go’s, even with the generics addition
- woah 5y agoTypescript is stricter and safer while also being less obtrusive than Go
- travisd 5y agoThis isn't super clearcut. Typescript has lots of footguns and famously says that soundness is not one of their driving factors. There are lots of ways to devolve to accidental implicit any's (even with the no implicit any strict rule turned on). Of course, Go makes zero attempt to enforce nullability (nilability?) in its type system... so... win some, lose some I guess.
- Thaxll 5y agoAny language based on JS can't be safer than Go. The end result of TS is JS which is a dynamic language.
- friedman23 5y agoOk, so if Go compiled to JS it would be a dynamic language? https://github.com/gopherjs/gopherjs https://github.com/gopherjs/gopherjs
- ByteJockey 5y agoUltimately everything ends up as machine code, which is untyped.
- fwip 5y agoThat's absurd. If TS can't be secure because it compiles to an unsafe language (JS), Go can't be secure because it compiles to unsafe assembly.
- jwandborg 5y agoThe usual end result of Go is machine code, machine code is not safe to the degree you would consider Go to be safe. Yet you consider Go to be safe but not TS.
- fsdjkflsjfsoij 5y agoTypescript is also far slower both in terms of runtime and compilation time, uses much more memory, and is far more complicated which in turn has led to a ton more compiler bugs. It also inherits a ton of questionable features and API decisions from Javascript and has a tiny standard library which means most Typescript developers repeatedly end up turning to the NPM ecosystem which is an unmitigated disaster. Deployment also isn't even remotely as simple and reliable as Go even with Deno compile. I like Typescript a lot but the reality of Typescript development is not great.
- woah 5y agoI'm just talking about the type system here. Go could easily add the best features of typescript without incurring any runtime costs.
- deleted 5y ago[deleted]