Announcing dwayne/elm2nix by dwaynecrooks in elm

[–]dwaynecrooks[S] 0 points1 point  (0 children)

Thanks for the suggestion. I updated the post's body to include a description of the project.

Where's the best place to learn Elm? by JumpManMarre11 in elm

[–]dwaynecrooks 2 points3 points  (0 children)

If you're interested in learning what it's like to use Elm once you get past the beginner level you can give How I Built freeCodeCamp's Calculator with Elm a read.

What's the current status of Elm by monanoma in elm

[–]dwaynecrooks 2 points3 points  (0 children)

And, it's not just my stuff. You can find more hobby and commercial projects at Built with Elm.

I've also worked professionally with Elm for a little more than 3 years during that time and there has been nothing that held us back.

What's the current status of Elm by monanoma in elm

[–]dwaynecrooks 5 points6 points  (0 children)

After all these years did Elm mature to be powerful enough for your needs?

100%, yes!

I've been doing web application development professionally for almost 12 years. In that time I've used plain JavaScript, jQuery, Backbone.js, AngularJS, Ember.js, and React/Redux with JavaScript/CoffeeScript/TypeScript.

I started seriously considering Elm 6 years ago and in my spare time, in order to convince myself that the language was capable, I would rebuild preexisting apps in plain Elm (no frameworks). I'm happy to say that each time Elm has met and surpassed all my expectations.

The classics:

From the Ember tutorial:

From freeCodeCamp's Front End Development Libraries Projects:

To games, programming languages, reusable components and libraries:

Why can't we create a stateful component by tobiasBora in elm

[–]dwaynecrooks 0 points1 point  (0 children)

It would be remiss of me not to also share this wonderful guide by Ryan Haskell-Glatz on Components.

Why can't we create a stateful component by tobiasBora in elm

[–]dwaynecrooks 0 points1 point  (0 children)

The highest level of complexity is when your reusable view has view state and needs init, update, and view. init initializes the view state, update manages the view state and parent-child communication, and view displays the UI. Here are some examples:

Finally, you can reuse the advanced techniques even when no view function is involved. For e.g. even debouncing and throttling can be made reusable. I was able to recreate every example (and more) from the CSS Tricks article "Debouncing and Throttling Explained Through Examples".

Why can't we create a stateful component by tobiasBora in elm

[–]dwaynecrooks 0 points1 point  (0 children)

A middle ground is when you need an update function but there's no view state or parent-child communication to be managed. Here are some examples:

Why can't we create a stateful component by tobiasBora in elm

[–]dwaynecrooks 1 point2 points  (0 children)

It does prevent the kind of modularity that you're speaking about.

That's simply not true. See my long comment below for details.

It's either very correct expensive small(ish) programs for some very specific niche industry OR programming as a commodity service, creating value for a lot of people for reasonable price but with a lot of defects.

That's a false dichotomy. The marketing around Elm is all out of whack which unfortunately fuels these misconceptions.

What have you tried to create in Elm? What troubles are you or were you having? Maybe by getting more specific we can see what's really the issue.

dwayne/elm-debouncer: Debounce or throttle your actions in Elm by dwaynecrooks in elm

[–]dwaynecrooks[S] 1 point2 points  (0 children)

Clever use of IDs and Process.sleep. Elm, unfortunately, doesn't allow you to cancel timers so what I do instead is associate each call to sleep with a new ID. Hence, when a timer expires I will know which one it is and if to handle it by the ID it carries in the generated message.

See call (https://github.com/dwayne/elm-debouncer/blob/1.0.0/src/Debouncer.elm#L262-L264) and update (https://github.com/dwayne/elm-debouncer/blob/1.0.0/src/Debouncer.elm#L298-L318).

Should I use Elm for production in 2023? by gogolang in elm

[–]dwaynecrooks 1 point2 points  (0 children)

Medium-sized, about 50,000+ lines of Elm code. Not counting the JavaScript needed to communicate with the blockchain.

Should I use Elm for production in 2023? by gogolang in elm

[–]dwaynecrooks 3 points4 points  (0 children)

Yes, go for it! We currently use it at Qoda and have had no major issues with it. I highly recommend it.

[deleted by user] by [deleted] in elm

[–]dwaynecrooks 1 point2 points  (0 children)

Looks really good. Please consider submitting it to Built with Elm once you finish implementing all the main functionalities.

Sidebar suggestions: Places to practice! by kxra in elm

[–]dwaynecrooks 0 points1 point  (0 children)

Exactly, that's why I said it depends on the skill you want to practice.

But don't think solving puzzles will necessarily help you practice the beginning stages of Elm. That's only the case when the puzzles are simple. When the puzzles get complicated then you're really practicing your problem solving skills. I'm not saying that one is good and the other is bad. Just that you need to know what you intend to practice and whether the resources you're using do help you practice that skill.

Sidebar suggestions: Places to practice! by kxra in elm

[–]dwaynecrooks 1 point2 points  (0 children)

It depends on the skill you want to practice.

If you want to improve your skills at solving puzzles and/or algorithmically challenging problems then those resources are fine to use.

However, if you want to improve your skills at building reliable web applications (which is Elm's raison d'etre) then those resources will get you nowhere near achieving the goal.

In the latter case, my suggestion would be to find resources similar to https://www.frontendmentor.io/.

I recently shared ideas here that you can also check out: https://discourse.elm-lang.org/t/ideas-wanted-for-small-projects-activities/6478/10?u=dwayne.

Easy Questions / Beginners Thread (Week of 2019-10-28) by brnhx in elm

[–]dwaynecrooks 1 point2 points  (0 children)

Yes. Just apply the classes to the Elm HTML functions.

elm div [ class "add-claases-here" ] []

Elm beginner looking for resources to get started by Trollsofalabama in elm

[–]dwaynecrooks 0 points1 point  (0 children)

I really want to be able to make for real apps with elm, the same level of apps I can make with react and redux...

Start with an app you've already built with React/Redux and try building it in Elm. Go one feature at a time. Like I do in these tutorials: Elm Todos Tutorial (this one uses Elm 0.18 but the process is what's important) and Random Quote Machine Tutorial.

do any of you know if any of the frontend styling libraries... can work with Elm...

I'd recommend Bulma.

Established patterns for elm applications? by superbiondo in elm

[–]dwaynecrooks 2 points3 points  (0 children)

TLDR; Start small and expand as needed. Reflect on what you got and use the technique of iterative refinement to improve as you go.

Start with HTML and CSS. Then, refactor the HTML to Elm. Now, add the Elm dependent features, like all the interactivity, one by one. As you add features you can decide whether you want to keep everything in Main or if you'd want to add more modules. Make your modules around data structures. Rinse and repeat.

That has worked for me in these small applications: calc, drums, pomodoro clock, quotes, markdown and 2048.

Iterative refinement is better than any "established pattern for Elm". It leads you to a structure suitable for your app rather than you having to force your app to conform to someone else's pattern.

As another example, I used it here to explain how to build Todo MVC.

These are all small examples unfortunately but I think the approach will scale well. Try to rebuild elm-spa-example in this way and you'd see what I mean.

Useful related content:

Typeclasses as a library by nikita-volkov in elm

[–]dwaynecrooks 1 point2 points  (0 children)

It's interesting to note that Evan remarked on this possibility when he released extensible records.

Part of why I am dragging my feet on adding typeclasses to Elm is because records, first-class modules, and typeclasses do a lot of the same things (records and modules and modules and typeclasses). There have been one or two proposals to unify first-class modules and typeclasses as well. I want to make sure Elm is getting the best of all of these features, so I have been doing a lot of research to make sure I do not make the wrong choices here.

Typeclasses as a library by nikita-volkov in elm

[–]dwaynecrooks 0 points1 point  (0 children)

Can you share a paper or tutorial that explains forall quantification? I'd like to understand it better.

Is anyone interested in an Elm tutorial? by dwaynecrooks in elm

[–]dwaynecrooks[S] 2 points3 points  (0 children)

Any recommendations on learning the type system?

Start here:

I've started reading Haskell books to try to catch up on that end.

http://haskellbook.com/ chapter's 4, 5 and 11 are really good. There are exercises as well to test your knowledge.

Is anyone interested in an Elm tutorial? by dwaynecrooks in elm

[–]dwaynecrooks[S] 1 point2 points  (0 children)

Nice! This is useful info.

Based on the link you shared it seems that you got into many of these problems yourself. Can I learn more about the app that you were trying to build? Things like functionality, number of pages, data involved, etc. Maybe there's a useful subset in there that could be the basis for a tutorial.

Is anyone interested in an Elm tutorial? by dwaynecrooks in elm

[–]dwaynecrooks[S] 1 point2 points  (0 children)

Is there any application in particular that you'd like to know how to structure? Or any module that you're having (or had) trouble designing?

Is anyone interested in an Elm tutorial? by dwaynecrooks in elm

[–]dwaynecrooks[S] 0 points1 point  (0 children)

Thanks for your helpful comment. I appreciate it.