Fjord wrote: Thu Aug 04, 2022 7:53 am
multi-developer team (…) That's why script-only stacks were invented.
That's an opinion. Or did you see that mentioned in a document from the LC team?
I was a contractor with LiveCode before v1.0. I was the LC Community Liaison during the open source years (2013-2021). I've read pretty much every post to the LiveCode mailing list since it was started just after the turn of the century, including many discussions of version control.
Yes, what I write are opinions. But they're reasonably informed opinions.
Not many people around here know for sure (doc…) the answer to my question: can I use script-only stacks as plugins?. I asked in case someone here was able to point to some document, blog, whatever, from the LC team.
I know from direct firsthand experience that the engine can open stack files, and once opened they behave just like any other stack file.
It sounds like the IDE script that loads files from the Plugins folder needs to be enhanced to include a search for files with that extension.
To confirm try renaming the file to use the "*.livecode" extension. If that works we've narrowed it down, and you might consider filling a bug report on that:
https://quality.livecode.com/
Given how few have used script-only stacks as plugins it's understandable that they haven't seen this earlier. But it should be simple enough to fix.
BTW, I see no link between script-only stacks and multi-developpers teams…
I've never seen the corn fields of Wisconsin, because I've never lived there. But when friends who do live there tell me about them, I have no reason to doubt what they're telling me.
One might think of other virtues of script-only stacks; from the top of my mind: smaller space, ability to use any text editor… which have nothing to do with multi-developer teams.
The additional space is negligible (less than 1k IIRC; you can test it by just creating a new stack with nothing in it and saving it). If you need any persistent GUI elements or custom properties, those would require scripts to instantiate, which are generally much larger than their finished binary object form.
Which script editor do you use? Some have plugins available which will let you use them with scripts stored in binary stack objects as well.
As for teams needing version control...
TL/DR:
https://github.com/livecode/livecode-ide
More detailed explanation offered because some find it useful to know the history of key developments in the engine:
Version control is a classic problem of computing, as old as team development. There are too many ways to screw up large code bases with many developers, and too much difficulty merging portions of a project with other portions of a project.
For many years there were a great many options for version control. There still are, but one has emerged as the clear leader: git, an open source package developed by the Linux kernel team to help them manage incoming changes from hundreds of core developers and thousands of contributors around the world.
For git to become truly popular required a good interface, which eventually emerged in the form of GitHub. Most public code is stored and worked on there, though GitLab has sprung up in recent years as an alternative which more fully embraces open source ethos and is quite popular as well.
The LiveCode engine is more than half a million lines of code, mostly C++. There's no practical way to manage it without a robust version control system, and git fits the bill quite nicely.
But with LiveCode's IDE being comprised of stack files, their binary format afforded no option for taking advantage of git's text-focused tooling. So the race for a textual format was on!
Beginning in the first decade of this century and continuing into the second decade until what we now call script-only stacks were invented, many options were discussed within the team, and between the team and the community via the LiveCode mailing list (in the earliest days that was the main channel; these forums didn't arrive until years later).
There was a lot of talk about using XML as a wrapper, but that seemed cumbersome. And managing GUI elements such as the IDE requires poses a whole host of challenges attempting to represent them with complete fidelity in textual form, esp given the complexities of workflows where multiple devs may be working on the same stacks simultaneously.
By the time releasing an open source edition was being considered, version control among the IDE devs had already become cumbersome; opening up that process to the world would become prohibitively cumbersome.
So I believe it was dev lead Mark Waddingham who finally sliced the Gordian knot: instead of attempting a textual format for objects, they'd make script-only stacks. Where GUI objects are needed a preOpenStack handler can be used to create those objects on the fly.
You can see this in action in nearly all of the LC IDE stack scripts. The Toolbar is a good place to explore. The engine is so efficient that it can create the LC IDE UI on the fly at startup almost as fast as it used to unpack the binary objects back when they were stored in binary stack files.
There are probably other benefits to script-only stacks, but that's the origin story.
The open source edition was officially ended on Aug 31 of last year (the old GitHub repository linked to above has temporarily remained as a community service, and will likely be removed soon).
Script-only stacks made merging contributions MUCH easier than could have been done without it, and AFAIK the team continues using git as their version control system, these days on a private server.
--
I'll close with a juicy trivia tidbit as a reward for those who read this long post all the way to the end:
At the heart of git are two key functions, diff and merge.
Diff takes two blocks of text and outputs a concise listing of the differences between them.
Merge takes the master script and the diff list and produces the changed script.
The benefit of using merge rather than just using the newer file is that you can edit the diff file to merge only the changes you want to accept, leaving other things as they were.
Both of these have quietly found their way into the LC engine, in the form of gitDiff and gitMerge functions in the LiveCode Script language.
If one had enough time on their hands they could use those to make a wide range of useful and convenient GUI version control tools.