Looking through the packages available for OpenWRT I would suggest Tcl, Lua, Erlang or Scheme (the latter is available through the Chicken interpreter). Try them out, see what you like.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
Bash
Python.
Just remember to use pyenv for interpreter installation, version and environment management. It's pretty straightforward that way and you have predictability.
Don't ever manually fiddle with the system python and/or libraries or you'll break your system. You should just rely on the package manager for that.
(Chicken) Scheme.
Schemes have one of the best and most interactive interpreters Is general purpose, allows functional, procedural and OO programming, small disk size and compilable to native executables, Throughout documented and supplemented by years of research, simple setup.
It also is CGI compatible, if necessary.
You could use Ansible for automation just keep in mind it needs python.
Powershell is the superior choice. But if you can't even have bash you probably won't have access.
You should probably check out Guile.
I honestly love Powershell, but haven't tried the Linux version yet. I only use Bash on linux but it has a load of odd quirks that make it unpleasant to use imo. Can't comment on anything else.
I use powershell for work as I need the m365 modules for work and its very flexible with decent module availability to plug in all sorts.
However it absolutely sucks for large data handling, anything over 10k rows is just horrendous, I typically work with a few million rows. You can make it work with using .Net to process it within your script but its something to be aware of. Being able to extend with .Net can be extremely useful.
Pwsh 7.x works very well in Linux. Haven't got any snags.
I've looked into this a lot actually. There see many options. I'll highlight the pros and cons of each option.
Lua: extremely lightweight, but standard library is lacking, and doesn't include stuff like map or fold. But that would be easy to fix.
Python: thicc standard library, but is not lightweight by any means. There are modifications made to be more shell like, such as xonsh
Rash: based on scheme, very much functional but if you're not used to lisp style, might take a bit to get used to it. This is actually my favorite option. It has a cli interpreter, and really pleasant to use. Cons is... Well it's not very common
You can honestly use any language. Even most compiled languages have a way to run immediately.
You might enjoy lua or lune.
I still love bash. I'm able to accomplish quite a lot with it. I vote bash.
Nah, gross. You need to set a bunch of global options to get sane behavior on errors.
Nushell is shaping up really really nicely, and it'll actually stop executing if something fails! Even if that happens in a pipe! And it's not super eager to convert between arrays and strings if you use the wrong cryptic rune.
Bash? On windows it's pretty much unusable even if you use cygwin. Python or Lua are the only reasonable suggestions here
I just assumed the scripts would run on Linux.
Also vote bash, but I don't love it..more of a tolerate.
Not quite a scripting language, but I highly recommend you check out cosmo for your usecase. Cosmopolitan, and/or Actually Portable Executable (APE for short) is a project to compile a single binary in such a way that is is extremely portable, and that single binary can be copied across multiple operating systems and it will still just run. It supports, windows, linux, mac, and a few BSD's.
https://cosmo.zip/pub/cosmos/bin/ — this is where you can download precompiled binaries of certain things using cosmo.
From my testing, the APE version of python works great, and is only 34 megabytes, + 12 kilobytes for the ape elf interpreter.
In addition to python, cosmopolitan also has precompiled binaries of:
And a few more, like tclsh, zsh, dash or emacs (53 MB), which I'm pretty sure can be used as an emacs lisp intepreter.
And it should be noted these may require the ape elf interpeter, which is 12 kilobytes, or the ape assimilate program, which is 476 kilobytes.
EDIT: It also looks like there is an APE version of perl, and the full executable is 24 MB.
EDIT again: I found even more APE/cosmo binaries:
That verb doesn't work like that.
another vote for Lua – lua5.4 is available for all 8 Alpine architectures, tiny installed size (120–200 kB) (and Alpine package only installs two files)
Why does it need to be a scripting (by this I assume interpreted) language? For your requirements - particularly lightweight distribution - a precompiled binary seems more appropriate. Maybe look into Go, which is a pretty simple language that can be easily compiled to native binaries.
posix sh + awk for manipulating data?