3 ms·
I've tried JavaScript, and I decided I preferred type safety. This kind of thing: > It lets you do stuff like redefine entire objects, properties or methods at
by cballard 11y ago
I've tried JavaScript, and I decided I preferred type safety. This kind of thing:
> It lets you do stuff like redefine entire objects, properties or methods at runtime
Sounds horrifying to me, because, as in Ruby[1], library authors will decide that's a good idea. Typeclasses/protocols solve this problem perfectly, while maintaining type safety.
[1]: for some reason, this seems to be less of an issue in Python and Obj-C, even though it's totally doable?
- vardump 11y agoIf type safety is what you miss, why not to use some transpiler like TypeScript? http://www.typescriptlang.org/Tutorial http://www.typescriptlang.org/Tutorial
- cballard 11y agoThen you're not writing JavaScript, which was OP's concern. TypeScript is fine (although Elm, Swift, and Haskell are more interesting, IMO).
- 1ris 11y agoLook at purescript. In order to install this madness you need to install not less than 5 package managers, but you might like it.
- purescript 11y agoThe situation has improved since cabal install was required. npm install -g pulp purescript should be enough now.
- deleted 11y ago[deleted]
- vardump 11y agoTypeScript is very close to normal JavaScript. It's basically just JavaScript + type annotations which a compiler can check. Compilation phase removes the annotations, after that point it is pure JavaScript. How are Swift and Haskell relevant for client side web development? Edit: Removed Elm
- the_gipsy 11y agoElm's only target is the browser/JS.
- vardump 11y agoI stand corrected. Never heard of Elm before, but I assumed from context it's non-JavaScript targeting language like Swift and Haskell.
- cies 11y agoAre you aware of GHCJS, Haskell-to-JS, compiler? In the new and rather popular "build/dependency manager"[1] for Haskell, named Stack, you can now quite easily install this compiler. And I think it is only a matter of time till someone writes a Swift-to-JS compiler (Apple might already have it on it's radar). [1]: I know it is not a "build/dependency manager", but I don't know how to call better in for sake of this discussion.