Talk:Elm (programming language)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Untitled[edit]

This article is mainly based on primary sources. I've copied its content to a wikibook, just in case someone wants to delete or trim down the article at any time. Diego (talk) 10:19, 22 February 2014 (UTC)[reply]

Limitations[edit]

The section about limitations is wrong. Elm does support higher-order functions. Therefore functions such as fold and map do exist. Compare http://package.elm-lang.org/packages/elm-lang/core/2.1.0/List or the following piece of valid code:

map : (a -> b) -> List a -> List b
map f xs = case xs of
                  (y::ys) -> (f y) :: (map f ys)
                  [] -> []
I agree.
Elm is new to me, but I know about programming languages. What they mean is that Elsm has not what is also known as generic types.
That may be true if Elm has no class declarations like that of Haskell, because map can not be overloaded with specialized versions for several types (mapTree, mapList, mapT1, mapT2, etc.)
On the other side, it seems that Elm has classes but the article may be based in an incomplete version of the language, but planned by its author by 2015 as said in the limitations section.
I also suspect that it will have some provision for class declarations, because it is mentioned that it has a Maybe a type. (The Maybe monad?)
I am writing this comment by the end of 2021, that should be upgraded. As I said, Elm is new to me, I may fix it later when I am not too busy to learn Elm, which seem a to be good language.
Anyway if some Elm programmer can fix it, please do it.

--132.231.65.203 (talk) 17:03, 14 July 2015 (UTC)[reply]

The section is not wrong. Your implementation is specific to List. Higher-kinded types cannot be expressed in Elm (see: https://github.com/elm/compiler/issues/396).
85.212.193.55 (talk) 00:05, 30 December 2020 (UTC)[reply]

Example code section unnecessary[edit]

I believe the example code area is unnecessary, as that type of thing is not the purpose of Wikipedia. I'm making a comment here before removing it to see what others think. --LichWizard talk 18:48, 8 April 2018 (UTC)[reply]

I think some of it should be kept, like the "Hello World"; that seems typical of articles about programming languages. It would be nice if the rest was sectioned or re-labelled if the goal was to demonstrate "Syntax" or particular features. Mostly, though, I just wanted to point out that https://en.wikibooks.org/wiki/Elm_programming_language could be a place for material cut from here. --Everrob (talk) 20:56, 4 September 2018 (UTC)[reply]
I think the example is very useful to give a brief tour over the language features, so that Elm can be compared with its relatives (e.g. Haskell). Removing the flag. Andreasabel (talk) 07:17, 12 October 2021 (UTC)[reply]
I totally disagree with LichWizard! This article needs more examples. Please don't start to spoil Wikipedia's articles in this subject as they did with those about food forbidding to write recipes.
I agree with Andreasabel and Everrob, but Hello World! is not the classic example in functional languages.
Elm is a functional language designed to write code for internet, so it deserves an example to illustrate how simple is to write code HTML+JavaScript, with something in the server side. I don't know exactly what to suggest but something to illustrate the advantages to use Elm, instead of pure HTML, javascript, PHP, and alike.
Why does LichWizard want to censor examples. They are needed in a clear article.

More Diverse sources[edit]

Most of the sources link back to official Elm documentation. Are there any other alternative sources that can be cited so that all references aren't dependent on the same team as makes the language? — Preceding unsigned comment added by Ethan McCue (talkcontribs) 04:52, 18 September 2018 (UTC)[reply]

Elm is 0.19.1-5 version by November 2021, do not expect to have a lot of sources. It is OK to base the article in the information of the official site, but written by volunteers who know about programming language principles, not just programming aficionados. Those who know about the subject in general can see features that the aficionados can't. For example I see that the article as it is now was not written by someone familiar with the principles behind Elm, for example it does not mention if the language is laze or eager. Pure functional is ambiguous in this sense, a true functional language should be lazy. It also say that the language has stateless values, any pure functional language has variables as used in mathematics not mutable state memory locations. The ignorance of those features of functional languages is what makes the article unclear not the lack of many sources. Volunteers with a strong background can be critical to analyse the language and write a good article of this language (and others too). — Preceding unsigned comment added by 2806:106E:B:AA51:21CD:CEA5:1433:EC66 (talk) 05:40, 23 November 2021 (UTC)[reply]

Criticism[edit]

Elm get quite a bit of criticism; maybe it should be described here. Things like the removal of custom infix operators, custom kernel code, and the infrequent updates to Elm are controversial. Dullbananas (talk) 03:16, 25 December 2020 (UTC)[reply]

It is not clear what you talk about, can you give examples and references please.

Elm is an eager language[edit]

In a quick browse to Elm site I could not find how it evaluate functions. Because it transliterate to JavaScript, functions are called by value. I did the following experiment:

enumFrom : number -> List number
enumFrom n = n :: (enumFrom (n+1))

testing the function I got:

> List.take 5 (enumFrom 1)
too much recursion

a lazy language (call by need) would eval to: [1,2,3,4,5] There are more things to fix in this article — Preceding unsigned comment added by 2806:106E:B:AA51:21CD:CEA5:1433:EC66 (talk) 06:45, 23 November 2021 (UTC)[reply]