Live data from Hacker News

So you want to write a type checker (2014)

languagengine.co

11–20 of 103 posts

Re: So you want to write a type checker (2014)

#13
post #2

Venn diagram of people who are interested in type theory, and people who like Javascript... OO

Why? Why be so elitist and dismissive?

It was a bit tounge in cheek. Considering that half the languages and typecheckers invented in the last decade were invented simply because the JS type system isn't what it should. Coffeescript, TypeScript, Fable, PureScript (And countless others).

Re: So you want to write a type checker (2014)

#14
post #2

Venn diagram of people who are interested in type theory, and people who like Javascript... OO

Eh, there's still TypeScript and Flow. Myself, I'm a fan of the latter.

My point was: all those typecheckers and languages are there because the people who like types and javascript go off and write a typechecker or language. So they don't have to deal with javascript types.

Typescript and Flow are two such examples.

Re: So you want to write a type checker (2014)

#15
post #4
post #2

Venn diagram of people who are interested in type theory, and people who like Javascript... OO

You might want to give this a look: https://github.com/Microsoft/TypeScript

My point exactly. If people who liked type systems could stand to use the JS type system (and I only barely managed to write type system without scare quotes), we wouldn't have TypeScript. Or Cofeescript. Or Purescript. Or Elm. Or Fable. Or Flow. Or even ES6.

Re: So you want to write a type checker (2014)

#16
post #7

Perhaps I don't want to just type-check, but I want to do type-inference as well.

I recommend the paper "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism" by Dunfield and Krishnaswami. It describes an easy to implement algorithm for type inference for higher ranked types that can subsume Hindley-Milner.

Implementation in Haskell: https://github.com/ollef/Bidirectional

Implementation in Javascript/Typescript (by me): https://github.com/atennapel/bidirectional.js

Re: So you want to write a type checker (2014)

#17

Earlier quoted context omitted.

Why? Why be so elitist and dismissive?

It was a bit tounge in cheek. Considering that half the languages and typecheckers invented in the last decade were invented simply because the JS type system isn't what it should. Coffeescript, TypeScript, Fable, PureScript (And countless others).

What does Coffeescript has to do with typing systems?

Re: So you want to write a type checker (2014)

#18

Earlier quoted context omitted.

Eh, there's still TypeScript and Flow. Myself, I'm a fan of the latter.

My point was: all those typecheckers and languages are there because the people who like types and javascript go off and write a typechecker or language. So they don't have to deal with javascript types. Typescript and Flow are two such examples.

I understand your point, it's simply wrong. If those people didn't want to use javascript, they could have migrated to something else altogether. Clojurescript, Elm, Dart, RustJs, ...

Instead they kept Javascript with a type system on the top (typescript, purescript, flow, ...).

Re: So you want to write a type checker (2014)

#19
post #4

Earlier quoted context omitted.

You might want to give this a look: https://github.com/Microsoft/TypeScript

My point exactly. If people who liked type systems could stand to use the JS type system (and I only barely managed to write type system without scare quotes), we wouldn't have TypeScript. Or Cofeescript. Or Purescript. Or Elm. Or Fable. Or Flow. Or even ES6.

maybe because browsers and backwards compatibility exist and we cant just change the language as we please?

Re: So you want to write a type checker (2014)

#20

Earlier quoted context omitted.

My point was: all those typecheckers and languages are there because the people who like types and javascript go off and write a typechecker or language. So they don't have to deal with javascript types. Typescript and Flow are two such examples.

I understand your point, it's simply wrong. If those people didn't want to use javascript, they could have migrated to something else altogether. Clojurescript, Elm, Dart, RustJs, ... Instead they kept Javascript with a type system on the top (typescript, purescript, flow, ...).

Dart could have been so beautiful T_T
Post reply on HN