DEV Community

Cover image for I am the author of Elm in Action. Ask Me Anything!

I am the author of Elm in Action. Ask Me Anything!

Richard Feldman on January 19, 2017

I am Richard Feldman, author of Elm in Action and instructor of the Frontend Masters Elm Workshop. The main open-source projects I'm working on rig...
Collapse
 
dubyabrian profile image
W. Brian Gourlie

Languages tend to be designed one of two ways: By committee or by BDFL (benevolent dictator for life). Elm is clearly the latter, and it’s hard to argue against that considering how well Elm has turned out under Evan’s watchful eye.

One unfortunate consequence of this is that there’s quite a few native browser functions that don’t have Elm-equivalent APIs, or there are Elm equivalents that feel incomplete (shameless plug).

There’s this conundrum as an Elm user who’s come to appreciate Evan’s design sensibilities. I find myself frustrated over the tight control of elm-package (in particular, restricting native modules from the community), or long-standing issues without even a comment. On the other hand, I understand why it’s this way; It just doesn’t prevent it from being a source of frustration.

Evan is only one person, and this is beginning to become a popular language with diverse needs. Are there any plans to address this?

Collapse
 
rtfeldman profile image
Richard Feldman

I totally get the frustration, but basically I think this is the least bad option. We've tried various ways to accelerate this, and all the cures have ended up being worse than the symptoms.

That said, Evan moves much faster than TC39, so catching up seems more or less inevitable—just not as quickly as we'd all like. :)

Collapse
 
gothy profile image
Dmitry Utkin

Are there any chances Elm development will become more open? It's easier to get info about future Apple products than to guess what's happening to the Elm language next.

How's Elm Software Foundation doing now? It was publicly announced about a year ago. But it's still not very clear what the purposes are, who's on board and what's the roadmap.

Thank you!

Collapse
 
rtfeldman profile image
Richard Feldman

I think Elm doesn't have a concrete roadmap because Evan adapts his plans based on what he learns from the community. If you ask him "what will you be working on 6 months from now?" the answer will probably be "depends on what happens in the next 6 months." He does post periodic status updates on the elm-dev mailing list, if you're wondering what he's working on and how it's going.

My understanding is that the Elm Software Foundation is primarily for organizing money-related things. The main reason it exists is that Evan is friends with Python creator Guido van Rossum, and Guido recommended that he set up a nonprofit a la Python Software Foundation. It's not really for project management or anything like that.

Collapse
 
gothy profile image
Dmitry Utkin

I think Elm doesn't have a concrete roadmap because Evan adapts his plans based on what he learns from the community. If you ask him "what will you be working on 6 months from now?" the answer will probably be "depends on what happens in the next 6 months."

That's great, but how can we get Evan interested in community feedback that have already been crystalized in "meta" issues on github for the virtual-dom, html, elm-compiler? Like this one github.com/elm-lang/html/issues/53

He does post periodic status updates on the elm-dev mailing list, if you're wondering what he's working on and how it's going.

Actually, there is a status report on elm-dev now. Same day as I've asked this question :)
It was almost two months since the previous one.

Thread Thread
 
rtfeldman profile image
Richard Feldman

how can we get Evan interested in community feedback that have already been crystalized in "meta" issues on github for the virtual-dom, html, elm-compiler?

Another way to phrase this is "how can we get Evan to stop working on what he thinks is the most important thing, and instead to work on what we think is the most important thing?"

Ideally everything would get addressed sooner rather than later, but there isn't time for everything, it's impossible to please everyone, and prioritization is hard.

For example, right now there are a lot of people who literally cannot use Elm because it doesn't have sufficient asset management tools to get acceptable performance on low-end mobile devices.

I don't think Evan is wrong to focus on that right now. :)

Thread Thread
 
gothy profile image
Dmitry Utkin

Another way to phrase this is "how can we get Evan to stop working on what he thinks is the most important thing, and instead to work on what we think is the most important thing?"

No, actually another way to phrase this is "how can we get Evan to start doing frontend stuff in Elm every day".
Your answer on another question about Evan's involvement in NRI day-to-day tasks is practically 0 is the saddest thing I've learned today. I might be wrong, but this is harmful to prioritization.

Thread Thread
 
rtfeldman profile image
Richard Feldman

I think you're underestimating the amount of feedback he gets from all different corners of the community as to what the most important thing is. There are so many people with different priorities who think their particular thing is the most important.

If Evan worked directly on our production code base, he'd probably feel pushed to bump priority for the things that matter most to us, at the expense of all the other voices he hears. As members of this community, that would be a very short-sighted preference for us to have.

Collapse
 
joshhornby profile image
Josh Hornby

Can you explain the structure of the main NoRedInk Elm app? With it being the largest Elm app in the world it, would be really cool to know how it was structured and what you've learned along the way scaling up?

Collapse
 
rtfeldman profile image
Richard Feldman

Sure! I should emphasize that we don't put a big priority on "getting this right." More than anything we try to be consistent (but don't always succeed), and the compiler makes it pretty easy to rename things if we change our minds, so we don't sweat it. (The biggest drawback to renaming is plain old vanilla merge conflicts.) So I wouldn't take any of this as advice so much as a data point if you're curious. :)

We have a series of pages, e.g. "Teacher Dashboard", "Grading", "Splash Page". Each of these has its own main; back when I joined the company we were a non-SPA Rails app, and we have not transitioned to SPA yet. (We have long-term plans to head in that direction, and I don't expect the transition to affect our module structure much - outside of main, of course, but main modules are a small fraction of our total modules.)

We have a top-level module namespace called Nri for things specific to our UI, as opposed to things that we might open-source someday (e.g. the Analytics module, the Emoji module, etc). Here's an example of three related ones:

Nri.QuizHeader.Model
Nri.QuizHeader.Styles
Nri.QuizHeader.View

So our Quiz Header has a model, and a view, and some elm-css styles. (We've been migrating from Sass to elm-css and it's been sweet!) We don't have a Nri.QuizHeader.Update because the quiz header doesn't have any state. I think this is worth emphasizing, because I see people create a model/update/view any time they want to reuse code, and I think that's the wrong way to scale. Unnecessary state management is bloat! We had no need for an update function here, so it was simpler not to have one.

Plenty of times we just have a module to hold view, and plenty of others it's not even a separate module, it's just a plain old function inside an existing module, e.g. viewSidebar : User -> Html msg

We also have reusable views that are used across multiple pages, for example:

Nri.Tabs
Nri.TextInput
Nri.Toggleable
Nri.Tooltip

All of these are stateful, and their APIs looks like github.com/evancz/elm-sortable-table - they do not define their own Msg types, and callers don't have to use Cmd.map. Their states are super simple, and defining their own Msg types would have been overkill - more trouble than it was worth. This is also worth emphasizing; immediately reaching for a custom Msg and Cmd.map any time local state is involved is a surefire way to get needlessly overcomplicated wiring.

My rule of thumb is that reusable views where view returns Html msg instead of Html Msg are nicer by default, and I only reach for a custom Msg once I have enough state transitions that Cmd.map would reduce verbosity substantially.

Finally we have some reusable data structures, which begin with Data., for example:

Data.Assignment
Data.Assignment.Decoder

We debated the right namespace for these and settled on Data because what they have in common is that they're about representing and encoding/decoding some piece of data.

These are a mix of various union types and type aliases that represent common data structures in our app. Some of them have a lot going on, so it's decently common to have a data structure defined in one module, and then the decoder and/or encoder in a separate module. It's no big deal if they live in the same module, though. Again, we don't spend a ton of time on module structure because it's so easy to change reliably if we change our minds.

Hope that helps!

Collapse
 
manysmallapps profile image
ManySmallApps

Very helpful, thanks

Collapse
 
alejandronanez profile image
Alejandro Ñáñez Ortiz

What is the most difficult part about switching 100% to ELM?

Have you thought about going back to JS at some point (at least for an specific project)? I mean, maybe something was really complex/troublesome to build in ELM instead of Js?

Thank you!

Collapse
 
rtfeldman profile image
Richard Feldman

What is the most difficult part about switching 100% to Elm?

Legacy code - there's rarely a good justification to porting really old code that doesn't get used anymore. (So we haven't really done it!)

Have you thought about going back to JS at some point (at least for an specific project)? I mean, maybe something was really complex/troublesome to build in Elm instead of Js?

Only for Node stuff, as Elm is only built for browsers right now.

For browsers, it's the opposite: I don't think I can ever go back. I can't predict the future or anything, but right now I have a really hard time seeing myself applying for a JS job ever again.

Collapse
 
alejandronanez profile image
Alejandro Ñáñez Ortiz

That was super quick!

Thanks Richard and thanks for pushing ELM forward <3

Collapse
 
saucewaffle profile image
SauceWaffle

Where do you draw the line of functionality in your 'let/in' before breaking out into multiple functions to accomplish the same thing?

I find myself commonly having 5 or more variables defined in my 'let' that are staged versions of the first and wonder if that is a bad thing.

Collapse
 
rtfeldman profile image
Richard Feldman

I tend to pull things into the toplevel early and often, but I also tend to use the (|>) operator wherever possible.

That said, I wouldn't call having several declarations in the same let a bad thing per se. So long as you find it readable, it's unlikely to cause problems outside that let, so I wouldn't worry about it. :)

Collapse
 
joeandaverde profile image
Joe Andaverde

Richard,

I use some jQuery plugins, d3, and react in my application. We use a ton of Elm too!

We are having trouble embedding components in our Elm applications. Working with ports is a great abstraction to help us protect the purity of our lovely Elm world. However, many of the projects I embed in my Elm project hook up event listeners to DOM elements. This causes memory leaks because there's no way for the component to know it's being unloaded.

You seem to have some experience with this at NoRedInk - the jQuery Datepicker plugin by XD Soft.

Do you know if there's any intent on providing a mechanism for the modules we embed in our Elm app and interact with through ports to be notified when the DOM is being recreated or going away?

This is our last major hurdle for converting ALL of our frontend code to Elm. If we try to embed our D3 graphics in Elm it would cause MAJOR performance issues. I understand I could write this in Elm but it works great and would be costly to reimplement.

Collapse
 
rtfeldman profile image
Richard Feldman

We haven't run into performance problems around this, but thank you for surfacing it! There was some discussion around whether this was needed, and the consensus was "in theory it would be useful, but in practice, who knows if it's actually necessary?"

Seems like you've found a case where it is! I'd post specifics of your use case on github.com/elm-lang/virtual-dom/is... - ideally with a link to the D3 code in question.

Collapse
 
lydell profile image
Simon Lydell

The blog post for Elm 0.17 mentions: "Generated JS is smaller and works with Google's Closure Compiler"

Do you have any experience/numbers on this? Do you know if Google's Closure Compiler is superior for making Elm's JS small (compared to UglifyJS, for example)?

Collapse
 
eeue56 profile image
Noah

At NRI, this isn't really a concern or issue. We don't use Closure compiler, and we currently don't need to. There's a bunch of posts on the mailing list about this though -> groups.google.com/forum/#!searchin... and groups.google.com/forum/#!searchin...

Collapse
 
rtfeldman profile image
Richard Feldman

Yeah, I don't have any personal experience comparing them. Sorry!

Collapse
 
joshhornby profile image
Josh Hornby

When you first began using Elm at NoRedInk which parts of the system did you begin to port across first? What were the road blocks you encountered to begin with and any advice for other teams who are thinking of slowly moving away from React like environment to Elm?

Collapse
 
rtfeldman profile image
Richard Feldman

We actually started with some business logic in our quiz engine. I wrote a guide for how to do this, but I haven't updated it since Elm 0.16. (This reminds me that I should really get around to that...) I forget where we first used Elm for actual rendering, but it started to snowball pretty quickly after that.

The biggest roadblocks were around build tooling. I didn't do a good job figuring out how production deployments (via Rails - we hadn't started using Webpack at that point) would differ from development builds, and the build tool plugin ecosystem wasn't as far along as it is today. (And it's still got a ways to go.) I guess maybe "roadblock" is too harsh, since we got past it, but even after migrating a bunch of stuff to Webpack we're still dissatisfied with our build process overall—and not just with the Elm parts.

Collapse
 
_joshburgess profile image
Josh Burgess 🤔

Can you describe your experience with Elixir/Erlang/OTP so far? Do you have a rough estimate of the ratio of Ruby to Elixir being used for the backend @ NoRedInk? Do you see the company moving more and more of the backend to Elixir in the future?

Thanks,
-Josh

Collapse
 
rtfeldman profile image
Richard Feldman

Elixir is super new for us, so the back-end is still almost exclusively Ruby.

We have one Elixir service in production right now, and it's not user-facing. We are currently working on our first (small) user-facing Elixir service, and once that's done, we plan to start working on a third (much larger and more mission-critical) user-facing Elixir service. A ballpark timeline for that third one would be getting it into production six months from now.

Our approach is generally to use new technology when we expect a specific benefit, not just because it's enjoyable. (Although it is certainly enjoyable!) So to the extent that we keep finding ways that doing more Elixir will benefit our code base, we'll keep doing more of it, but we're not going out of our way to rewrite Ruby code in Elixir without a tangible benefit in mind.

Collapse
 
onlydole profile image
Taylor Dolezal

What are the next big things in store for Elm that you're excited about, what's it like writing Elm in Action, and what is the best way to start contributing to Elm (ex. Good starting places?)

Collapse
 
rtfeldman profile image
Richard Feldman

What are the next big things in store for Elm that you're excited about?

Asset management - what Evan's working on right now - as well as the next release of elm-test, and the improvements to the debugger Yosuke Torii has been working on.

There are also lots of smaller things I'm excited about, like union types becoming comparable, which is vaguely in the pipeline somewhere, and broader coverage of the Web platform. So much awesome in the works! 😸

What's it like writing Elm in Action?

Time-consuming! It's swallowed just shy of my entire social life.

It's also one of the most rewarding projects I've ever worked on, so no regrets in committing to it. :)

What is the best way to start contributing to Elm (ex. Good starting places?)

Evan curates a list of projects at github.com/elm-lang/projects - but I'd also like to put in a shameless plug for elm-css - the CSS spec is huge, and there are lots of ways to improve our coverage of it!

Collapse
 
pruett profile image
Kevin Pruett

Asset management - what Evan's working on right now

Does this involve a focus on code splitting and/or techniques for lazy loading?

Thread Thread
 
eeue56 profile image
Noah

If you want to read about this, please check out the elm-dev mailing list. It's a google away :)

Thread Thread
 
pruett profile image
Kevin Pruett

Awesome! Didn't know this was publicly discussed 👍

Collapse
 
onlydole profile image
Taylor Dolezal

Thank you for the answers Richard! Looking forward to working more on Elm this year :)

Collapse
 
rtfeldman profile image
Richard Feldman

I haven't asked others on the team, but the only times I can recall seeing any in development, they weren't a surprise - e.g. I was mocking something up with Debug.crash with the goal of "I'll finish implementing this later, but for now I just want it to compile so I can try out the rest of what I've done" and then reaching one of the code paths that called Debug.crash as I was playing around with it.

Of course that's what I expected it to do, and naturally I replace every Debug.crash with a real implementation long before making a pull request!

Collapse
 
eeue56 profile image
Noah

As the ops guy at NRI responsible for Elm, the main source of errors with Elm is actually during builds. From 0.15-0.17, Elm did not correctly handle the caching of artifacts, leading to occasional compile errors that were not reproducable easily. It was simple enough to fix - just wipe the artifacts. But that also slowed the builds down a lot.

I'm also fairly certain I'm the leading expert on runtime exceptions in Elm - it's possible to make them happen, but most of the time you have to really understand Elm to make them happen. Unless you're using Array or Regex, of course. Both of these can lead to runtime exceptions - e.g Regex.regex "[a". However, you'll not likely run into that in production - unless you are taking using input as regex input.. which probably isn't a good idea unless you're escaping things.

Collapse
 
pruett profile image
Kevin Pruett

Any advice for a team looking to incorporate Elm into a large React-based app who relies heavily on server side rendering (SSR) in Node? In a similar vein, do you have thoughts on apps that are SSR'd vs apps that are single page applications?

Collapse
 
rtfeldman profile image
Richard Feldman

See dev.to/rtfeldman/i-am-the-author-o... regarding SSR in Elm.

My thoughts on SSR in general are "don't do extra work unless it's going to solve a problem you have." 😄

Collapse
 
marioruizfont profile image
Mario Ruiz

I just know that the Elm is a programming language but... I'm a frontend dev and I like anything related with the web browser platform... If you can give me an advice related to learn Elm vs MVVM frameworks (Angular, React, others less popular), RxJS why I should give a try?

Collapse
 
rtfeldman profile image
Richard Feldman

The first chapter of Elm in Action is a free download, and I go into this question there.

Hope it helps!

Collapse
 
saucewaffle profile image
SauceWaffle

Since Elm seems to expose everything to the user, do you have a preferred method of keeping sensitive information from being presented? i.e. hiding API Keys

Have accomplished this with having a simple Python API set up parallel to the Elm app to feed Elm objects, but this seems overly complicated.

Collapse
 
rtfeldman profile image
Richard Feldman

Yeah, for API keys I recommend creating something like Secrets.elm and adding that file to .gitignore. Locally, developers have to create that file as part of setting up their systems, and then you have your build process swap in a different file (containing different constants) for production builds.

This way you can easily access the secrets from any module, and if you forget to set them up locally, you'll get a compile error because the module won't be found!

I do this with the Frontend Masters workshop for GitHub API access tokens; you can check out the repo here github.com/rtfeldman/elm-workshop

Collapse
 
rtfeldman profile image
Richard Feldman

EDIT: here's a blog post from one of our junior engineers about her experiences learning Elm in her first week! tech.noredink.com/post/15779255223...

We have new hires doing it in their first week, and that includes devs for whom this is their first job out of a bootcamp (and no prior programming experience before the bootcamp). We've done this several times now - we do lots of pairing when ramping people up, and it usually takes less than a week for someone to get productive enough to make production contributions on their own.

Take that with a grain of salt, though; we're talking "can literally contribute something useful," not "can hammer out features from scratch with no assistance."

I will say that I remember when we taught new hires React from scratch (back in 2014), and the learning curve for Elm today feels comparable to React + Flux + an immutability library back then. Yes it's a whole different language, but it's a simpler setup overall, and the compiler helps a TON. (That said, obviously in 2017 more new hires know React on day one, and the corpus of learning resources for React is much larger than it is for Elm.)

Collapse
 
borisrozinov profile image
Boris Rozinov

is it anti pattern to use Message like: UpdateModel (Model -> Model). When handling of the message is just to update model with function passed as parameter like:
case msg of
UpdateModel f -> (f model, Cmd.none)

.....

Collapse
 
rtfeldman profile image
Richard Feldman

That seems overcomplicated, yeah. I wouldn't do that. :)

Collapse
 
matthewoden profile image
Matthew Potter

What is your biggest pain point when writing Elm?

Collapse
 
rtfeldman profile image
Richard Feldman

The pain point that leaps immediately into my mind is build tools. I'm not gonna sugarcoat it: Webpack has been slow and crashy and I can't wait for us to stop using it.

However, I'm assuming you meant "pain point specifically with Elm the language." For me it's definitely that union types are not comparable yet. I really want to be able to use them as keys in a Dict for things like form validation. Unfortunately this is a ways off because the implementation requires modifying how Elm generates JS code to include a bit more information at runtime.

My #2 pain point is how much of the Web platform still requires interop to access. For example, if I could use an Elm library with a nice API that let me work with IndexedDB, I'd probably be up until 2am upgrading Dreamwriter.

Oh, and there's that value doesn't Just Work the way it does in React. This is kind of inside baseball, but it can Just Work in React because setState updates synchronously, whereas Elm does requestAnimationFrame batching to improve performance. The alternative of defaultValue works fine for most use cases, but when it doesn't it's a big pain. I can conceive of a way to make value Just Work, but it would be a pretty invasive change for elm-lang/virtual-dom.

Collapse
 
pruett profile image
Kevin Pruett

Hm, interested in hearing more about the issue with value and how it's affected with requestAnimationFrame batching. Is that to say if a text field isn't "bound" to the model with key presses, relying on the DOM to keep state, there will be inconsistencies?

Thread Thread
 
rtfeldman profile image
Richard Feldman

Right - if you use defaultValue to let the DOM's version of reality "take precedence" and use onInput to listen for changes, it's all good.

Unless you actually need to manually override that value! Then it's a pain. 🙂

Collapse
 
eeue56 profile image
Noah

To expand on the Webpack issues:

  • Webpack is very memory intensive
  • If there are multiple entry points (i.e lots of bundles) then Elm is not very good at parallelizing shared asset control.
  • Elm-make is slow, and if the dependency tree triggers an expensive change, then it's important to realise that Elm causes a slow re-compile - but webpack is responsible for filling up memory, and therefore slowing everything down
  • Webpack can segfault (and does if you aren't careful)

I worked on this a bit to help fix it:

Collapse
 
pgiesin profile image
Peter Giesin

Hi Richard!

I have used the Real World Elm demo as the basis of a project I am working on. So far it is working out really well, and I am happy with the structure and flow of the code.

The one area where I am struggling is providing application authentication. The demo provides authentication between the front-end and back-end, however, I need to protect enforce authentication at the front-end elm level.

How would you recommend handling this? Do you have demo code available that provides this type of authentication and routing?

Thanks,
Peter

Collapse
 
liamcurry profile image
Liam Curry

Are there plans to move away from Javascript for Native code? If so, could you speculate on what Elm would look like post-JS?

Thanks!

Collapse
 
rtfeldman profile image
Richard Feldman

What Noah said. 😄

Collapse
 
eeue56 profile image
Noah

There is definitely no solid plans for that. WebAssembly gets brought up and that might be a good idea one day but right now it's definitely not.

Collapse
 
brianhicks profile image
Brian Hicks

What's your favorite whiskey?

(hey, it's an ask me anything!)

Collapse
 
rtfeldman profile image
Richard Feldman

Laphroaig Lore!

laphroaig.com/lore

Collapse
 
cmarfia profile image
Chris Marfia

Recommend you try Octomore if you have not had it before.

bruichladdich.com/octomore

Collapse
 
saucewaffle profile image
SauceWaffle

Is there a board somewhere that Evan is posting packages he would like to see in Elm that he just can't get to. It would be great to contribute to the development of the environment.

Collapse
 
rtfeldman profile image
Richard Feldman

There totally is! github.com/elm-lang/projects

Collapse
 
cmarfia profile image
Chris Marfia

How many companies are you aware of that use Elm in production?

Collapse
 
rtfeldman profile image
Richard Feldman

I actually have no idea. I know the ones at the bottom of elm-lang.org do, but I keep hearing about new ones and being like "wait, you do?" and then forgetting their names. 😅

Collapse
 
cmarfia profile image
Chris Marfia

We should add more companies to that list :).

Collapse
 
rofrol profile image
Roman Frołow

What do you think about such approach to structuring application with Return.Optics toast.al/posts/2016-10-20-optical-...

Collapse
 
rtfeldman profile image
Richard Feldman

One of my favorite programming sayings is "I've learned there are worse things than boilerplate."

Over the years I've found that most things promising to "reduce boilerplate" do so in ways that make maintenance and debugging harder. I think back with regret on the times I decided to accept that tradeoff, and I think this falls under that category. I wouldn't recommend it. :)

Collapse
 
sebastiansebald profile image
Sebastian Sebald

Where do you see the pros + cons of TEA? Especially, compared to Redux (used in combination with immutables).

Collapse
 
rtfeldman profile image
Richard Feldman

I got into React very early after Facebook open-sourced it, but I switched to Elm before Redux came out...so I've never actually used Redux. :)

I think the following is the most honest way for me to answer the question of pros + cons:

The Elm Architecture in Elm

It's the only game in town. If you want to build UIs in Elm, the Elm Architecture is the only way to do so.

Pros: the entire ecosystem is optimized around it; no fragmentation
Cons: it's not well suited to doing major manual DOM manipulation

The Elm Architecture in JS

I've never tried this. JS is a totally different language, and I don't think it would be useful for me to guess what it might theoretically feel like to use Elm Architecture in JS. A better person to ask would be someone who's tried precisely this, and especially someone who's also tried Redux. :)

If the subtext here is "can I get many of Elm's benefits by using the Elm Architecture in JS?" the answer is unfortunately "not even remotely close." In my opinion almost all of Elm's benefits come from its compiler and library ecosystem, and you can't access either from JS.

Collapse
 
sebastiansebald profile image
Sebastian Sebald

Thanks you very much for your answer. No, I do not want to use the Elm Architecture in JS :)

To be more precise, I was wondering how the "update" function scales in the Elm Architecture, since I do not believe that Elm developers are using one big case statement for all possible messages. I think this is solved very well in Redux by composing reducers. I really dig the way all those small (pure) functions handle part of the application state. All the Elm example I saw didn't had that many messages, but I guess if your app grows you will also use some sort of composition to break the updates in smaller parts.

Thread Thread
 
rtfeldman profile image
Richard Feldman

Ah! I posted my thoughts on this over on /r/elm - hope that's useful!

Collapse
 
wintvelt profile image
wintvelt

How are you dealing with mobile device support at RedInk? And specifically touch?
Ps Thank you for taking the time to do this AMA!

Collapse
 
rtfeldman profile image
Richard Feldman

About 25% of our users are on tablets, so we always have to keep touch in mind. When possible we've used pointer events (with polyfill) to keep things consistent, but that hasn't always been realistic for some drag-and-drop stuff. We haven't used any touch-related subscriptions yet.

It's still WIP, but you can see some non-polyfilled touch stuff we're doing in github.com/NoRedInk/drag-and-drop - which is already open source, but very unpolished at this point. For example, there's still more JS interop in there than there needs to be. 😄

Collapse
 
lukewestby profile image
Luke Westby

Does NRI do A/B testing in its Elm apps?

Collapse
 
rtfeldman profile image
Richard Feldman

We actually don't do any kind of A/B testing, so definitely no. ;)

Collapse
 
lukewestby profile image
Luke Westby

I may have asked you this before but I couldn't remember what the answer was. I have to start doing this soon and was hoping there was some secret magic formula to doing a good job with it 😄

Thanks!

Thread Thread
 
eeue56 profile image
Noah

We actually do do some A/B type stuff - but it isn't testing as such. We have A/B features for dealing with performance related issues or reliability issues. This is done mostly via backend land - the Elm code is still the same Elm code, it just may get the data in a slightly different way

Collapse
 
filib profile image
Philip Cunningham

When will Elm be mainstream?

Collapse
 
rtfeldman profile image
Richard Feldman

February 25, 2018, at 7:42am UTC! ;)

Collapse
 
joshhornby profile image
Josh Hornby

Does Evan work on NoRedInk work as well a building Elm or solely on Elm?

Collapse
 
rtfeldman profile image
Richard Feldman

He only works on Elm. He's worked here for over a year and he's never touched our product repo. :)

Collapse
 
joshhornby profile image
Josh Hornby

What's your favourite and worst part about Elm?

Collapse
 
rtfeldman profile image
Richard Feldman

Favorite part (I'm gonna go with the American spelling, sorry!) is the feeling of invincibility when refactoring. I get some exciting idea for how to make my code cleaner, and I just do it. I don't worry about regressions, and lo and behold, when it all compiles again it still works! That feeling never seems to get old.

Worst part? Being smack dab in the middle of two communities that are almost polar opposites. Many people coming to Elm from JavaScript want Elm to be more like JavaScript, and many people coming from Haskell want Elm to be more like Haskell. I see Elm as its own thing—neither "JavaScript enhanced" nor "Haskell simplified"—and I've sometimes struggled to engage constructively with groups who don't see it the same way.

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
marioruizfont profile image
Mario Ruiz

congrats for the book! God bless you and guide You!

Collapse
 
rtfeldman profile image
Richard Feldman

Thank you! So nice of you to say! ❤️

Collapse
 
astamatto profile image
Alessandro Stamatto

When will Elm support Node (or be usable in the backend)? In the backend, what has the best affinity with Elm right now?

Collapse
 
alexeyzimarev profile image
Alexey Zimarev

When do you plan to finish the book (I am surprised no one asked yet, or have I missed it?)

Collapse
 
lukewestby profile image
Luke Westby

What's the most unusual thing you've ever seen Elm used to do?

Collapse
 
rtfeldman profile image
Richard Feldman

Pretty sure I saw someone (and I think it was you, but I could be misremembering) write Elm code to control a synthesizer!

Collapse
 
brianhicks profile image
Brian Hicks

What would you recommend to someone who had gone through the Elm guide (guide.elm-lang.org/) and wanted to see how a "real world" app worked? Any open source project recommendations?

Collapse
 
rtfeldman profile image
Richard Feldman

EDIT: here ya go!

dev.to/rtfeldman/tour-of-an-open-s...

...Previously I had said this:

People ask this a lot, and unfortunately I still don't have a go-to project I can point to.

Right now it kind of feels like "serious Elm project" / "used in production" / "open source", pick two.

Collapse
 
joshhornby profile image
Josh Hornby

This might be a little doom and gloom, but as NRI is the largest Elm house and pretty much funds Elm (via employing Evan) if NRI was to go to longer exist what would that mean for Elm?

Collapse
 
rtfeldman profile image
Richard Feldman

Evan would lose a valuable feedback loop, but the language would be fine. Suffice it to say, he's thought about this, and has plans for how he could keep focusing on Elm even without a patron employer like NoRedInk (or Prezi before us).

Collapse
 
ryhorpamidor profile image
ryhorpamidor

Hi, Richard!

What in your opinion are most fundamental problems that modern front-end community is trying to solve right now?

Is Elm involved into this problem solving?

Thank you!

Collapse
 
joshhornby profile image
Josh Hornby

Where do you see the future of Elm and can you envision Elm becoming more mainstream? If so how do you feel the community can help make this happen?

Collapse
 
rtfeldman profile image
Richard Feldman

Where do you see the future of Elm?

Someday I see it being an awesome back-end language too, but that's quite a ways off I think. With respect to the browser, I see the future of Elm being one where Elm's ecosystem becomes one of its biggest selling points.

Right now Elm's ecosystem is much smaller than JavaScript's, so ecosystem is a drawback overall. However, the overall quality of the Elm ecosystem is much higher - in terms of usability and reliability - than the (much larger!) JS ecosystem. I think this quality-over-size trend is likely to continue, because Elm's package manager has a blanket policy of accepting only Elm code, not JavaScript code.

As the gaps in the ecosystem fill in over time, I see the high-quality Elm ecosystem becoming a big selling point. Today people say "Elm's ecosystem is so small, you inevitably have to do some JS interop" but I think in the future people will say "Elm's ecosystem is big enough to meet all the needs of a typical web app, and it is so much nicer than the JS ecosystem."
We're not there yet, but we're headed in that direction. It will take time, but I think it'll absolutely be worth it. :)

Can you envision Elm becoming more mainstream?

Definitely. For any language aimed at industry use, I think success stories among industry early adopters are likely to predict long-term adoption. A very high percentage of Elm's early adopter stories are on the extreme end of positive.

I think the direction JS is moving is helping Elm out a lot. Virtual DOM libraries, type-checking, and functional programming concepts are all becoming more mainstream in JS, each of which narrows the familiarity gap between what people are using on JS teams and what they could be using if they introduced Elm.

How do you feel the community can help make this happen?

Posting experience reports. These are the biggest ways to help things become more mainstream, because people look for data points when making decisions about whether to dive into a language.

"I am thinking about trying Elm. Who else has done that? How did it go? Would the benefits help our team too? Did the costs seem like costs we can accept?" The more data points out there, the more easily people can make informed decisions about these things.

Our story at NoRedInk is out there, but do people know your story? If not, help them out by writing about it!

Collapse
 
maushook profile image
Muhammath Maushook

I like to learn Elm, what are the basics things I need to know to get the good grip of the language?

Collapse
 
berkus profile image
Berkus Decker

Love Elm, keep up the great work folks!

Collapse
 
ben profile image
Ben Halpern

What word is best used to refer to Elm developers and why is it Elmos?

Collapse
 
rtfeldman profile image
Richard Feldman

I like Evan's preferred term: "Elm programmers"

I heard a great point once, which is that calling ourselves "Elmists" or "Elmers" or "Elmos" kind of suggests that we're a tribe, that we treat the language as more than a tool we use for a particular job.

But at the end of the day, that's what it is: a tool we use for a particular job! We should choose Elm when we think it's a good fit, and choose other tools when they're a better fit - not because we're part of a tribe. :)

Collapse
 
ben profile image
Ben Halpern

Collapse
 
joshhornby profile image
Josh Hornby

What does a typical working day look like for Richard Feldman?

Collapse
 
rtfeldman profile image
Richard Feldman

I recently became Director of Engineering, so now it's a lot more meetings than it was a month ago! (That does give me a broader perspective on our team, though, which is cool.) Prior to that I was doing a lot of pair programming; we encourage it, and I ❤️ the people I work with! There's also the usual mix of non-programming stuff - reviewing each others' pull requests, interviewing, etc.

One of the things I've been working on lately is pair programming to help port some of our old React code (which I wrote back in the day) to Elm, since I'm a silo on a lot of the domain knowledge on our pre-Elm UI code.

Collapse
 
brianhicks profile image
Brian Hicks

Has writing Elm in Action changed the way you write Elm in your day-to-day coding?

Collapse
 
rtfeldman profile image
Richard Feldman

I'd say the main way it's impacted my Elm coding is prioritization on my side projects.

Specifically, I'm like "ooh, it would be so awesome if ______ feature of elm-test were shipped before I get to the Testing chapter, so I can write about it!" That's happened with elm-test more than any other project, and I'm really pumped about its next release. :D

Collapse
 
djm_ profile image
Darian Moody

How do you see Elm's server side rendering story existing in the future? A worthwhile cause or a relic of times gone by? Thanks!

Collapse
 
rtfeldman profile image
Richard Feldman

Evan has already done a chunk of work on it. I don't know exactly when it'll be out, but I'd be surprised if it weren't sometime in 2017.

In the meantime, take a look at github.com/eeue56/elm-server-side-...

Collapse
 
sebastiansebald profile image
Sebastian Sebald

What where the issues you had at NoRedInk with your previous (React) stack that made you switch to Elm?

Collapse
 
rtfeldman profile image
Richard Feldman

This was the subject of my ReactiveConf 2016 talk, so I'll defer to that! :)

Collapse
 
borisrozinov profile image
Boris Rozinov

What is your favorite editor / IDE for Elm development?

Collapse
 
rtfeldman profile image
Richard Feldman

I like Atom because its Elm plugin support is fantastic, and its Vim plugin support is among the best you can get outside Vim itself.

In particular the Elm-related plugins I use with Atom are:

  • linter-elm-make
  • language-elm
  • elm-format
  • elmjutsu
Collapse
 
joshhornby profile image
Josh Hornby

Can you think of an example where using Elm has made building something at NRI harder than if you used used insert JS framework here?

Collapse
 
rtfeldman profile image
Richard Feldman

I really don't want to give this answer, but: no, I can't.

The key there is JS framework. There are things that JavaScript makes easier than Elm (e.g. when we want manual DOM manipulation instead of going through a Virtual DOM system), but in those cases we just use JS interop - getting a JS framework involved would be way overkill for those use cases.

And for everything else, a JS framework would just be a huge downgrade. I can't think of a single thing we've built where a JS framework would be a better experience. Any of them.

Collapse
 
joshhornby profile image
Josh Hornby

Any plans for more talks in 2017?

Collapse
 
rtfeldman profile image
Richard Feldman

Yep! My current plans for 2017:

  • QCon London in March
  • Devoxx San Jose in March
  • GOTO Chicago in May
  • Elm Europe in June
  • elm-conf in September
  • ReactiveConf in October
Collapse
 
rofrol profile image
Roman Frołow

What do you think about dgriffith/style-elements package.elm-lang.org/packages/mdgr...

Collapse
 
rtfeldman profile image
Richard Feldman

I haven't tried it, but I love the idea!

Collapse
 
lukewestby profile image
Luke Westby

What's your favorite guitar solo of all time?

Collapse
 
rtfeldman profile image
Richard Feldman

It's an unorthodox choice for a metalhead, but I'm gonna go with Brian May's solo near the end of Bohemian Rhapsody. I can't not air guitar to that.

I think it's an underrated solo for the usual reason Brian May's stuff is underrated (Freddie Mercury's singing), but that's no fault of his. That solo ROCKS. 🤘

Collapse
 
vikkio88 profile image
Vincenzo

what is the meaning of life?

Collapse
 
jfmengels profile image
Jeroen Engels

Do you use Debug functions like Debug.log in production? Thanks :)

Collapse
 
rtfeldman profile image
Richard Feldman

Not on purpose. Wouldn't be surprised if a Debug.log slipped through at some point though. 😅

Collapse
 
linestara profile image
Linestara • Edited

elm‐in‐action.com/folders/list

This link from your book doesnt work anymore. Chapter 7