HNHacker News
TopNewBestAskShowJobs

wheatBread

789 karma · joined December 7, 2011

submissionscomments
wheatBread··on Elm: declarative language that compiles to HTML, CSS and JS
A generalization. Arrowized FRP (as introduced in Yampa) can be entirely embedded in Elm.

The Automaton library is the beginnings of such an embedding: http://elm-lang.org/docs/Automaton.elm

To be more concrete, in Elm you can work directly with signals if you want. In Yampa you cannot; you only get "signal functions" (which Elm has as well in the form of Automatons).

wheatBread··on Elm: declarative language that compiles to HTML, CSS and JS
1) Brand new language inspired by Haskell's syntax, but it is really much closer to ML (strict evaluation, no type classes). More info: http://www.testblogpleaseignore.com/2012/06/21/why-elm/

2) That is totally true! The idea is quite general. I think it works best in a strongly typed language like OCaml or Haskell, but it could work anywhere. FrTime is a Scheme/Lisp/Racket version of FRP. My personal opinion is that it works best in Elm though :P

wheatBread··on Elm: declarative language that compiles to HTML, CSS and JS
It serves Elm files directly. You just start it up, and can use F5 to recompile files from the browser.

PS. Thank you! :D I actually like web programming these days because of it :)

wheatBread··on Elm: declarative language that compiles to HTML, CSS and JS
I think so, but I am biased (lead dev and designer :P)

The entire site is written in Elm (excluding the code editor which relies on CodeMirror). If you click the "View Page Source" in the top right corner of every page, you can see the full source for it.

For example: http://elm-lang.org/edit/Examples.elm

Here's the [full source for the website](https://github.com/evancz/elm-lang.org/tree/master/public) and a [game of Pong](http://elm-lang.org/blog/games-in-elm/part-0/Making-Pong.htm...).

wheatBread··on Elm: declarative language that compiles to HTML, CSS and JS
While this massive bit of speculation is exciting, this is not the case. It is a compiler error indicating that the poster somehow compiled an Elm file without any content in it. I suspect my servers are having a bad time right now, so the file may have been only partially read for some reason.

I am trying to scale my servers up now!

wheatBread··on Elm: declarative language that compiles to HTML, CSS and JS
Can you specify which link you visited? Or what platform you are on?
wheatBread··on Elm: Functional Reactive Web Programming. Source + compiler/server now available
Elm is a functional reactive language for web programming. To learn the basics, please check out the recently updated interactive examples (http://elm-lang.org/Examples.elm) and documentation (http://elm-lang.org/Documentation.elm). This project is the result of my undergraduate thesis, so it is still a work in progress. Also, I know compiling to HTML, CSS, and JS can be controversial, so please look at the examples and try using Elm yourself before you make up your mind.

The Elm source code is available at github (https://github.com/evancz/Elm), and the compiler/server is available through Hackage (http://hackage.haskell.org/package/Elm).

See these install instructions (https://github.com/evancz/Elm/blob/master/README.md) to get Elm running on your machine. I have successfully installed on fresh copies of Ubuntu 11.10 and 12.04, Debian, and Linux Mint. Others have successfully installed with Win7 and OSX Lion. If you are having trouble that is not resolved by the install instructions, please ask me here and I'll do my best to help!

P.S. As of this release, Elm has support for ADTs (which explains the representation of strings).

wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
I couldn't have said it better myself. Thanks for backing me up :)
wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
What was your project called? I remember reading a paper on an ML implementation of FRP (Reactive ML?); I'm curious if that was you. Also, yes, on my website.

I'm working with Stephen Chong. This isn't his primary research focus, but he is a really great adviser. Our PL group is really strong (I think :P), so I have lots of great resources around.

wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
Thank you :)

- It isn't open source right now. I think that's best while the language is still developing, but I plan on opening it up once things have settled down. I don't want to have legacy code before I've even started :P

- No, that aspect is fairly tangential. Since my language is heavily based on the lambda calculus, I already have pretty good basis for nice type properties. I don't have a formal semantics right now, so it will be a while before any such proof would even be possible.

- Both hopefully! I totally understand this dilemma. As lots of people here have pointed out, there is a lot of work to be done on the implementation, but the theoretical aspects of the language have to be a higher priority for the next couple months. It's stressful!

I wish you the best on your project! It sounds really ambitious / useful. I imagine such an analysis could help generate much faster code too.

wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
That's a much tougher question. I am still early in the process, so I don't have a clean and clear answer yet. I am trying to approach FRP from the perspective of GUI design. In this context continuous Behaviors and discrete Events are not exactly what a developer would want to deal with. I don't want to go into it too much now, but I will definitely post my thesis once it is done.

Also, thanks for pointing out the Opera mistake. It is on my to-do list!

wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
Thank you!

Dictionaries and Sets are high on the ever growing list of extremely important libraries :)

Also, it compiles to HTML, CSS, and JS. Not just JS!

wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
For those of you not familiar with FRP, it's a really great read! Hudak and Elliott really present their ideas clearly and elegantly.
wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
This is an important issue! I'm aware of the problem and have some ideas of how to avoid it. My compiler is not actually doing any optimization at this stage, so this will be addressed when I give this more attention.
wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
Flapjax still has you deal with the abstractions provided by HTML and CSS. I generally think these abstractions are pretty problematic, but more subtly, this means you must think imperatively (e.g. modifying the DOM) which doesn't really fit with the FRP paradigm. Flapjax is also based on the classical formulation of FRP which I think is not ideal for this setting (that is a big part of my thesis).

Nonetheless, I think Flapjax is a really cool project, and if you have to work with HTML, CSS, and JS directly, I can imagine it makes many things much more pleasant.

wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
Thank you! And yes, that has been a really good way to test the language out. I don't want to add it to the examples because I use some internal-only functions to make it work nicely. It's also not terribly instructive. You can see it at (http://elm-lang.org/edit/Elm.elm) if you really want. Due to some implementation issues with Element sizing and some Element abstractions, there is some suboptimal stuff in there, but I am working on it. It should be shorter and prettier when the language and implementation gets more mature.

For instance, I am really unhappy with padding/margin, so that almost certainly come out. I have a nicer abstraction in mind that should solve HTML's problems with padding/margins/positioning. I can't say it will happen soon, but it's on the way.

P.S. If you want to look at other files, adding 'edit' to an Elm file gives you the source right now. http://elm-lang.org/edit/...

wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
Thank you :) No download yet though. With thesis deadlines, it will be ready in spring at the earliest.
wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
This is my project. I agree that the type of link is a little weird. This was added pretty early on in the project and I haven't circled back around to rethink it. I'll try to address your questions:

- Why is text necessary? Elements are all rectangles that have a uniform set of functions that can be applied to them. Strings are definitely not rectangles, and I think it is important that the type of String and Element are not conflated. In that case what does (++) do when given an Element? It just wouldn't work out.

- Why is text unescaped? That's pretty much an implementation oversight from when I was first starting the project. Strings should be exactly what you intend to display. I have been meaning to go back through and fix up the underlying string representation, but I just don't have time right now. I have been focusing on the theoretical aspects of reactive programming for my thesis which is my main priority at the moment. Nonetheless, this will be fixed eventually!

- Why (link :: String -> String -> String)? My thought when I designed it this way was that part of what it means to be a string includes styling (bold, italic, etc.). Following this idea, this would have to be true of characters as well, so (head (link "/" "Elm")) would give you a character that is a link. I honestly think that's a little weird. I,ve gotten questions about this before, and I'm not exactly sure what the right answer is. The other option is to include an intermediate type of strings that does include style information, but then you need to lift normal strings up to this type to do concatenation (unpleasant). Doing this right is going to be really hard, and I haven't given it the time to really figure it out. I'll probably include ways to use markdown (or HTML) which will alleviate some of these issues. If you have suggestions on this topic I'd be interested to hear. It's harder than it looks :P

Also, let me stress that this project is VERY young, so there are still many kinks to be worked out. There is no download available now. With upcoming thesis deadlines, I probably won't have one up until spring of next year at the earliest. Thank you for your interest! I'm working as fast as I can!

wheatBread··on Elm: a functional reactive programming language that compiles to JavaScript
Hey, this is my project! :) I am surprised it got posted here, but I am also glad to see people are interested.

One note on the title of this post: Elm compiles to HTML, CSS, and JS. Not just JS! I think this actually an extremely important distinction! It differentiates the project from templating libraries which still ultimately have you think and write in HTML. It also distinguishes it from scripting languages (like CoffeeScript) which also only address part of the problem. With Elm, you shouldn't need the mental model imposed by HTML and CSS which I think will be a really great thing.

← PreviousPage 2 of 2