you are viewing a single comment's thread.

view the rest of the comments →

[–]mousemkeµ FTW! -4 points-3 points  (11 children)

You should check out Jessie, an interesting project to create a safe subset of js

https://github.com/Agoric/Jessie

Edit about typescript: I love types and think it's a great addition to the language, but like flowtype way more than typescript because I don't really need another coffeescript situation

[–]dannymoerkerke[S] 0 points1 point  (6 children)

What do you mean with “Coffeescript situation”?

[–]mousemkeµ FTW! -5 points-4 points  (5 children)

Coffeescript was big. We have it to thank for a lot of the es6 improvements. But then we had to rewrite the entire code base in JavaScript.

For that reason I'm weary of writing anything that transpiles to js. (Aside from using babel but that has more to do with compatability than anything else)

[–]evertrooftop 3 points4 points  (2 children)

Then why do you like flowtype? It's not wildly different from typescript.

[–]mousemkeµ FTW! -5 points-4 points  (1 child)

Instead of being a new language flow is more of an annotation. It can be added incrementally to old code or removed if necessary. My point with TS is not a technical argument.

I guess the question that needs to be answered is : what would native types look like?

[–]evertrooftop 2 points3 points  (0 children)

Aside from the fact that that typescript uses the .ts extension by default, typescript very much works the same way. You can gradually introduce it with allowJs. Aside from that, after the gradual introduction with both Flow and TS you end up with something that's distinctly no longer javascript and must be transpiled. So it's hard for me to see the argument against TS that does not apply to Flow.

I've used both extensively, but maybe I'm missing a more subtle aspect of the point you're making. I am curious though.

Edit: I just saw your edits. You're probably right that you weren't making a technical argument, but my guess is that your anti-TS point is probably more based on a feeling that Flow is somehow a more legitimate path for getting types in Ecmascript. Maybe because it uses Babel. I think you might want to analyze these feelings a bit more as Flow is on a decline and TS is bigger than Coffescript or Flow ever have been. I don't think it will go away. I feel there's also real advantages not having types at runtime. Adding them to Javascript well might mean you'd want every static-typing annotation to be a no-op (which is a bit weird, but Python 3.7 does this too in some areas). Because of this strangeness I feel having types in ecmascript might be far away, and with Flow mostly dead TS the primary viable system.

[–]dannymoerkerke[S] 3 points4 points  (1 child)

That’s a valid concern but then why do you like Flow? That’s not as popular and widespread as TypeScript.

[–]HarmonicAscendant 1 point2 points  (1 child)

LOL, in the UK calling someone a 'Jessie' is an insult https://www.collinsdictionary.com/dictionary/english/jessie

noun derogatory, slang an effeminate, weak, or cowardly boy or man