News for hackers. Stuff that matters.
Re:SVGs as Elm Code by carapace on Thursday November 03, 2022 @02:32PM (#33455339)
If you haven't already, do also have a look at Scott Wlaschin's talk "Domain Modeling Made Functional with the F# Type System" (it seems he has a whole book out on it now too) https://fsharpforfunandprofit.com/ddd/ (F# and Elm are similar enough that the concepts map directly.)

I've been challenging folks for a while now: What's the economic argument for using JS in a world where Elm exists?

In other words, if you want a front-end app, and you do not care about the technology used to make it (you're not using a particular stack just because you like it) then you should pretty much just use Elm, eh?

If I'm some business owner who wants a web app that works reliably and is cheap to maintain, I don't know or care about the underlying tech stack, it seems like Elm is sooooooo much better than all the JS frameworks and "ecosystem" in terms of the metrics I care about.

Typical objections:

1) JS devs are easier to find.

I would never hire a programmer who can learn and use JS but refuses to learn and use Elm. That's a technician not a programmer.

It's easy to train non-programmers to use Elm. (If you can solve Sudoku you can learn to program.)

2) Elm doesn't integrate with some library or service.

That's an argument for wrapping that lib/service in an Elm module, not against using Elm entirely. (E.g. in Rust you sometimes must use unsafe code but we do not give up the borrow checker entirely.)

3) Evan is mean.

I do not care.

4) I can't control the Elm compiler development.

Elm is simple, write your own compiler.

- - - -

I've heard that there's work on an Elm-to-native app compiler... Neat.

Re:SVGs as Elm Code by skybrian on Thursday November 03, 2022 @03:03PM (#33455782)
Elm is stagnant. There's been no release since October 2019. It's a problem because there are known bugs.

Elm is also unstable; there's no guarantee Evan won't break things in the next release.

It's a bad combination. A fork could in theory fix this. Has anyone done it, though?

Re:SVGs as Elm Code by aarpmcgee on Thursday November 03, 2022 @03:41PM (#33456353)
I am particularly interested in this project that transpiles to TypeScript: https://github.com/eeue56/derw
Re:SVGs as Elm Code by dhucerbin on Thursday November 03, 2022 @03:28PM (#33456146)
There is Gren, but I didn’t use it.

https://gren-lang.org/

Re:SVGs as Elm Code by cardanome on Thursday November 03, 2022 @03:59PM (#33456642)
> Elm is also unstable;

> no release since October 2019

Three years with literally not changes is pretty stable in the fronted world.

The known bugs are not a huge blocker for most people.

Even if a new version with breaking changes would arrive tomorrow you could still keep using the version of Elm that worked fine for years. Really no issue.

Re:SVGs as Elm Code by ollysb on Thursday November 03, 2022 @04:12PM (#33456809)
https://www.roc-lang.org/ looks very interesting, it's from Richard Feldman who's done a ton to promote Elm over the years and also happens to work at NoRedInk.
Re:SVGs as Elm Code by cardanome on Thursday November 03, 2022 @08:34PM (#33460104)
> quality-of-life improvements inspired by dynamic languages (always being able to run your program even if there are compile errors, automatic serialization and deserialization using schemas determined by type inference, reliable hot code loading that's always enabled and requires no configuration to set up, etc.)

They get it! Especially the being able to run your program even with compile errors part. Looking at you Golang and Zig with your unused variable errors. Let me do my prototyping!

And yeah, Richard Feldman is awesome. Roc is sure worth keeping an eye on.

Re:SVGs as Elm Code by 1-more on Thursday November 03, 2022 @04:28PM (#33457036)
> Elm is stagnant. There's been no release since October 2019. It's a problem because there are known bugs.

There are. I have never encountered them in my life but yeah there are. Fork it if they're really holding you back

> Elm is also unstable; there's no guarantee Evan won't break things in the next release.

I'm showing my privilege as someone who started with elm with 0.19 after all the big emergent patterns had emerged, but here goes: the FFI workaround that was broken from 18 to 19 was telegraphed for years. Earliest mention about it being disfavored I can find is from 2015 [1]. Conversely with 0.19.1 we get "If you like what you see now, that's pretty much what Elm is going to be for a while." [2] Ports and Custom elements make it such a non-issue to interact with JS while keeping your state in elm that it's just never held me back shrug.

> It's a bad combination. A fork could in theory fix this. Has anyone done it, though?

Gren, Derw, and eventually Roc compiled to JS/WASM could all do it I guess. Remains to be seen, but it's a very exciting space right now. It's a bit like The Velvet Underground: they only sold 20k records, but everyone who bought a copy started a band (or so the saying goes).

[1] https://groups.google.com/g/elm-dev/c/1JW6wknkDIo/m/H9ZnS71B... [2] https://github.com/elm/compiler/blob/master/roadmap.md

Re:SVGs as Elm Code by chillfox on Thursday November 03, 2022 @08:45PM (#33460192)
Nope, because anyone forking would have to come up with new name and run their own community.

If you are building an SPA then there is always Mint[1] (it's an Elm like language).

  [1]: https://github.com/mint-lang/mint
Re:SVGs as Elm Code by klysm on Thursday November 03, 2022 @03:11PM (#33455887)
> It's easy to train non-programmers to use Elm. (If you can solve Sudoku you can learn to program.)

Training developers is expensive. The less experience they have, the more expensive it is (generally).

> Elm is simple, write your own compiler.

The economic argument against this is it isn't easy (expensive) to write and maintain your own compiler.

Re:SVGs as Elm Code by davnn on Thursday November 03, 2022 @03:27PM (#33456127)
It really depends on the app. There is a lot of functionality that is cumbersome to use with Elm, i.e. everything requiring Ports. Additionally, if your app depends on some functionality that is not yet available in Elm, you‘ll have to solve a hard problem not related to your app, before actually developing your app.
Re:SVGs as Elm Code by sdeframond on Thursday November 03, 2022 @05:46PM (#33458207)
You can also encapsulate things into web components, then use them in Elm.

https://elmprogramming.com/interacting-with-web-components.h...

Re:SVGs as Elm Code by gaze on Thursday November 03, 2022 @03:42PM (#33456376)
elm doesn’t have anything like unsafe blocks or much of an FFI. It has ports, which make integration with many libraries rather cumbersome. The elm philosophy seems to be to rewrite everything in Elm, and to disincentivize binding.
Re:SVGs as Elm Code by 1-more on Thursday November 03, 2022 @04:14PM (#33456843)
once you write a custom element you'll never go back to ports if you can help it. So ezpz. You can keep your state entirely in Elm with no issues.
Re:SVGs as Elm Code by sdeframond on Thursday November 03, 2022 @05:51PM (#33458262)
> The elm philosophy seems to be to rewrite everything in Elm, and to disincentivize binding.

Or to use web components https://elmprogramming.com/interacting-with-web-components.h...

Re:SVGs as Elm Code by pessimizer on Thursday November 03, 2022 @03:48PM (#33456460)
> That's a technician not a programmer.

If a technician can handle a job, why would I hire a programmer?

Re:SVGs as Elm Code by carapace on Thursday November 03, 2022 @07:00PM (#33459153)
That's a good point. I like to point out that secretaries were programming Emacs in Lisp back in the day:

> programming new editing commands was so convenient that even the secretaries in his [Bernie Greenberg] office started learning how to use it. They used a manual someone had written which showed how to extend Emacs, but didn't say it was a programming. So the secretaries, who believed they couldn't do programming, weren't scared off. They read the manual, discovered they could do useful things and they learned to program.

https://www.gnu.org/gnu/rms-lisp.html

Our (programmers) whole business model is predicated on the normies not realizing they don't really need us.

From that POV the JS ecosystems and all their churn are a form of job security. I feel like it's kind of a scam, a Potemkin village of complexity to hide the fact that computer programming just isn't that hard, and most needful software is already written.

(Excel is the most successful programming language and IDE in the world, eh?)

Re:SVGs as Elm Code by xupybd on Thursday November 03, 2022 @04:22PM (#33456949)
I present to you an alternative https://safe-stack.github.io/

You trade in some purity for practicality. Elmish on the front end is really nice. You get F# on the back end. Fable remoting makes RPC front end to back end really easy. The docs are amazing https://zaid-ajaj.github.io/the-elmish-book/#/.

You get access to the .Net ecosystem so it enterprise ready.

Re:SVGs as Elm Code by stonemetal12 on Thursday November 03, 2022 @04:59PM (#33457451)
If you want me to believe Elm is better where is the meta analysis of dozens of research papers showing Elm produces similar or better quality results for a lower cost than JS.

Instead all I got is "Trust me, it works", just like all the other snake oil salesmen on the street.

Re:SVGs as Elm Code by tester89 on Friday November 04, 2022 @12:59PM (#33470023)
> 3) Evan is mean. > I do not care.

Is this not a valid objection? Surely there is a non-trivial economic cost associated with have a dickhead maintaining a critical part of your stack, who's willing to remove support you rely on at his whim.

> Elm is simple, write your own compiler.

... that is a significant economic cost; which if you have a non-trivial probability of having to do, drastically shifts the cost/benefit analysis in favour of JS.

Re:SVGs as Elm Code by carapace on Friday November 04, 2022 @09:06PM (#33476537)
FWIW those are a bit tongue-in-cheek. For one thing, Evan is actually really really nice and civil, from all I've seen of him.