Re:Why Crystal is the most promising programming language of...
by sam0x17 on Friday June 15, 2018 @08:14AM
(#17319155)
Yeah, to clarify this should be possible, but I don't think it's going to happen for some time. There is a shard that creates a REPL, but it re-executes all previously executed commands each time you enter something new, which is super bad and dangerous. What we need is something that will compile just the line that was entered, and somehow "inject" that line into the existing program, and execute only that next line. Also there might always be a bit of lag between when you enter a line and when you get your response because the compiler is invoked. I'm not sure if that could be optimized to the point where it isn't noticable, but that would be super cool. I added on functionality for the Amber framework that allows you to execute one liners via `amber exec "code here"` as a replacement for `rails console` (amber is basically the rails of the crystal world).
[ Parent
| on HN ]
Re:Why Crystal is the most promising programming language of...
by _old_dude_ on Friday June 15, 2018 @08:22AM
(#17319199)
Both scala and Java provides a REPL by compiling each lines + maintaining a context containing all local variables, functions, classes, etc