3 ms·
I strongly believe that for any language that compiles to JS to be successful, seamless integration with existing JS is absolutely required. This is the main se
by hellofunk 11y ago
I strongly believe that for any language that compiles to JS to be successful, seamless integration with existing JS is absolutely required. This is the main selling point of Clojurescript which, while I enjoy Clojure a lot, is a dynamically typed language like JS itself, and I wish I could interact with JS in a stricter way. If Elm can improve on its interop, it has potential to be a strong force. But this is true of any new language. If you can't easily interop with the lowest common denominator language in the platform you build for, your language is too restricted for meaningful use. This is why Rust integrates well with C, because it has to, or it is irrelevant in many cases. This is why Clojure interops seamlessly with Java. Elm needs to get this point, or it will remain a niche hobby language avoided by professionals.
- kasbah 11y agoI think that's a bit unfair as Elm is already seeing some professional use. Though on the subject of inter-op, Purescript might be what you are looking for if you want a strongly-typed, Haskell-like language, compiled to JS with a less cumbersome foreign function interface. Your point still stands though, I hope Elm comes up with some good ways to say "trust me I know what I am doing" and "here is some JS, run it". EDIT: Though it might be that that goes against the whole premise of the language.
- sjrd 11y agoAnd this is why Scala.js interops seamlessly with JavaScript. [1] Most of the time, you don't even know whether you're calling other Scala.js code or JavaScript libraries, and it's all typed. If you want to interact with JS in a stricter way, you should check it out. [1] http://www.scala-js.org/doc/interoperability/ http://www.scala-js.org/doc/interoperability/
- edko 11y agoScala.js is simply amazing: powerful, performant, acceptable compiled code size, easy interoperation with JS, lots of well-tested libraries, a good community, and excellent IDE tools. I am very tempted to start learning Elm and Purescript. They both seem very elegant languages, but I keep postponing it until there is an IDE with good code completion, to ease the learning curve.
- gb 11y agoThere's some work towards that in PureScript: https://github.com/kRITZCREEK/psc-ide https://github.com/kRITZCREEK/psc-ide provides an interface for multiple editors, seems like Atom, Emacs, Vim and VS are available currently.
- danneu 11y agoI use Elm in production and I feel like I have a sufficient interop toolkit between implementing tasks (writing native modules) and ports. Unlike Clojurescript, Elm interacts with your explicitly defined Javascript boundary rather than tries to let you mix it all together in the same soup. The person you're responding to points out that they were more productive once they refinanced their code to take on some technical debt, but that's always an available trade-off in programming.