mfikes / ambly

ClojureScript REPL into embedded JavaScriptCore
http://ambly.fikesfarm.com
Eclipse Public License 1.0
541 stars 21 forks source link

Evaluating long expression misbehaves #74

Closed mfikes closed 9 years ago

mfikes commented 9 years ago

If you paste the following in to the Ambly REPL

(some-> 1 inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc inc)

You will get back 254. But if you add one more inc, then something messes up and the form is not evaluated and the terminal becomes unusable.

mfikes commented 9 years ago

Same things happens with Quick Start browser REPL. If I can isolate what this is, I'll submit a useful bug report against ClojureScript.

swannodette commented 9 years ago

@mfikes isn't this the JavaScriptCore nested invoke bug? Can't really do much about this in REPLs as advanced optimizations don't kick in.

mfikes commented 9 years ago

@swannodette Good thought, but no: I just retried and am also able to reproduce it with Quick Start browser REPL against Firefox.

mfikes commented 9 years ago

@swannodette Interestingly, it is related to the OS X terminal. You can essentially reproduce is with something as simple as

cat > foo.txt

Then paste in the long line and try to edit it to add the last inc. You can't.

Interestingly lein repl overcomes the issue (will look to see if it messes with terminal I/O line length limitations).

mfikes commented 9 years ago

It appears that the terminal has a limit of 1024 characters. (See this SO.)

Interestingly, lein repl probably avoids this by trptcolin/reply employing jline/jline2.

Ideally, Ambly wouldn't pursue things like these on its own if it can instead be implemented in the base REPL support. Closing for now.