News for hackers. Stuff that matters.
Re:Programming a space invader in OCaml and OpenGL: lessons ... by erichocean on Friday February 21, 2020 @01:02PM (#22385209)
TypeScript says hi.
Re:Programming a space invader in OCaml and OpenGL: lessons ... by staticassertion on Friday February 21, 2020 @01:11PM (#22385293)
Typescript makes virtually no changes to JS syntax, except what's necessary to support types.
Re:Programming a space invader in OCaml and OpenGL: lessons ... by erichocean on Friday February 21, 2020 @04:08PM (#22386758)
TypeScript classes, constructors and enums say hi.

Talk about moving the goalposts...

Re:Programming a space invader in OCaml and OpenGL: lessons ... by throwaway894345 on Friday February 21, 2020 @05:09PM (#22387418)
No one is moving the goalposts. TypeScript's raison d'etre is to add static typing to JS. Reason's is to fix the syntax.

(Yes, TS adds new grammatical constructs, but grammatical constructs are about grammar, not syntax, contra Reason).

Re:Programming a space invader in OCaml and OpenGL: lessons ... by staticassertion on Friday February 21, 2020 @10:44PM (#22389283)
Maybe I just don't have enough experience, but I use classes in Javascript and TypeScript, as well as constructors, and they look virtually identical to me. What am I missing here?
Re:Programming a space invader in OCaml and OpenGL: lessons ... by throwaway894345 on Friday February 21, 2020 @01:25PM (#22385421)
TypeScript extends the syntax to support type annotations; it's not trying to fundamentally fix JS syntax.
Re:Programming a space invader in OCaml and OpenGL: lessons ... by erichocean on Friday February 21, 2020 @05:58PM (#22387855)
Now enforcing type safety isn't a fundamental part of a language? I get the impression that you'd dismiss Rust as "basically C".

    ¯\_(ツ)_/¯
Re:Programming a space invader in OCaml and OpenGL: lessons ... by thedufer on Friday February 21, 2020 @08:18PM (#22388730)
It is, that's the point. Reason is, as was said upthread, a "veneer". It changes the syntax only, nothing else is different (you can convert back and forth between the syntaxes losslessly). TypeScript makes deep changes to the language by adding type safety.
Re:Programming a space invader in OCaml and OpenGL: lessons ... by throwaway894345 on Saturday February 22, 2020 @02:11AM (#22389816)
I have no idea how you got that from my post. I don’t know whether type safety is “a fundamental part of a language” or not, but that’s irrelevant to my point. TS extends the JS syntax to support type safety. Reason changes OCaml’s syntax altogether because it’s broken. Big difference.