Live data from Hacker News

So you want to write a type checker (2014)

languagengine.co

21–30 of 103 posts

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

#21

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, ...).

Some are supersets of JS, some are not. Elm, Fable, etc are examples of languages not just extensions.

The reason for using an extension/superset is usually not because JS is terrific but because gradual/partial migration and interop are more important than a better language.

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

#22

Earlier quoted context omitted.

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?

Yes exactly

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

#23
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.

What's wrong with TypeScript?

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

#24
post #23

Earlier quoted context omitted.

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.

What's wrong with TypeScript?

I haven't used it enough to have a detailed opinion but from what I can see it looks like an excellent language.

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

#26
post #5
post #3

Earlier quoted context omitted.

raises hand There are dozens of us!

literally :) EDIT: Oh, the hard earned karma is leaving me. :) I apologize for the irony! In a nicer way: if you're interested in type theory then javascript is not the language to look at. I'm not even sure if typescript helps here, since the typing mechanism is fairly simple (and I don't mean it's not useful -- just not very advanced).

Well, it's kind of like "if you're interested in type theory then bash will not arouse your intellectual curiosity."

Sure, but it's still a practical and kind of necessary part of the world, and if you take it for what it is, it's pretty nice.

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

#27
post #2

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

This is probably generally true in terms of the language itself, but one assumes that there are people that love type-theory yet also like JavaScript for its ecosystem, environment-reach and hackability.

And perhaps there are people that enjoy the difficulties in trying to type a language which is very dynamic.

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

#28
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

TypeScript, the language which only just this month added a flag to turn off their completely incorrect subtyping rules for functions! A flag!

I remember reporting this bug years ago, and they said it was "by design, since JS programmers prefer to think of functions as covariant in their input". Well, I prefer to think of 2+2 as equalling 5.

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

#29
post #27
post #2

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

This is probably generally true in terms of the language itself, but one assumes that there are people that love type-theory yet also like JavaScript for its ecosystem, environment-reach and hackability. And perhaps there are people that enjoy the difficulties in trying to type a language which is very dynamic.

Yes the deployment model of js runtimes is second to none. As are the runtimes themselves. The ecosystem is vibrant (though perhaps a bit chaotic)

JS the language (ES5 in particular) and its standard library is really all thats laughable about JS.

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

#30
post #5
post #3

Earlier quoted context omitted.

raises hand There are dozens of us!

literally :) EDIT: Oh, the hard earned karma is leaving me. :) I apologize for the irony! In a nicer way: if you're interested in type theory then javascript is not the language to look at. I'm not even sure if typescript helps here, since the typing mechanism is fairly simple (and I don't mean it's not useful -- just not very advanced).

Don't underestimate Typescript.

Sure, it's somewhat restricted by the "superset of JS" property, but you still get stuff like ADTs with exhaustiveness checking.

Post reply on HN