Mac OS (classic) vs MacOS (X+) Dictionary corrections

Updates on the progress of this project
Post Reply
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by OpenXTalkPaul »

During the course of working on the IDE, I've noticed that there are quite a few statements in the syntax Dictionary that are probably extremely confusing or misleading to people trying to write scripts for modern MacOS (X+) because what the docs refer to as 'Mac OS' is often outdated, what were they're referring to was Mac OS 'classic' (Mac OS prior to v10), which was a hugely different OS with a 'nano kernel' originating around 1981 (Apple Lisa) or so, compared to modern Mac OS (X+) which is based on NeXTstep / BSD (XNU kernel) and so architecturally it has more in common with UNIX and Linux then it does with classic Mac OS.

The Engine for macOS 'classic' hasn't been developed since RunRev 4.x (or 2.x?), so there's not much sense in even mentioning macOS 'classic' in OXT and I want to correct all of these misleading statements.

Here's an example:
Use the processID function to communicate with another application.

On Unix systems, the processID uniquely identifies the process belonging to the running application. Other processes can use the processID to address OpenXTalk.

The processID function does not return a meaningful value on Mac OS or Windows systems.
The statement I bolded is incorrect on modern macOS. The processID is meaningful, useful and correct, the result matches the process id number you would see if you run 'top' from the terminal, and so that number can be used to address a OpenXTalk process from a shell script or another app.

There are similarly severely outdate statements throughout the Dictionary, such as the docs from 'Open Process' which basically says you can't use that syntax at all on Mac, which is not true (since about 2001). I guess they assumed that people would know that 'Mac OS' referred to 'classic' while 'Mac OS X' referred to current macOS, which is 'Soooo 2001'. The later has since dropped the 'X', at least since macOS 11 'BigSur' came out, making these statements even more misleading.

If you know of any of these no-longer true / outdated statements, please let me know in the comments, because I'm planning on rebuilding the dictionary files again soon. Thanks in advance for any help with this.
User avatar
richmond62
Posts: 2765
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by richmond62 »

It never ceases to amaze me how LC just kept piling things on top without 'pruning' things that were no longer necessary.
https://richmondmathewson.owlstown.net/
FourthWorld
Posts: 280
Joined: Sat Sep 11, 2021 4:37 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by FourthWorld »

richmond62 wrote: Sun Jan 28, 2024 7:08 pm It never ceases to amaze me how LC just kept piling things on top without 'pruning' things that were no longer necessary.
The limitation is noted in the Dictionary. It still works on Linux.
User avatar
richmond62
Posts: 2765
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by richmond62 »

The limitation is noted in the Dictionary. It still works on Linux.
Which limitation(s)?

What still works in Linux?
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by OpenXTalkPaul »

FourthWorld wrote: Sun Jan 28, 2024 10:31 pm
richmond62 wrote: Sun Jan 28, 2024 7:08 pm It never ceases to amaze me how LC just kept piling things on top without 'pruning' things that were no longer necessary.
The limitation is noted in the Dictionary. It still works on Linux.
I think you missed the point entirely. The limitations (there are more than one related entrees) that are noted as you correctly said, are NOT limitations on modern macOS ( > Rhapsody / v.10.0), these limitations apply to macOS 9.x / classic engine and lower, and that engine was dropped by LC/RunRev a very long time ago. I know for a fact that these are not limitation on MacOS (X+) with LC Community 6.x and higher because I've been using them. And the wording is even more misleading since macOS 11 dropped the 'OS X' monicker like 5+ years ago. I'm pretty sure these entrees haven't been updated in like two decades.
FourthWorld
Posts: 280
Joined: Sat Sep 11, 2021 4:37 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by FourthWorld »

OpenXTalkPaul wrote: Mon Jan 29, 2024 12:56 am
FourthWorld wrote: Sun Jan 28, 2024 10:31 pm
richmond62 wrote: Sun Jan 28, 2024 7:08 pm It never ceases to amaze me how LC just kept piling things on top without 'pruning' things that were no longer necessary.
The limitation is noted in the Dictionary. It still works on Linux.
I think you missed the point entirely. The limitations (there are more than one related entrees) that are noted as you correctly said, are NOT limitations on modern macOS ( > Rhapsody / v.10.0), these limitations apply to macOS 9.x / classic engine and lower, and that engine was dropped by LC/RunRev a very long time ago. I know for a fact that these are not limitation on MacOS (X+) with LC Community 6.x and higher because I've been using them. And the wording is even more misleading since macOS 11 dropped the 'OS X' monicker like 5+ years ago. I'm pretty sure these entrees haven't been updated in like two decades.
Where you wrote "pruning", did you mean "fixing"?

Also, is the value returned by older versions of LC even a meaningful number anymore? That is, is it the actual process ID?

Both macOS and Windows use address randomization in conjunction with other methods to make it hard for unauthorized software to know how to get inside the runtime innards of other apps. I don't know the history of processID specifically, but it wouldn't surprise me if older LC versions are returning a value from an old API that no longer reflects the actual process ID of the target process.

In the work you're doing that relies on processID, are you able to accomplish what you need on current OS versions using the value returned from older LC versions?
User avatar
richmond62
Posts: 2765
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by richmond62 »

Where I wrote 'pruning' I meant removing text relating to defunct systems.
https://richmondmathewson.owlstown.net/
FourthWorld
Posts: 280
Joined: Sat Sep 11, 2021 4:37 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by FourthWorld »

richmond62 wrote: Mon Jan 29, 2024 5:21 pm Where I wrote 'pruning' I meant removing text relating to defunct systems.
What's the ID number of your bug report flagging "Unix" needing to be changed to "Linux"?

Bonus question: with LC's user base as small as it is, and Linux folk making up less than 3% of computer users, and the processID being very rarely needed, will the number of affected people be greater than 0?
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by OpenXTalkPaul »

FourthWorld wrote: Mon Jan 29, 2024 4:42 pm
Also, is the value returned by older versions of LC even a meaningful number anymore? That is, is it the actual process ID?

Both macOS and Windows use address randomization in conjunction with other methods to make it hard for unauthorized software to know how to get inside the runtime innards of other apps. I don't know the history of processID specifically, but it wouldn't surprise me if older LC versions are returning a value from an old API that no longer reflects the actual process ID of the target process.

In the work you're doing that relies on processID, are you able to accomplish what you need on current OS versions using the value returned from older LC versions?
Yes, that's the point, the docs say it's not meaningful but it is, it returns the actual PID as seen in 'top' and that you can use 'kill' from a shell to send the kill signal to the process.

There is (was, I removed it from the OXT Dictionary) in the docs an incorrect blurb about on 'macOS AND OS X' systems
From their dictionary on their website, just now:
On Mac OS and OS X systems, there is no process ID. Instead, the openProcessIDs function returns a list of integers. The first application started up (with the open process or launch command) during a session is assigned the number 1, the second is assigned the number 2, and so on. After an application quits, its process number is not re-used, so you can use the openProcessIDs function to determine how many times LiveCode has started up an application during the current session.
This may have been true at some point in the past (if so, my guess is it was early days of OS X), but it certainly is NOT true in OXT now. The integers you'll from 'put the openProcessIDs' are NOT going to be 1,2,3,... but numbers more like 3525, 3526, 3527, etc. and may not be in a perfectly sequential order if other processes were opened and then completed their run or were killed by the engine or system in the interim.

If a process is no longer running after using the kill <process> command or something like 'shell("kill " & tPID)' then the process is still in 'the OpenProcesses' list, BUT the corresponding number in the list returned by 'the OpenProcessIDs' will be now be 0 (zero) for that line (the process is not running). I'll have to check tonight to see what happens with that number if I then re-run that process (I'm guessing it would get a new PID). The other part that I italicized can't be accurate either, since the numbers may not be perfectly sequential and definitely do not start at one.

The 'put the processID' definitely returns the PID number for the engine itself, the same number you would see with 'top' command in the terminal. It seems 'the openProcessIDs' does as well, which means it is much more useful information, since the order of the list is already in a sequential order that reflects the order in which the (sub)processes were launched (1,2,3 etc.) it would just be redundant information. I would note that it should only be these Engine launched processes, which are child-processes, that can be manipulated. Since they are spawned from our Engine's process they should inherit the same privileges as the parent process (OXT Engine in our case), and also likely means they need to have ABI (Application Binary Interface) compatibility, which means 'no mixing architectures' like no using an ARM binary child process from a parent process that's an x86 Intel binary (via Rossetta2 I'm not 100% certain about).

The docs mention that support for 'read from process' on OS X was added in RunRev 2.0, that's decades ago so I'm guessing the returned values have changed at some point and the docs just never got updated.
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by OpenXTalkPaul »

FourthWorld wrote: Tue Jan 30, 2024 1:20 am
richmond62 wrote: Mon Jan 29, 2024 5:21 pm Where I wrote 'pruning' I meant removing text relating to defunct systems.
What's the ID number of your bug report flagging "Unix" needing to be changed to "Linux"?

Bonus question: with LC's user base as small as it is, and Linux folk making up less than 3% of computer users, and the processID being very rarely needed, will the number of affected people be greater than 0?
The number will be at least 1 since I've written bunches of stacks that use CLI child-processes.

It's a damn shame if I'm the only one using this mechanism because it's incredibly useful on Linux AND Mac OS and probably Windows too, for making user interfaces for great FOSS tools like FFMPEG or ImageMagick.

At one point I even built most of custom ( Joystick + Trackball driven ) interface for my Arcade Cabinet that launched Emulators+ROMs (I see Tom Perry has had an interest in that as well). Never quite got it to a 'release' quality. I became too distracted trying to re-make the UI as X-Bar style interface that used SVG graphics (see Playstation 3+ 'X-bar' interface, or look at Emulation Station). Then RetroArch became all-encompassing while my UI was written for a bunch of separate standalone emulators (on SnowLeopard originally), and so since RetroArch already allows for custom UIs and Emulation Station Mac builds became available, I abandoned that project and now use Batocera Linux in my Arcade Cabinet (look it up, it's great!).
FourthWorld
Posts: 280
Joined: Sat Sep 11, 2021 4:37 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by FourthWorld »

OpenXTalkPaul wrote: Tue Jan 30, 2024 3:42 am
FourthWorld wrote: Tue Jan 30, 2024 1:20 am
richmond62 wrote: Mon Jan 29, 2024 5:21 pm Where I wrote 'pruning' I meant removing text relating to defunct systems.
What's the ID number of your bug report flagging "Unix" needing to be changed to "Linux"?

Bonus question: with LC's user base as small as it is, and Linux folk making up less than 3% of computer users, and the processID being very rarely needed, will the number of affected people be greater than 0?
The number will be at least 1 since I've written bunches of stacks that use CLI child-processes.
Precisely. The docs using "Unix" where it should have been updated to read "Linux" did not stop you from making good use of the function.
FourthWorld
Posts: 280
Joined: Sat Sep 11, 2021 4:37 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by FourthWorld »

OpenXTalkPaul wrote: Tue Jan 30, 2024 3:09 am There is (was, I removed it from the OXT Dictionary) in the docs an incorrect blurb about on 'macOS AND OS X' systems
Thank you for updating the OXT docs on this.
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by OpenXTalkPaul »

FourthWorld wrote: Tue Jan 30, 2024 4:07 pm
OpenXTalkPaul wrote: Tue Jan 30, 2024 3:42 am
FourthWorld wrote: Tue Jan 30, 2024 1:20 am
richmond62 wrote: Mon Jan 29, 2024 5:21 pm Where I wrote 'pruning' I meant removing text relating to defunct systems.
What's the ID number of your bug report flagging "Unix" needing to be changed to "Linux"?

Bonus question: with LC's user base as small as it is, and Linux folk making up less than 3% of computer users, and the processID being very rarely needed, will the number of affected people be greater than 0?
The number will be at least 1 since I've written bunches of stacks that use CLI child-processes.
Precisely. The docs using "Unix" where it should have been updated to read "Linux" did not stop you from making good use of the function.
?
I'm using this on macOS (which I guess is a certified BSD UNIX), so it should read something like macOS, Linux, and Unix (if we re-built the Engine for like FreeBSD) or derivatives (or maybe something like 'POSIX compliant OSes' ) anyway it's bothered me that it doesn't include 'macOS' when it does work OK on modern Mac OS.

It also bothers me that we have no library for handling/juggling multi-processes we may have running (like multiple, async data downloads). I have some function that do things like for starters marry up the list (get a unified list with both PID and the command that was used to launch the process ), and wrap shell commands (dealing with the nested quotes).
If no one else is using processes like this, maybe it's because it's kind of a pain to script it, requiring setting up 'send' timer loop(s) that check for in/out from processes, and then maybe handle firing of your own 'pseudo' call backs into the message path. Good libraries can help make things easier in the long run, handle the tedious parts and get right into seeing what a given command you might be trying can actually do. There's tons of switches for some of these command line apps, ImageMagick even has its own scripting lang you can use, so I don't want to have to spend a ton of time trying to figure out what's not working when I simply didn't manually wrap a "&quoute&" line correctly. Anyway, that's another thing I'd like to work on.
I already have a stack that is sort of a command-line $PATH directory browser that's useful for reading --help and man pages and quickly trying out a command, probably include it in OXT Ultra-Heavy :-D
FourthWorld
Posts: 280
Joined: Sat Sep 11, 2021 4:37 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by FourthWorld »

If it still works on macOS that would seem to merit a bug report.
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by OpenXTalkPaul »

FourthWorld wrote: Tue Jan 30, 2024 7:38 pm If it still works on macOS that would seem to merit a bug report.
I don't even see this as a bug, to me it's a nice feature. If you mean bug report for docs update, I changed the OXT repo docs. I was told not to use their bugzilla to report bugs I find... or was it just don't post my fixes because they can't use it due to the GPL license over here? Either way I'm staying away from that.

Anyway it will be in my next docs build.

I think the glossary should be expanded too, adding more general programming terms like 'statically typed variables', maybe even some terms like 'Grok' :-P , could add some a little at a time, a few each time I rebuild the dictionary... or maybe just stick to straight CompSci definitions as the dictionary is already kind of large?
People can always look up terms like that on Wikipedia or whatever...http://catb.org/~esr/jargon/html/G/grok.html
FourthWorld
Posts: 280
Joined: Sat Sep 11, 2021 4:37 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by FourthWorld »

OpenXTalkPaul wrote: Wed Jan 31, 2024 1:09 am If you mean bug report for docs update, I changed the OXT repo docs.
Well done. Thank you.
TerryL
Posts: 66
Joined: Sat Oct 16, 2021 5:05 pm
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by TerryL »

I looked through my notes and found four dictionary entries that might be updated, if you haven't done them already.

1) printMargins. Currently implies only for printing cards. The printMargins property works with printing cards, fields, and text. Print margin changes remain in effect after the print handler ends. It reverts to default 1 inch ("72,72,72,72") after quitting the program. Set the printMargins to "36,36,36,36" --.5"=36px, 1"=72px, L,T,R,B. (you can verify with answer page setup or in msg box: put the printMargins.)

2) ask password. The mcEncrypt() example should be removed, mcEncrypt is for internal use only. The entry uses bullets now, not asterisks (*). This seems to have encrypted the user response in the past, but was changed to be the same as ask password clear (at least in win10). The dictionary does mention this, but could be clearer that there is currently no difference between ask password and ask password clear.

3) videoClip. Remove reference to Quicktime.

4) systemVersion. Add Windows 11: "NT 11.0". Add what Linux returns for a few versions. As I understand, Mac keeps counting using 10.x.0, so list from MacOS 11 to MacOS 14. (I think MacOS 14: "10.17.0", so is MacOS 11: "10.14.0"?)
User avatar
tperry2x
Posts: 1533
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Mac OS (classic) vs MacOS (X+) Dictionary corrections

Post by tperry2x »

TerryL wrote: Sat Feb 03, 2024 6:24 pm As I understand, Mac keeps counting using 10.x.0, so list from MacOS 11 to MacOS 14. (I think MacOS 14: "10.17.0", so is MacOS 11: "10.14.0"?)
I'm working on recompiles, however stuck for the reasons I mention.
On page 9 of the 9.6.8 release notes, they fix the systemversion bug properly - so my updated 9.7 DP1 LCC engine code should contain this fix (I hope).

https://www.openxtalk.org/forum/viewtop ... 6293#p6293
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests