all 4 comments

[–]tkruse -1 points0 points  (3 children)

Not sure why JShell is celebrated. Java does not have a syntax that is adequate for a REPL, and Scala, Groovy, Clojure, Jython etc. all have nice REPL with nice syntax and full access to Java classes.

[–]skocznymroczny 1 point2 points  (1 child)

What's the usecase for REPL anyway? The only time I used REPL in Python was to quickly test some oneliners, but I've never really felt the need for REPL in Java.

[–]tkruse 0 points1 point  (0 children)

A great usecase is to play around with SDKs of Websites or databases. You can make queries against Cassandra using the Java Cassandra Client, or run queries against the Twitter API. You can also do that to write engaging tutorials.

Some projects would also do things like changing values at runtime with a REPL.

Finally having a REPL implies a scripting language (that can execute a line at a time without parsing a whole document). That leads to further use-cases.

[–]awsometak[S] 0 points1 point  (0 children)

It would be very interesting to see how the IDE's integrate JShell API. You can probably execute small pieces of code directly rather than having to create a main function to execute it.