I think any large interesting program you might write could well have an embedded language within it, in which the user can write stuff that is just as good, and just as deep as built-in functionality. You want this. It’s a thing that makes programs compelling.
In #Vim, that embedded language is #VimScript. In #emacs, that’s #elisp (which in fact, I think the whole thing is written in). In a #smalltalk environment, you control the entire environment with Smalltalk, just as elisp applies to Emacs. For many, many things, that language is #lua ( #NeoVim, many games, #pandoc, #redis, this list goes on).
I used to think there were really two reasonable mainstream languages you could use here: #Python or #javascript. Between those two, for a long time I felt that JavaScript was the winner. I think that has changed as Python has gotten faster, more powerful, and better known. But also, I think the answer might actually not be either of these two. It might be Lua. Lua is simpler and faster than either JavaScript or Python. It’s more embeddable. It’s designed specifically for this purpose. It’s in much wider use as an embedded scripting language. I don’t want Lua to be the answer. I like Python better. But I think Lua actually is the right answer.
@YesJustWolf lisps are the right answer. But Lua has fennel, so no complains there.
@YesJustWolf Lisps are better.
Lua is fine. In general I think algol descendants are not as good at this.
But Elisp was created as embedded in emacs from the start.
Do not forget guile.