Kotlin REPL is still so incredibly bad!

The Kotlin REPL could be a useful tool, but it doesn’t get any love from JetBrains. If you type in something, your input is repeated on the next line what reduces readability and the result is printed directly after the pointless repeated input.

Welcome to Kotlin version 1.7.10-release-334 (JRE 17.0.3+7)
Type :help for help, :quit for quit
>>> "test".repeat(2)
"test".repeat(2)res0: kotlin.String = testtest
>>>

I’ve even written a ticket to fix it 5 years ago, but nothing happened.

Now, it looks like JetBrains and Kotlin are the slow movers. JShell is much better!

|  Welcome to JShell -- Version 17.0.3
|  For an introduction type: /help intro

jshell> "test".repeat(2)
$1 ==> "testtest"

JShell even has tab completion.

What’s going on, JetBrains folks? Have you given up the REPL? Where is the spirit and development speed of the first years of Kotlin (knowing Kotlin since 2014)? Kotlin is starting to age.

1 Like

I don’t use REPL, so I may be wrong, but in the last year JetBrains introduced an entirely separate REPL and they work on it: GitHub - Kotlin/kotlin-interactive-shell: Kotlin Language Interactive Shell

ki-shell 0.5.2/1.7.0
type :h for help
[0] "test".repeat(2)
res0: String = testtest
[1] 
4 Likes

Thank you very much! I wasn’t aware of this tool. Maybe it is time to drop the old REPL then and to promote this replacement a bit better.

The REPL is officially a legacy now. Sadly support for KI is not very good yet. It has a lot of bugs. But it is open-sourced to a separate project, so people can contribute.

2 Likes

Then, JetBrains should at least mark it somehow as legacy. A little note on startup pointing to KI would be helpful.

2 Likes

One important detail: this issue seems to be specific to Windows.

I agree that is urgent to replace the current REPL with Kotlin Interactive Shell.
It’s pity that such a superb language has such bad REPL, while all other competent languages have much better REPLs.

1 Like

… and even Java, the last mover of programming languages has such a good REPL for some time now. I created a ticket to replace the Kotlin REPL with Kotlin Language Interactive Shell officially. Maybe you want to vote for this ticket …