Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is any of this OCaml specific? You can check all boxes with TypeScript.




Those two type systems are not the same. Typescript has some soundness issues in the type system. They are there because they have to work seamless with javascript so it's understandable. And they improve many codebases that would have been otherwise written in javascript. But they do not in any way give you the same level of guarantees that OCaml, Haskell, or Rust would give you.

For all practical purposes I believe it does the same thing.

If you are choosing ocaml they most definitely do not do the same thing for all practical purposes.

Does TypeScript emit machine code? OCaml gives you this option, if you need it.

Well, TS transpiles to JS which then runs on Node, aka V8, a native JIT compiler. So yes, I guess?

Kind of, given that V8 performance is never going to be as good as AOT compiled language, and JIT needs warmup time.

It is no accident that famous JavaScript tools keep being rewritten into C++, Dart, Go and Rust.


But they say "we use ocaml [because it has types]" not "[because it can emit machine code]"

I would go for Rust if I wanted machine code

It's explained in the OP.

No...no you cant.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: