Hacker News new | ask | show | jobs
by truth_seeker 2575 days ago
If PureScript is Haskell, TypeScript is ML

Lately, TypeScript has become more scalable across existing npm libraries and also introduced new advanced types. It looks like Microsoft guys learned a lot from C# and F# type system and feedback from their users

https://www.typescriptlang.org/docs/handbook/advanced-types....

6 comments

This comparison is flawed, imo.

Typescript is Javascript with a relatively advanced type system (mapped types, type guards, etc) on top, but is still very much constrained by Javascript fundamentals and syntax.

The type system evolution was primarily driven by the need to create valid typings for the existing JS ecosystem, and this noticeably shapes the capabilities.

This is the right choice for the language, but I can't see how it resembles the ML family much.

I think that's a decent analogy, to an extent. Of course there's always Reason, which is actually ML.

https://reasonml.github.io

Once you get a taste for higher kinded types (aka: type constructors), there is no going back! PureScript is fantastic language with an active an open community. Best place to start (IMHO) is https://github.com/lumihq/purescript-react-basic You can pretty quickly get a react app up and running
Don't get me wrong. I love PureScript and HKT but the fact that it requires complete buyout to Purescript ecosystem overwhelms my team members and becomes a hard sell. To build a PS layer on top existing JS libraries isn't straight forward. Now that they introduced so many breaking changes, it will take time for other PS libraries to catch up. May be I might go back to PS when 1.0 release happens and I hope many things are stable including libraries which I need in day to day full stack development.

Typescript in the last couple of years introduced a nice way to compose types and ways to get rid of many other common JS gotchas. They have type definitions for almost all the usable npm libraries, which helps you jump-start the development.

It really didn't take long for libraries to catch up, we already released a Package Set compatible with 0.13, two days after the release. That's a set of the most used ~200 libraries in the ecosystem.

https://github.com/purescript/package-sets/releases/tag/psc-...

Yeah I agree with @ff_57 here - the "breaking changes" really aren't a big deal, and don't effect many libraries. With the existing tool chain you will know immediately if a library has any of these incompatibilities, and if it does, the fix is likely some white space issue, which is trivial to fix.
I had the impression:

ClojureScript == Lisp

PureScript == Haskell

Reason == ML

TypeScript == C#

Yes. I agree. It was started like this.

But now Typescript 3.5 is also influenced by F# which is close to ML.

Just look at those advance types and their allowed composition which Typescript supports in its latest release and you will understand.

Yes, feels kinda overloaded to me...
Isn't it BuckleScript == ML
BuckleScript is a OCaml&Reason to JavaScript compiler.
> If PureScript is Haskell, TypeScript is ML

If you want ML, why not OCaml with js_of_ocaml or BuckleScript?

Anders Hejlsberg, who created C#, has been heading up the Typescript team at Microsoft.