9 ms·
Integrating Elm and Phoenix Channels via Elm-Phoenix-socket
- brightball 10y agoElm and Phoenix really seem like a perfect match for each other
- kcorbitt 10y agoThey're both very functional, but it's an interesting matchup given that Elm is very strongly typed and (according to my understanding) Elixir is totally dynamic. For those who are developing with both, I'd be interested in hearing if there's a reason why types would be more useful on the client than the server or whether there's another motivation for those particular choices.
- knewter 10y agoI'm glad to dive in. On the client, fault tolerance is basically not a concern of mine. On the server, it's the most important concern. I find it more useful to think of Elixir as a highly concurrent language built for fault tolerance, where Functional Programming was a necessary requirement to get there. Jose has a great post on this here: http://blog.plataformatec.com.br/2016/05/beyond-functional-programming-with-elixir-and-erlang/ http://blog.plataformatec.com.br/2016/05/beyond-functional-p...
- skybrian 10y agoBrowsers have fault tolerance built in: the reload button.
- knewter 10y agoIf you want some more fun, you should check out this: http://package.elm-lang.org/packages/elm-lang/core/4.0.1/Process http://package.elm-lang.org/packages/elm-lang/core/4.0.1/Pro... (see the last paragraphs). I am hopeful that we will see an Elm backend running on the BEAM eventually.
- im_down_w_otp 10y agoLook at Dialyzer and http://elixir-lang.org/getting-started/typespecs-and-behaviours.html#types-and-specs http://elixir-lang.org/getting-started/typespecs-and-behavio... Also, Elixir community... there seems to be a paucity of awareness of Dialyzer and Typespecs. Perhaps they could be more prominent? They're included in the reference docs, but not really so much in a way that indicates what they are or how one would use them when writing their own software in Elixir. There are many, many classes of problems that can be discovered before they're discovered at runtime. It's made a little harder in Elixir-land due to limited Map support in Dialyzer and Map usage being extremely common in Elixir code, but still spec'ing your functions is a good practice and habit to get into anyway.
- knewter 10y agoThe latest Erlang release fixed the Map problem with Dialyzer. It was entirely the reason I was lax with specs. I'd love to get a workflow more like this one: https://medium.com/@barruumrex/seeking-simple-satisfaction-2a098902ddff https://medium.com/@barruumrex/seeking-simple-satisfaction-2...
- im_down_w_otp 10y agoFor the uninitiated... Erlang 19's included Dialyzer improves the scenario of type-checking maps in useful ways. Namely that now you can represent an empty map, an arbitrary map of any type, and a partially arbitrary map which must include certain key type and value type associations but is not limited to those. Which leaves out one representation which is a map which includes and only includes a specific set of key type and value type associations. Erlang 18's Dialyzer has basically just #{} =:= map() which is equivalent to the union of #{none() => none()} and #{any() => any()}, so it was basically a giant escape hatch in the type-checking system, and thus not particularly valuable. Looking forward to a pending change in laxness as a result of the coming changes in 19. :-)
- corysama 10y agoI think the static/dynamic client/server split is more coincidence than brilliance. Elm and Elixir are like two neighborhood kids growing up together as best buddies. They are both new, functional, webby languages with communities that are very friendly and very interested in inventing new ways to make programming better. It's natural that both groups would be excited about working together.
- MrBlue 10y agoElixir, Phoenix and Elm have absolutely rekindled my love of web application development.
- dmix 10y agoPureScript + learning Erlang/Hakskell rekindled mine :) I ended up learning Erlang after hearing about Elixir and not being a fan of the Rubyish syntax and immutability comporomise, which has been a very rewarding experience. Haskell even more so. And Purescript has some nice Elm inspired libraries [2]. [1] https://purescript.org https://purescript.org [2] https://github.com/search?utf8=%E2%9C%93&q=language%3Apurescript+elm&type=Repositories&ref=searchresults https://github.com/search?utf8=%E2%9C%93&q=language%3Apuresc...
- knewter 10y agopedant mode on... there is no "immutability compromise" in Elixir. Static Single Assignment != Immutability. Elixir is entirely immutable - it has to be as it just runs on the Erlang VM! I think a legitimate complaint along these lines would be "pinning is confusing and error prone for beginners" and I think it's fair. Christopher Meiklejohn mentioned this on Twitter yesterday, and it's a point that's caught me plenty and I write more Elixir code than most people by far.
- rdtsc 10y ago> Elixir is entirely immutable - it has to be as it just runs on the Erlang VM! No, variables are mutable in Elixir. Interactive Elixir (1.1.0-dev) iex(1)> x=1 1 iex(2)> x=2 2 Notice how x is 1 then x is 2. Variable x mutated. In Erlang: 1> X=1. 1 2> X=2. ** exception error: no match of right hand side value 2 Variables are immutable in Erlang. I suspect you misunderstood gp's post and thought they were talking about data, which is immutable in both languages in general.
- knewter 10y agoI did not misunderstand. You're calling renaming something mutation. It isn't. You're referring to static single assignment. This has been covered before in more detail than I care to go into.
- bfrog 10y agoThis is a great little webstack!
- onlydole 10y agoI absolutely love dailydrip.com too on top of Elixir and Elm...those languages paired with such a great learning source is simply phenomenal.
- knewter 10y agoJosh from DailyDrip here. My first realization that this was here was that we started getting a ton of traffic. :) We just ran the first Remote Elm Meetup today so my attention was elsewhere: https://www.bigmarker.com/remote-meetup/1-Elm-Remote-Meetup-by-DailiDrip https://www.bigmarker.com/remote-meetup/1-Elm-Remote-Meetup-... (yes, I know our company name is misspelled in the url :-\ ) I'd love to chat with anyone that wants to know what we're doing and why we do it :)
- brightball 10y agoI'd never heard of your site before but after looking at your video library I'm about to be a customer. Great, great work.
- knewter 10y agoObviously thrilled, thanks. All we want to do is keep making awesome content, and every customer helps us on that path. Let me know if you have any issues, ok? Obviously I've tested the crap out of it, and we have a decent number of customers, but this is our biggest traffic day by 4x already.
- mgalka 10y agoI'm impressed by the Hacker News crowd. Pretty cool to see a topic as esoteric (and awesome) as Phoenix / Elm hit the top spot. Very good post!
- qaq 10y agoI does look like Elixir/Phoenix is growing fast enough that it will not be considered esoteric in fairly near future.
- perfq 10y agoWe love this stack, and dailydrip and elixirsips have helped us get a lot of the knowledge we have. Josh does an awesome job at explaining the technology in a step by step fashion that is both concise and easy to understand.
- ModernMech 10y agoHow come no one (seemingly) uses Elm, despite all the love? I've noticed a lot of quick, drive-by posts in Elm related threads about how great the language is. This thread ("This is a great little webstack!") and today's other front-page elm thread[1] both do this. With such high praise, I would expect the language to be more popular. What's with the disconnect? My hypotheses: 1) There are no unhappy users because unhappy users just don't use it. 2) HN goes easy on technological curiosities, saving harsh criticism for large projects that deserve it 3) While there may be a widespread lovefest for Elm, there is too much momentum behind current technologies. Any other thoughts as to what the disconnect is? Moreover, how do we get to a world where the webstack we all use is "a great little webstack"? [0] https://news.ycombinator.com/item?id=11846707 https://news.ycombinator.com/item?id=11846707 edit: clarity
- hackerboos 10y agoI've heard that interpolation with existing JS libs is painful.
- knewter 10y agoThis is because in Elm a runtime error is a compiler bug. If you want no runtime errors, interoperating blindly with JavaScript is a great way to fail :-\ Another great thing about the community is a goal of a single great library for every use case, rather than a lot of half-baked competing libraries. So expect there to be a single great modal library. Etc.
- oomkiller 10y agoThat last part sounds pretty cool, how is this sort of thing being encouraged?
- shados 10y agoI'm no Elm expert, but as far as I understand, the "native library" APIs, the kind that are used to actually wrap browser APIs and interface with javascript in a way that can be published and made reusable, is "private". I mean, you can look at the source and make your own, but you're playing in undocumented, unstable territory. The only "official" interop channel is the "port" system, which only lets you do a publisher/subscriber type thing with your application at runtime, and cannot be used in a library. So you basically cannot make a "blessed" library that uses native browser APIs.
- fbonetti 10y agoAuthor of elm-phoenix-socket[1] here. I'm happy to answer any questions about the library, Elm, or whatever. [1] https://github.com/fbonetti/elm-phoenix-socket https://github.com/fbonetti/elm-phoenix-socket
- jergason 10y agoWhat makes Elm + Phoenix so good together? I use Elm professionally and love it, but a back end is a back end. Is the love just "I really like Phoenix?" The way people talk about it makes it sound like it is uniquely suited to Elm, which I don't understand.
- griffinmichl 10y agoOut of curiosity, where do you work? And are you hiring? Haha. I only know if ~5 companies currently using Elm