What do you think about one of my, but very old programming language. It's a scripting language, but invoked by special library. I called this library kind: interaction library, because it's automatically detects best way to interact with user and handle all interaction manner. Program (for example) telling: i need view class /desktop/dialogs/message_dialog and I support /message and actions /action/ok, /action/cancel. Program also told: set message to "what would you do?" and my library handles everything. I telling you this, because one of mode of running programs use my library is shell mode, where user/programmer could interact with view by writing commands or text script is started based on parameters given to program, but my library contains builtin web server and can work with user in cui/gtk+2.0 or QT mode.
Description of shell language supports by my library: https://www.dobreprogramy.pl/Libgreattao-i-jego-tekstowa-powloka,Blog,63527.html (in Polish)
https://www.dobreprogramy.pl/Libgreattao-i-jego-tekstowa-powloka,Blog,63527.html (in English)
The language looks like an assembler, but it is very flexible. For example, you could define block of code, using block statement, put compare instruction at beginning of block, put other instruction and .false label at the end of block. If condition in compare instruction wasn't true, shell will jump to .false label. You think, so how to handle or? There's solution: you can jump to label in block up on stack, event it's placed in different procedure body, but that's not advised. How it work?
[code] function OR =text i 0 block test_first_true ifintless $i $.unnamed_param_count =add i $i 1 =fromdict command $.unnamed_params $i block test execute $command scopebyname OR return : .false endblock test continue : .false scopebyname OR scopelevel -1 goto .false endblock test_first_true endblock [/code] I known it looking bad, but I understood this code in one minute and I wrote it long time ago. Magic. And of course - I think core of language should be as small as possible. Everything else we could write in my language itself!
What do you think?
I never used TCL, sorry.
It works with template system, when in GUI/CUI mode. I use language like XSLT, but better fits with my needs. Application request to activate action /action/ok and it activate templates /action/. Inside one of /action/ (or /action/ok) template we generate button, attaching callback given by app to button in this template and set text to ok (last-part-of-path). When app request to change text of ok button, it can do this by special API of course. Very positive aspect is, libgreattao can generate gui in many ways. Another style (style could be selected by user), we generate dropdown list with options like /actions/ok, /action/cancel, etc. and two buttons: (1) process button to process event related to selected option and (2) cancel, with will be generated only if /actions/cancel is requested. We could also set template priority, so /actions/cancel wouldn't be provided in dropdown list, but only near process button.