Wow...Elm is Elixir for the front-end

3,443 views
Skip to first unread message

Doug Goldie

unread,
Aug 28, 2015, 3:25:44 PM8/28/15
to elixir-lang-talk


Last week, I finally went down the bunny trail of Elm.

I had a free day, and took the short video course from Pragmatic Studio.


And Wow…. the Elm language is so much like Elixir !!!


My first reaction was amazement. 

I was just completely shocked at how much like Elixir it was. 

Note to purists:  ok, yes there are differences.:-)


This was totally unexpected.

It really felt like Elixir for the front-end !


So, wanting to learn more elm and curious about the history, I read the chapter on Elm in 

Seven More Languages in Seven Weeks in which there was an interview with Elm's author.

As expected, he referenced the usual suspects among functional languages, but not Elixir.


So, apparently this is a case of multiple discovery????


--- 

Then, a couple of days ago, a friend was evangelizing Clojure to me and reminded me that there is ClojureScript!

And yesterday, Josh Adams in ElixirSips, reminded us all of ElixirScript!!


---

Of course the real question is whether a functional language is better on the front-end....

....over the legion of js frameworks like angular.


Then, which one is better?

.....let the flame wars begin!

Rich Morin

unread,
Sep 3, 2015, 7:02:40 PM9/3/15
to elixir-l...@googlegroups.com
Although Elm is reminiscent of Elixir, it borrows more from Haskell
(and less from Erlang and Clojure). For example:

* Elm has currying, FRP, signals, static typing, ...

* Elm lacks distribution, lightweight processes, messages,
OTP, pattern matching, prototypes, syntactic macros, ...

That said, I think that Elm could be a very interesting language for
writing Phoenix clients. Has anyone tried this? If not, what kinds
of apps would work well as examples?

-r


--
http://www.cfcl.com/rdm Rich Morin r...@cfcl.com
http://www.cfcl.com/rdm/resume San Bruno, CA, USA +1 650-873-7841

Software system design, development, and documentation


al...@cultivatehq.com

unread,
Sep 4, 2015, 5:46:06 AM9/4/15
to elixir-lang-talk
Hi Rich,

Funny you should mention it but I've been playing about with Phoenix and Elm. I have a series of posts on it that are working through the review/edit process just now and will be giving a talk on it at ElixirConf in Austin next month. :)

I really like the way the two technologies work together. I'll post the links to the blog posts here when they're ready. Hopefully be early next week. :)

Alan

Gabriel Jaldon

unread,
Sep 4, 2015, 10:04:32 AM9/4/15
to elixir-lang-talk
I'm looking forward to those blog posts, Alan!

Torben Hoffmann

unread,
Sep 4, 2015, 11:39:12 AM9/4/15
to elixir-l...@googlegroups.com
+1 on that!!

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/f3b044f1-e58e-4d1d-9acc-628c29b1d40d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Tallak Tveide

unread,
Sep 4, 2015, 11:46:58 AM9/4/15
to elixir-lang-talk
The perfect mix might be ElixirScript coupled with Elm model for reactive programming via lifting :) mind blowing stuff. In these times you could only wish for more hours in the day

Bryan Joseph

unread,
Sep 4, 2015, 1:23:55 PM9/4/15
to elixir-l...@googlegroups.com
I've been looking at elm more these days as well. Using it with Phoenix channels sounds like a really good match. I can't wait to hear more stories of Elm and Elixir in harmony.


As for ElixirScript and reactive programming, it'll happen eventually. I've been more concerned with getting it usable and making the written code look better. I left a Clojurescript talk I went to last week with the mantra "embrace the environment". I'm still trying to figure out exactly what they means for this.

On Fri, Sep 4, 2015 at 10:46 AM, Tallak Tveide <tal...@gmail.com> wrote:
The perfect mix might be ElixirScript coupled with Elm model for reactive programming via lifting :) mind blowing stuff. In these times you could only wish for more hours in the day
--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.

Alan Gardner

unread,
Sep 11, 2015, 6:23:52 AM9/11/15
to elixir-l...@googlegroups.com, elixir-l...@googlegroups.com
Just a quick update to say that, on writing the next piece on using Phoenix channels with Elm, I realised that the first parts were actually hindering my explanation. So I’m rewriting it all! (Am I doing this right? :P)

Hope to publish next week, but we’ll see … :)

Alan



You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/Bz4o4SuMDIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/CAKRLFpbW_df1GmYc08S%2Bnbs7xwSpztvYhStBsQECbF0H5d3VjA%40mail.gmail.com.

Rich Morin

unread,
Sep 11, 2015, 8:51:29 AM9/11/15
to elixir-l...@googlegroups.com
There are two relevant meetups this coming week in San Francisco:

Elixir Hack Night; Tuesday, September 15, 2015
http://www.meetup.com/Bay-Area-Elixir-Meetup/events/224869825

Elm Hackathon; Wednesday, September 16, 2015
http://www.meetup.com/Elm-user-group-SF/events/225012501

So, I've posted notes to each of the event listings, ala:

Elm is a very plausible match for Elixir's Phoenix Framework,
but someone needs to get things rolling. The Elixir Hack Night
and the Elm Hackathon are one night apart. Can we use this
alignment of the stars to jump start some development?

My list of ponies and unicorns includes a HowTo for setting up a
combined installation, an example program, etc. If anyone here
can come to one or both events, that would be great. Otherwise,
feel free to offer comments, pointers, and suggestions!

Mads Flensted-Urech

unread,
Sep 11, 2015, 10:06:29 AM9/11/15
to elixir-l...@googlegroups.com

Yes Elm is super interesting as match for Phoenix channels.

I did a walk-through example of Elm and Phoenix for our Copenhagen Elixir meetup back in June, you can find the code here https://github.com/madsflensted/dots

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.

Alan Gardner

unread,
Sep 11, 2015, 10:57:13 AM9/11/15
to elixir-l...@googlegroups.com, elixir-l...@googlegroups.com
Good to hear that others are playing with this stuff too. :)

Alan



You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/Bz4o4SuMDIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/CAJngfSnE03WfFhJX0tJ%3D5h0Dk26WRrqnPk58efisXHVg14MZJQ%40mail.gmail.com.

Mads Flensted-Urech

unread,
Sep 11, 2015, 3:27:34 PM9/11/15
to elixir-l...@googlegroups.com
Allan,  ooking forward to your posts and the recording from the ElixirConf, unfortunately I won't be able to go to Austin this time around.





Mads Flensted-Urech

unread,
Sep 11, 2015, 3:28:10 PM9/11/15
to elixir-l...@googlegroups.com
hmm "ooking" and looking forward to them :-)

Alan Gardner

unread,
Sep 11, 2015, 3:29:26 PM9/11/15
to elixir-l...@googlegroups.com
I'm using elm-brunch so thanks for that, Mads :)

Sent from Mailbox for iPhone. Please excuse brevity and typos.


Mads Flensted-Urech

unread,
Sep 11, 2015, 3:39:45 PM9/11/15
to elixir-l...@googlegroups.com
Ah, yes - sorry didn't link up the two - thanks for the pull request!

I plan on revisiting that module once the Elm 0.16 is out.

Alan Gardner

unread,
Sep 11, 2015, 3:49:17 PM9/11/15
to elixir-l...@googlegroups.com
No worries. Thanks for accepting. :)

Hope I manage to get my blog post out before Elm 0.16. It's already seen 3 Phoenix, 2 Elixir and 1 Erlang version bumps. :D

Sent from Mailbox for iPhone. Please excuse brevity and typos.


Rich Morin

unread,
Sep 11, 2015, 6:24:28 PM9/11/15
to elixir-l...@googlegroups.com
My impression is that Phoenix supports the usual sort of JSON/REST/...
that (say) Ruby on Rails does, but it also supports "Channels", which
provide an abstract interface to assorted types of persistent client
connections (e.g., long polling, WebSockets):

http://www.phoenixframework.org/docs/channels

I would guess that Elm supports the JSON/REST/... style of API, but I
don't know if it would play nicely with Channels, out of the box. If
anyone has any info or suggestions on this, please speak up!

Alan Gardner

unread,
Sep 11, 2015, 6:56:03 PM9/11/15
to elixir-l...@googlegroups.com
Hi Rich,

Elm has Signals (http://elm-lang.org/guide/reactivity) that allow you to create “streams” of values and ports (http://elm-lang.org/guide/interop) which are used to interop with javascript. Together you can wire those up to stream values to Phoenix channels and subscribe to broadcasts coming back. I have a blog post in flight that demos this. I’ll also be talking at ElixirConf in October on the same. I believe that Mads also gave a talk on this and had a link above to his code from that.

Alan



--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/Bz4o4SuMDIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.

Rich Morin

unread,
Sep 11, 2015, 7:12:23 PM9/11/15
to elixir-lang-talk
On Sep 11, 2015, at 15:55, Alan Gardner <al...@cultivatehq.com> wrote:
> Elm has Signals ... that allow you to create “streams” of values and
> ports ... which are used to interop with javascript. Together you
> can wire those up to stream values to Phoenix channels and subscribe
> to broadcasts coming back. I have a blog post in flight that demos
> this. I’ll also be talking at ElixirConf in October on the same. I
> believe that Mads also gave a talk on this and had a link above to
> his code from that.

I had assumed that Channels (like any I/O) should be linked up with
Signals. I just didn't know whether they were, out of the box. I
am looking forward to your blog and your talk. Meanwhile, I've been
watching Mike Clark's latest Elm tutorial from Pragmatic Studio:

Elm: Signals, Mailboxes & Ports
https://pragmaticstudio.com/elm-signals

Alan Gardner

unread,
Sep 11, 2015, 7:14:15 PM9/11/15
to elixir-l...@googlegroups.com
Just watching those myself too, and they’re great. Up to video 8. I wish they’d been there a few weeks ago when I was trying to figure this out! :D

Alan



--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/Bz4o4SuMDIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.

Bryan Joseph

unread,
Sep 11, 2015, 8:06:16 PM9/11/15
to elixir-l...@googlegroups.com
I went through the first set of those videos today and they definitely helped me understand how to get up and running with Elm. I'm going to go through the Signals one some time this weekend as well.

Alan Gardner wrote:
You received this message because you are subscribed to the Google
Groups "elixir-lang-talk" group.

To unsubscribe from this group and stop receiving emails from it, send
an email to elixir-lang-ta...@googlegroups.com

To view this discussion on the web visit

Rich Morin

unread,
Sep 16, 2015, 10:04:38 AM9/16/15
to elixir-l...@googlegroups.com
On Sep 11, 2015, at 05:48, Rich Morin <r...@cfcl.com> wrote:
> There are two relevant meetups this coming week in San Francisco:
>
> Elixir Hack Night; Tuesday, September 15, 2015
> http://www.meetup.com/Bay-Area-Elixir-Meetup/events/224869825
>
> Elm Hackathon; Wednesday, September 16, 2015
> http://www.meetup.com/Elm-user-group-SF/events/225012501

A few Elm enthusiasts showed up at the Elixir Hack Night. After
hacking for a couple of hours, we had a nice conversation about
what kinds of example programs are needed, where things might be
going, etc.

I made a start on a (Mac OS X) installation HowTo (comments welcome):

Elm HowTo
http://wiki.cfcl.com/Projects/Elixir/PF/Elm_HowTo

Bradford Kottel (IIRC) worked his way through the first five parts of
Alan Gardner's seat_saver demo:

https://github.com/urfolomeus/seat_saver

I have no idea if other Elixeros will show up at the Elm Hackathon,
but I plan to start an extremely trivial app that demonstrates how
Phoenix and Elm can converse via HTTP requests and Channels.

Torben Hoffmann

unread,
Sep 16, 2015, 11:23:03 AM9/16/15
to elixir-l...@googlegroups.com
I think that an Elm+Elixir version of this book is what will serve the cause really well:

Cheers,
Torben

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Redvers Davies

unread,
Sep 16, 2015, 11:26:12 AM9/16/15
to elixir-l...@googlegroups.com
A quick blog post / example code / anything as to how to get elm and
phoenix channels to place nice together would be very much
appreciated.

I have very little in the way of modern-styled front-end development.
I struggled going through many of the phoenix channels examples simply
because I don't have the assumed .js framework knowledge. Now, that
shiny app that Chris McCord's class wrote which interfaces phoenix
channels with chat and Wolfram Alpha may help me a fair amount but I
don't see any way of getting a hold of that content without being at
training in person. Make that class an online class and *just take my
money* Chris :-)

Going straight to elm may be a good route for me. My main use-case is
wanting to present live streaming data from an existing elixir app so
channels are a no-brainer. I'm missing the bits that most around
these parts consider assumed knowledge.
> --
> You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/5A1E7D35-1146-4519-B685-744A41DE7502%40cfcl.com.

Nick Pavlica

unread,
Sep 17, 2015, 6:04:16 PM9/17/15
to elixir-lang-talk
On Friday, September 4, 2015 at 3:46:06 AM UTC-6, Alan Gardner wrote:
Hi Rich,

Funny you should mention it but I've been playing about with Phoenix and Elm. I have a series of posts on it that are working through the review/edit process just now and will be giving a talk on it at ElixirConf in Austin next month. :)

I really like the way the two technologies work together. I'll post the links to the blog posts here when they're ready. Hopefully be early next week. :)

Alan

I've just started to look at Elm, and was thinking that it may be a good fit for Phoenix clients, then stumbled onto this thread.  It's amazing how people seem to gravitate to the same ideas at the same time.   I'm definitely looking forward to your presentations, blog posts, and you opinion on Elm in general!  

-- Nick

 

Rich Morin

unread,
Sep 17, 2015, 7:14:40 PM9/17/15
to elixir-l...@googlegroups.com
Four Elixeros attended last night's Elm Hackathon and pretty much
monopolized Evan Czaplicki's time for the next few hours. I saw a
lot of intense discussion and scribbling on the whiteboard, so I
gather that all sorts of approaches and options were discussed.

Evan is quite interested in getting Elixir, Phoenix, and Elm to play
nicely together. Emphasis on "nicely": Evan wants the API to mesh
cleanly with Elm's best practices, philosophy, etc. (I told him he
reminds me of José. :-)


Here are some of the possible approaches for Phoenix integration:

* a Channels implementation in Elm (eg, using WebSockets)

* a wrapper for the Phoenix "basic" JavaScript code

* falling back on Ajax/HTTP/JSON/REST

Meanwhile, of course, various folks are free to hack up brute force
solutions in order to check out the higher-level integration issues.


I also chatted with Evan about the prospects for using D3 with Elm.
He's not at all sure that there's a clean way to do this, largely
because D3 uses hairy (and non-Functional) JavaScript magic. That
said, he's interested in finding a solution to the problem.

Hmmmmm. Might it be useful to steal some ideas from C2?

C2: Clojure(Script) data visualization

C2 is a Clojure and ClojureScript data visualization library
heavily inspired by Mike Bostock’s Data Driven Documents. C2
lets you declaratively create HTML and SVG markup based on data.

-- https://keminglabs.com/c2


In summary, I think everyone enjoyed and profited from the exercise
and I expect to see trial implementations showing up Real Soon Now.

Alan Gardner

unread,
Sep 18, 2015, 12:48:41 AM9/18/15
to elixir-l...@googlegroups.com
Hi Rick,

That awesome to hear! :)

I got to the end of the basic integration that I was doing on https://github.com/urfolomeus/seat_saver. It’s far from complete but does enough to try an implementation between Phoenix and Elm. I’m going to run through this again now, following my own instructions and shaving off the corners (i.e. I think the AJAX request bit was a mis-step and doesn’t really add to the whole).

Now that I have something though it would be great to get people’s feedback and thoughts. I’ll cross post in the Elm group too. One thing that I do feel is that the way I’m integrating with channels to reserve a seat feels hacky and out of the spirit of Elm. It’s one big side effect basically! Would love to know what the proper Elm way is to do that.

Thanks again for sharing your thoughts and for getting the discussing going IRL :)

Alan



--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/Bz4o4SuMDIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/EAE7BF2A-8472-4FB1-A702-772E3B9BD56F%40cfcl.com.

Alan Gardner

unread,
Sep 18, 2015, 1:23:08 AM9/18/15
to elixir-l...@googlegroups.com
Here’s a link to the cross-post on the Elm Discuss group in case anyone’s interested https://groups.google.com/forum/#!topic/elm-discuss/oVPomWCbjp0

Alan

Mads Flensted-Urech

unread,
Sep 21, 2015, 3:02:24 PM9/21/15
to elixir-l...@googlegroups.com
Thanks for the detailed summary Rick, great to hear that momentum is building around this gap between Phoenix and Elm.

You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/1442553781090.a521436e%40Nodemailer.

Joel Regen

unread,
Nov 9, 2015, 1:20:04 AM11/9/15
to elixir-lang-talk
I'm just getting started with Elixir/Phoenix and am now learning Elm in spare time as well.  I had the same thought:  Using elm as a front-end to Phoenix/Elixir stack with web-sockets possibly.  I had been working with Scala/Play but am becoming deterred by the slowness of the Scala compilations - now that I've seen Elixir and, more importantly, the Erlang VM and OTP, it seems like a huge win.  Elm is also intriguing to me - I come from a lot of GWT and some jquery - both are good for what they do, but GWT is just too complicated and unsupported.  I looked at Angular pretty seriously but now with the 2.0 transition it seems a bit too complicated also.  Elm is a very interesting idea and it is impressive what has been done so far.   so, long winded but, glad to see others interested in the same stack:  elm/elixir/phoenix.

Alan Gardner

unread,
Nov 10, 2015, 12:32:26 PM11/10/15
to elixir-l...@googlegroups.com
Good to hear, Joel! I’m really loving the combination too. :)



--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/Bz4o4SuMDIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.

Alan Gardner

unread,
Nov 10, 2015, 12:34:36 PM11/10/15
to elixir-l...@googlegroups.com
Speaking of which, the first two parts of a tutorial I’ve been working on are now available.


Would love to hear any feedback that folks have. :)

Alan Gardner

unread,
Nov 10, 2015, 12:42:37 PM11/10/15
to elixir-lang-talk
Um that second link should of course have been http://www.cultivatehq.com/posts/phoenix-elm-2. :)
Reply all
Reply to author
Forward
0 new messages