In your opinion, what is the best language for scripting?
Trade-offs
Here is some trade-offs:
- It MUST be an interpreted language
- It SHOULD be clear to understand
- It SHOULD run in many environments (different OS and versions)
- It SHOULD allow the code express intentions
- It SHOULD be easy to reuse code
- It SHOULD have some minimal libraries (sets, maps, dictionaries, etc...)
- It SHOULD be easy to resolve dependencies
Some selected
Bash
- 😃 Yes, is is an interpreted language
- 😔 No, it is not easy to understand what is happening....
- 😃 Yes, it run in almost any environment
- 😔 No, it does not express intention
- 😔 No, it is not easy to reuse code
- 😔 No, it is not easy to use libraries
- 😃 Yes, many dependencies are Unix programs
Python
- 😃 Yes, is is an interpreted language
- 😃 Yes, it is easy to understand what is happening....
- 😃 Yes, it run in almost any environment
- 😃 Yes, it express intention
- 😃 Yes, it is easy to reuse code
- 😃 Yes, it is easy to use libraries
- 😟 Sometimes, some old libraries are difficult to find.
Any other option?
Top comments (4)
It doesn’t have a big web dev presence, but Lua is a fast and fantastic language for scripting. It’s so small that its entire interpreter is meant to be embedded into larger programs. That’s why so many games are made with Lua scripting support.
Check out neovim and love2d for some great programs with Lua apis
I've had a surprisingly lovely experience with ClojureScript, using lumo or planck. It's a great language for small automation tasks, robust built-in library, easy to extend and maintain, runs quick enough for me when using these solutions (JVM Clojure is too heavy for this). In terms of expressivity, if you know Clojure, it's second to none. If you don't though, it's not easy to read, so if your scripts need to be shared around a lot it might not be the best choice either. It's definitely a niche tool, so you're largely on your own for support. For personal use, though, I haven't found a better experience.
Clojure as scripting... Oh my God!!! I need to learn more clojure. We usually use the language we already know.
In the company that I work, we have a proprietary language that is optimized for speed... The have some process with that language + python + bash. It is horrible to make any change!
You already picked them; however I'd add Go.