7 ms·
Elm at Prezi
- zsol 13y agoI recently attended a coding dojo where we wrote code in elm and tests in coffeescript. I was new to both languages but I was surprised how easier elm felt compared to coffeescript (note: I have some haskell background ;]). Here are the results: https://github.com/dzsodzso63/PreziCodingDojo/tree/master/frpDojo https://github.com/dzsodzso63/PreziCodingDojo/tree/master/fr...
- zem 13y agolivescript is a more haskellish descendant of coffeescript: http://livescript.net/ http://livescript.net/
- fossuser 13y agoHere's a list of languages that compile down to Javascript: https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS https://github.com/jashkenas/coffee-script/wiki/List-of-lang.... I didn't realize how many there were.
- SCdF 13y agoIt's fairly crazy, but then again there are ~700 programming languages listed on Wikipedia, so really, there are just a lot of programming languages in general. In terms of Foo->JS there seem to be two main camps, at least that I've noticed: writing a "better" JS (CoffeeScript / Dart et al), and writing something that converts your language to JS so you don't have to learn JS (ClojureScript, Scala.js etc) at all. The latter can have ~700 of those before you've even started to duplicate yourself, so there is still a ways to go :P Arguably there are only half a dozen or so "real" contenders in the former category (in the same way when you decide you want to learn a new programming language you don't pick from all ~700).
- lucian1900 13y ago> so you don't have to learn JS So you don't have to use a language you find deficient, so you can share code with your backend, so you can use the same tools you're used to ...
- zem 13y agoi started a subreddit for people interested in compile-to-js: http://www.reddit.com/r/altjs/ http://www.reddit.com/r/altjs/ not gained much traction so far, but it's a useful place to post interesting links as i find them.
- Ixiaus 13y agoFor those interested in compiling down to Javascript with a strongly and statically typed language, there's a brilliant proper subset of Haskell that compiles down to Javascript called "Fay": https://github.com/faylang/fay/wiki https://github.com/faylang/fay/wiki
- jallmann 13y agoThere is also js_of_ocaml, which can be used to compile straight OCaml to Javascript: http://ocsigen.org/js_of_ocaml/ http://ocsigen.org/js_of_ocaml/ The site has some cool demos including webgl, canvas, and a OCaml toplevel (REPL).
- rtfeldman 13y agoAlso Roy, which is statically typed (with type inference) and is designed for JS interop. It's also written in JS and can be installed with just npm install roy http://roy.brianmckenna.org/ http://roy.brianmckenna.org/
- zem 13y agoi like the looks of opa too: http://opalang.org/ http://opalang.org/
- AndreasFrom 13y agoElm 0.8 was recently announced with a range of improvements for those interested: http://elm-lang.org/blog/announce/version-0.8.elm http://elm-lang.org/blog/announce/version-0.8.elm
- steveklabnik 13y agoI've really enjoyed playing with FRP, I even wrote a little gem in Ruby for it: https://github.com/steveklabnik/frappuccino/ https://github.com/steveklabnik/frappuccino/ And built some simple GUIs using Shoes: https://github.com/steveklabnik/frp_shoes https://github.com/steveklabnik/frp_shoes
- jcurbo 13y agoMe too, I did a project for grad school using FRP. https://github.com/jcurbo/functionally-reactive-solar-system https://github.com/jcurbo/functionally-reactive-solar-system
- aristidb 13y agoIt seems like Haskell users are quite intent on not using Javascript... Elm is written in Haskell. So is Fay. And of course ghcjs.
- halacsy 13y agobecause JS is flexible, the VMs are really good recently and the web platform is tempting but haskell coders miss safety, succinct syntax and efficiency.
- IanChiles 13y agoI think that may not be the case - it may be more that Haskell is a fabulous language to write compilers and parsers in, and so lots of compilers and parsers are written in it :)
- chongli 13y agoIt's a bit of both. I will say that it's very frustrating to use other languages after adjusting to Haskell. The way it feels when it feels when you're out on your own without a helpful compiler to guide you? It's like losing your sense of balance!
- weego 13y agoThe world seems to be intent on writing mountains of code to avoid writing javascript, and usually ending up with a system that compiles to more javascript than if they just wrote javascript. Saying javascript is broken is a nonsense, they mean they feel they should be above writing javascript due to its quirks and inconsistencies. Whatever they write the end result is still the "broken" language they wanted to avoid. It all seems like a huge waste of resources and smart people's time to me, but then I've been writing javascript for getting on for 15 years so perhaps im past it and don't "get it" anymore.
- jschmitz28 13y ago> The world seems to be intent on writing mountains of code to avoid writing javascript, and usually ending up with a system that compiles to more javascript than if they just wrote javascript. Does it really matter how much javascript gets created? That statement could be made for any higher level language where X lines of the higher level language compiles into 5X lines of the target language. Maybe you could hand write your program in the target language using only 4X lines, but the point of the higher level language is to make it easier for the programmer to avoid mistakes as well as reduce source code size, not necessarily compiled code size.
- nahname 13y agoInversion of control is a good thing. Why would you want to avoid it?
- laszlok 13y agoI think the idea here is that you aren't /forced/ into inversion of control. That is, if it is clearer to write things side by side, instead of separated into another callback function, you can keep them together.
- zeckalpha 13y agoIt's not avoided, it just has a different syntax. (Monadic rather than callbacks, but since they are the same thing...)
- icarus127 13y agoI'm genuinely curious, why do you think inversion of control is an unqualified Good Thing™?
- alipang 13y agoBecause of certain limitations in Java-style type systems...?
- revelation 13y ago[..] and every line of JavaScript code costs too much time to maintain. At this point, go to the next blackboard. Write after me: You can not debug Elm. There is no debugger. You can not debug Elm. There is no debugger.
- halacsy 13y agois there any theoretical limitation?
- revelation 13y agoNo, its plain old lazyness. All these "compiled to JS" language makers would rather add more fancy syntactic sugar or extend the standard library than getting their goddamn bases covered. I have no problem with that, but please don't go on about how you are much more productive in this language than in JS, and how much cheaper the code will be to maintain.
- jerf 13y agoPer my sibling post, I do not believe you are technically correct. Debuggers must support the ability to debug compiled languages before anyone can usefully implement support for debugging. I'm curious what exactly you think the developers of languages that compile to JS are not doing out of "lazyness"?
- calpaterson 13y agoA counterexample is coffeescript, which I think does have a plugin for Chrome to allow a source-level debugger.
- cia_plant 13y agoI think it's ridiculous to call people "lazy" who wrote an entirely new language from scratch and released it for free, because it's lacking one feature.
- deno 13y agoYou can run (and debug) Dart natively in Dartium.
- jlatt 13y agoI was really impressed by elm, but I strongly prefer working with a library that provides some of the features without transpiling. If anyone else is interested, I'm looking for some help with my project: https://github.com/jlatt/frp.js https://github.com/jlatt/frp.js
- j_s 13y agoSee also Microsoft Research's Reactive Extensions for JavaScript, released under the Apache License 2.0: https://github.com/Reactive-Extensions/RxJS https://github.com/Reactive-Extensions/RxJS
- alipang 13y agoOr even better, Bacon.js https://github.com/raimohanska/bacon.js https://github.com/raimohanska/bacon.js
- j_s 13y agoThanks for the heads up! Do you have time to explain why bacon is better than Reactive Extensions, and thus the only frp library for JavaScript that you chose to link to? I don't have too much experience with frp in general (primarily just the Reactive Extensions for .NET), and even less with JavaScript implementations, so I'm not really in a position to begin making the comparison. Edit: ah, found https://github.com/raimohanska/bacon.js#for-rxjs-users https://github.com/raimohanska/bacon.js#for-rxjs-users for starters!
- boothead 13y agoIt's much simpler for a start - you've got a good chance of being able to read and understand all of the code in an afternoon.
- Nekorosu 13y agoElm is the future and I'm glad to see it now has some good company's support.
- cuttooth 13y agoElm is the future as much as Java is dead in the software development industry.
- encoderer 13y ago> Elm is the future as much as Java is dead in the software development industry. Correct me if I'm wrong, but it seems like what you've done here is just take one narrow interpretation of Nekorosu's comment and used that as the basis for a dismissive reply that offered no value. --- Dateline 1995: Nekorosu: "Java is the future" Cuttooth: "Java is the future as much as C is dead in the software development industry" --- It's a big industry, cut. There's room for everybody.
- cuttooth 13y agoThe point was that JavaScript is king and this "Elm is the future" suggests that it'll be a major player. Right now it's a niche toy language. There's room for plenty of those, sure, but it takes years of work and development for a language to become worth its salt. Java had its fair share of issues for a while, and arguably still does.
- jluan 13y agoCongratulations, Evan!
- wheatBread 13y agoAhhhh, I recognize that user name! Thank you!! :D
- egonschiele 13y agoI am so excited! It's nice to see a functional language like Elm getting financial support from a company.
- jessedhillon 13y agoI find function application without parentheses enclosing the parameter list to be highly unreadable. Is there something wrong with me?
- d0m 13y agoLol, nothing wrong with you. Just not used to it.
- tikhonj 13y agoIt's just new and you're not used to it. There's nothing wrong with finding new and different syntax confusing, as long as you're willing to keep an open mind. If you use it for a while, you'll get used to it. After a while, I've found it makes the most sense. I think it's better because it reduces the amount of syntactic noise in the code. It's a simple design decision. Function application is the most important part of the language. So it gets the best syntax: none.
- jessedhillon 13y agoCan you give an example of composed function application? E.g., f(a, b, g(x, y)) Thanks
- seliopou 13y agof a b (g x y)
- tikhonj 13y agoYou use parentheses only for grouping. So f a b (g x y) is how you would write your example. In Elm, you could also use the function application operator to avoid writing the parentheses: f a b <| g x y -- EDIT: flipped the operator around In Haskell, this would be done with $, which used to exist in Elm as well: f a b $ g x y Once you get used to mentally parsing the $ as grouping the rest of the expression together--admittedly, it does take a little while--the last version is probably the most readable. At least that's what I've found.
- epidemian 13y agoGreat news that Evan can dedicate fully to Elm as his main job. I'm very curious about the language and its departure/simplification over traditional DOM manipulation with JS. I hope the best for the project and would love to see some effort for the compiler targeting asm.js :D
- egeozcan 13y ago> The cost of writing JavaScript is just too high Every time I see such strongly worded statements, I get amazed by how the authors got to analyze the skills of every developer in the world.
- subb 13y agoUsually, to calm myself, I reword it like this : For us/In my opinion, the cost of writing Javascript is just too high. See? Now the rage is gone! I think I'm going to sell this trick...
- aero142 13y agoI was taught in early rhetoric and composition classes that it is poor style to include "In my opinion" and other qualifiers in pieces that are clearly rhetorical or opinion based. The repetition is unneeded. In engineering discussions it is very common to differentiate between opinions and knowns. When discussions happen between people who don't agree on these things, someone gets annoyed. The engineers get annoyed when people state opinions as fact and think the other person is making unjustified assumptions. The non-engineers get annoyed and think that the other person is being pedantic.
- snprbob86 13y agoThis is not a statement about the skills of other developers. This is a statement about the applicability of JavaScript to the sorts of problems people are trying to solve with it. There are a lot of nice things about JavaScript that people didn't quite understand or appreciate in the early days, but that doesn't change the fact that the HTML5 stack is deeply flawed in many ways for the needs of application developers. That shouldn't be surprising or controversial: All of these technologies were developed in a simpler time for a simpler set of problems.... and in a rush.
- tingletech 13y agonot to be confused with the elm, the old unix mail client: http://www.instinct.org/elm/ http://www.instinct.org/elm/
- obviouslygreen 13y agoI knew this was unlikely to be the subject of the article but clicked through anyway... oh well.
- kbenson 13y agoI was really hoping someone had compiled Elm to JS. That would give me some hope that mutt would be next...
- 205guy 13y agoI'm not the only one. Hey, you can still run pine if you want.
- saosebastiao 13y agoAwesome...you have me intrigued. I would worship the ground you walk on if you targeted asm.js.
- boothead 13y agoSlightly off topic but does anyone know of ans FRP library for python?