Re:Installing A/UX on the Quadra 610 (2018)
by Annatar on Thursday December 26, 2019 @04:49AM
(#21882847)
That's an ingenious solution. Whoever thought of that was very, very smart, forward looking and insightful. We need to bring that into illumos, the runtime linker in illumos already has capability to do all sorts of things before the excutable even starts, so it would be the perfect place to plug into. It can easily be made optional, so programs which do not generate this declarative part will continue to function unmodified and nothing will be broken.
Just to set the record straight though, while the options in UNIX programs are very different from program to program, good UNIX programmers know to use getopt(3C) libc function and not invent their own custom parser. All programs which use getopt(3C) have a uniform, consistent option parser and command line behavior. https://illumos.org/man/3c/getopt
Re:Installing A/UX on the Quadra 610 (2018)
by floatboth on Thursday December 26, 2019 @08:21AM
(#21883588)
If only http://docopt.org was invented and standardized and widely adopted in the 80s…
> good UNIX programmers know to use getopt(3C) libc function
Well, when writing in C. People don't really use this from other languages.
Re:Installing A/UX on the Quadra 610 (2018)
by ohithereyou on Thursday December 26, 2019 @10:52AM
(#21884600)
We use getopt style command line parameter parsing in at least Java, Perl, Python, and BASH at work, so I wouldn't say that this is unused.
We're also primarily a UNIX shop at work, so that might be part of it.
Part of how it works – on Unix, command arguments are just a list of strings, and any option parsing (etc.) has to be done by the code of each command. By contrast, on IBM i, there is a declarative language used to define the syntax of the command (allowed options/arguments, what values are allowed for each, etc.) The declarative command definition is compiled into binary form and installed into the system. When you run a command, the operating system uses the installed command definition to parse and validate the parameters and marshal them into a memory block. If the parameters are invalid, then the OS produces the error and the command executable never even starts. If the parameters are valid, the memory block gets passed to the command's code. These same declarative command declarations are what gets used to generate the fill-in form UI.