profile
viewpoint
Elm elm http://elm-lang.org/ Official organization for developing Elm's compiler and core tools

elm/compiler 6709

Compiler for Elm, a functional language for reliable webapps.

elm/core 2640

Elm's core libraries

elm/elm-lang.org 1930

Server and client code for the Elm website.

elm/projects 413

Curated collection of projects for folks looking to collaborate within the Elm ecosystem.

elm/html 360

Use HTML in Elm!

elm/browser 295

Create Elm programs that run in browsers!

elm/package.elm-lang.org 286

website for browsing packages and exploring documentation

elm/virtual-dom 202

The foundation of HTML and SVG in Elm.

elm/parser 195

A parsing library, focused on simplicity and great error messages

elm/error-message-catalog 166

A catalog of broken Elm programs / data to improve error messages

fork ZenTauro/compiler

Compiler for Elm, a functional language for reliable webapps.

https://elm-lang.org/

fork in 2 hours

issue commentelm/compiler

Compiler hangs forever if elm.json's dependencies field is an empty object

Here’s something interesting: If I make the following change to the SSCCE:

-    "dependencies": {},
+    "dependencies": {
+    },

Then I get the expected error message with no hanging:

-- MISSING FIELD ------------------------------------------------------ elm.json

I ran into a problem with your elm.json file. I ran into trouble with the value
of the "dependencies" field:

7|     "dependencies": {
                       ^
I was expecting to run into an OBJECT with a "direct" field.

I think that the error reporting hangs whenever the JSON syntax is correct but there’s an error like “missing field” in a JSON object written on a single line.

This is the shortest reproduction I could come up with:

❯ mkdir elm-hang
❯ cd elm-hang
❯ echo '{}' > elm.json
❯ elm make
Dependencies ready!
-- MISSING FIELD ------------------------------------------------------ elm.json

I ran into a problem with your elm.json file. I ran into some trouble here:

^C^C⏎

However, if you do printf '{\n}' > elm.json instead of echo '{}' > elm.json, it does not hang:

Dependencies ready!
-- MISSING FIELD ------------------------------------------------------ elm.json

I ran into a problem with your elm.json file. I ran into some trouble here:

1| {
   ^
I was expecting to run into an OBJECT with a "type" field.
jfmengels

comment created time in 3 hours

startedelm/compiler

started time in 9 hours

startedelm/compiler

started time in 10 hours

startedelm/compiler

started time in 17 hours

startedelm/compiler

started time in 20 hours

startedelm/compiler

started time in a day

issue commentelm/compiler

Shadowing should not be prohibited by the compiler

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions in a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

Finally, please be patient with the core team. They are trying their best with limited resources.

MartinErwig

comment created time in a day

issue openedelm/compiler

Shadowing should not be prohibited by the compiler

Quick Summary:

The following example is rejected by the Elm compiler (0.19.1):

let x=1 in x+let x=2 in x

The REPL says "These variables cannot have the same name". I think it's fine for the compiler to issue a warning, but the expression has a perfectly well-defined semantics, and it is wrong for the compiler to reject it simply based on a stylistic argument.

Why do I (and others) care? I want to use Elm to teach about programming languages. And nested let expressions with the same name are a good way to talk about the concept of variable scope. The unnecessarily restrictive behavior of the Elm compiler prevents that.

Turning the compiler error about shadowing into a warning would address this problem.

SSCCE

  • Elm: 0.19.1, REPL

created time in a day

startedelm/compiler

started time in a day

issue commentelm/compiler

elm-19: thread blocked indefinitely in an MVar operation

I had a similar issue where there was a compiler crash with the MVar issue:

$ elm make .\src\Main.elm --output=/dev/null
Compiling ...elm.exe: .\\Data\\Vector\\Generic\\Mutable.hs:703 (modify): index out of bounds (3,3)
CallStack (from HasCallStack):
  error, called at .\\Data\\Vector\\Internal\\Check.hs:87:5 in vector-0.12.0.1-GC2xzdMF0QQGz7ZCcRBJRL:Data.Vector.Internal.Check

The issue seemed to be that the Elm compiler couldn't figure out the Elm error in my code and crashed, because fixing the issue also made the compile work.

I tried to make an ellie of it, but I couldn't make up an example that was able to reproduce it. It would be on line 70 of this successfully-compiling ellie, if looking at this gives any sort of hint (as unlikely as it is though, since I couldn't reproduce it outside my codebase), where I had foo2 = getLocations m while it should have been foo2 = getLocations m.locations.

I do have a branch saved that reproduces in my 6k line project, if someone on the dev team would like access, please let me know.

bburdette

comment created time in a day

startedelm/compiler

started time in 2 days

PR opened elm/expectations

Mention the Cathedral development style (#1)

The development model of elm is not new :-)

+1 -1

0 comment

1 changed file

pr created time in 2 days

fork wfranzini/expectations

Trying to set expectations about @elm processes

fork in 2 days

startedelm/compiler

started time in 3 days

startedelm/compiler

started time in 3 days

startedelm/compiler

started time in 4 days

startedelm/compiler

started time in 4 days

startedelm/compiler

started time in 4 days

startedelm/compiler

started time in 5 days

startedelm/elm-lang.org

started time in 5 days

startedelm/compiler

started time in 5 days

fork AndrewHolmusk/compiler

Compiler for Elm, a functional language for reliable webapps.

https://elm-lang.org/

fork in 5 days

startedelm/compiler

started time in 6 days

startedelm/core

started time in 6 days

startedelm/compiler

started time in 7 days

startedelm/compiler

started time in 8 days

startedelm/elm-lang.org

started time in 8 days

more