4 ms·
I very much like the idea of Java. A runtime for everything! Wow! But it feels like the coolest aspects of this idea have been realized more by .NET than by Ja
by solarkraft 3y ago
I very much like the idea of Java. A runtime for everything! Wow!
But it feels like the coolest aspects of this idea have been
realized more by .NET than by Java itself. Powershell, for instance, is so cool (in theory) because it lets you dynamically mess around with and script statically compiled components. This could (in practice it's not, since I haven't found good tooling) be so great for debugging.
- mike_hearn 3y agoI've found that it works better to use a 'real' programming language for scripts and use a UNIX shell for interactive REPL-like use. The syntax of the command line is hard to beat one you master it because it's so terse and for one-to-ten line programs like you get in a REPL maintainability doesn't matter. For anything else, it's better to write a script file and execute it. The tradeoffs are different and what works well for a program meant to stick around doesn't work well interactively. The downside of course is that if you perfect a bit of logic with a repl, you then have to translate to the other language. My company uses an in-house variant of Kotlin Scripting which has replaced bash and python for us. It's got a lot of neat features, like you can echo markdown to the terminal and it'll be rendered nicely, it has a built in progress tracking framework, it has a UNIX-like shell API for working with files and processes, you can import libraries from Maven and use them directly and so on. The only real downsides are that it's slow to compile, and currently Kotlin Scripting is still in a (very long) beta period. Hopefully when they finally release version 2 of the compiler it'll be faster and they can finally nail down the scripting support a bit better. But I have to say, it's really enjoyable to use. I used to dread shell scripting tasks because shell is just so persnickety. Now I don't. Java has something similar with jbang and jshell, but the Java syntax is perhaps a bit too verbose still. They're improving it a lot though!