elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

REPL hangs on expression input #117

Closed catb0t closed 8 years ago

catb0t commented 8 years ago
cat $ elm-repl
---- elm repl 0.17.0 -----------------------------------------------------------
 :help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> :help <RETURN>
General usage directions: <https://github.com/elm-lang/elm-repl#elm-repl>
Additional commands available from the prompt:

  :help                 List available commands
  :flags                Manipulate flags sent to elm compiler
  :reset                Clears all previous imports
  :exit                 Exits elm-repl

> <RETURN>
> 1 + 1 <RETURN>
<5 minutes pass>
<control-c>
^C Computation interrupted, any definitions were not completed.

> 
130 | cat $ <RETURN>
130 | cat $ <RETURN>
elm-repl: <stdin>: hGetChar: hardware fault (Input/output error)
<RETURN>
cat $

The <RETURN>s are places I've pressed enter. I see the error on CTRL-C noted in #99 and #102, but here, I waited for 5 minutes after hitting return after the 1 + 1 and before pressing CTRL-C, and nothing happened. Elm-repl's CPU usage was at 0.01 the whole time. The :-commands work fine, it's just when it finds code to run.

I installed elm-repl by typing sudo npm install -g elm. This is Ubuntu 16.04.

Interestingly, strace elm-repl doesn't show any syscalls happening after an expression is typed.

ghost commented 8 years ago

Same here. Ubuntu 16.04 Elm repl 0.17.1 Node v6.2.2

Is there some other dependency I don't know about?

ghost commented 8 years ago

It works now.

I upgraded stack from 0.1.10 to 1.1.2 (as well as all my haskell stuff, I guess) by running stack upgrade. Suddenly elm repl is working fine. Does this make sense?

evancz commented 8 years ago

@catb0t, definitely ask this question on the Elm slack or on elm-discuss instead. http://elm-lang.org/community They will help you get it sorted out, and if you really did find an issue, we can open a new one that outlines it more clearly.