News for hackers. Stuff that matters.
Re:JavaScript libraries should be written in TypeScript by tommyd on Wednesday March 16, 2016 @12:06PM (#11298357)
In an ideal world I'm sure a lot of us would love to work with Elm, but the reality in a commercial situation is often that the choice of language is driven by factors like: how widely used/well known it is, what the availability of libraries for it is like, how easy it is to hire developers with experience for.

This unfortunately makes languages like Elm and Clojurescript unlikely to be chosen in a lot of situations (e.g. as I understand it, the JS interop story with Elm isn't amazing, so you can't just use JS libraries with it).

Typescript is close enough to plain Javascript to not scare people off (I'd be willing to bet any JS developer could pick it up in a few hours) and can almost be considered in the same light as vanilla JS in such a decision, yet brings with it the advantages of a fairly decent type system.

As I've said elsewhere, it's definitely not perfect, but for developers in a position where other, more "esoteric" compile-to-JS languages aren't likely to be accepted, Typescript probably represents the best choice of bringing a decent amount of sanity and predictability to codebases.

(This isn't meant to be having a go at the parent BTW, it's just something I've been thinking about a bit and the comment jogged my memory!)

Re:JavaScript libraries should be written in TypeScript by rtfeldman on Wednesday March 16, 2016 @12:17PM (#11298444)
You can totally use JS libraries with Elm. Source: we do it all the time at NoRedInk, and we've been using Elm in production for our millions of users (as our go-to for all front-end work at the company, not just as a side thing) for the better part of a year now. :)

Details about our experience with Elm in production: https://www.youtube.com/watch?v=R2FtMbb-nLs

Re:JavaScript libraries should be written in TypeScript by pka on Wednesday March 16, 2016 @01:07PM (#11298883)
Just for the obligatory record: Purescript is basically "Elm evolved". Everything Elm does, Purescript does better (FFI for example is such a chore in Elm). Drawback: the learning curve is basically as steep as Haskell's.
Re:JavaScript libraries should be written in TypeScript by skeeterbug on Wednesday March 16, 2016 @03:30PM (#11300031)
My experience with Purescript/pulp was rather negative. Basic commands were throwing errors (pulp init IIRC) so I decided to not even consider it for anything serious.
Re:JavaScript libraries should be written in TypeScript by pka on Wednesday March 16, 2016 @04:02PM (#11300241)
The tooling is not perfect, that's absolutely true. I have to say though that any imperfections (which are going to get fixed anyway) are well worth it if you want a pure strongly typed language for the web. There's simply nothing better (except the full-blown Haskell-to-js compilers, like GHCJS and Haste of course).

I recommend you try again and file a bug or look for help in irc if something breaks again (although I've never seen pulp init throw an error).

Re:JavaScript libraries should be written in TypeScript by skeeterbug on Wednesday March 16, 2016 @06:16PM (#11301101)
My memory could be off (on which command failed). I think I still have the repo on my home machine, so I could re-visit and file a bug report. At the time I kept pursuing elm instead. Reports of better FFI with JS is why I had explored PureScript.
Re:JavaScript libraries should be written in TypeScript by skeeterbug on Thursday March 17, 2016 @01:37AM (#11302766)
Update: The bug is with pulp server https://github.com/bodil/pulp/issues/133
Re:JavaScript libraries should be written in TypeScript by pka on Thursday March 17, 2016 @12:21PM (#11305373)
Cool, does it work for you now?
Re:JavaScript libraries should be written in TypeScript by tommyd on Wednesday March 16, 2016 @12:40PM (#11298647)
That's interesting to know! Thanks
Re:JavaScript libraries should be written in TypeScript by Scarbutt on Wednesday March 16, 2016 @01:12PM (#11298930)
Being backed by Microsoft is another strong point of TS for some.