Implementation of a command line interpreter with functional language
I am playing with the idea of writing a command line interpreter and I suspect that a functional language like Clojure is well suited for the task.
I am, however, 5 years from a CS degree and my only experience with functional languages was the harrowing experience with Haskell in my third year of languages.
So, is a language like Clojure ideal for this task? If not, what is the ideal language.
Free requirements:
- Should work on JVM
- Provide an interactive shell where users enter commands with CLI-like syntax
- Custom commands will eventually terminate the remote service call using SOAP.
Thank!
source to share
You can roughly do this out of the box with Clojure and Scala, and with Java if you add BeanShell . You can see the REPL objects they already have.
I assume this is only suitable for advanced users. But it's actually hard to imagine a language that doesn't work well in the CLI.
When deciding between platforms, the larger the modern system, the more it will be scripting friendly.
I know exactly what I'll be using given your requirements: JRuby . (It also has a ready-made REPL.)
source to share
I don't think the CLI has any specific language requirements; you could probably write it in Java or Scala as well. Ultimately, I think the choice of language boils down to this:
- Which of you is the most comfortable to work with.
- Which ones have the appropriate library support for what you want to do (i.e. web services).
source to share