LCB?

All flavors welcome.
Forum rules
Be kind.
Post Reply
User avatar
richmond62
Posts: 2776
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

LCB?

Post by richmond62 »

I am wondering (slightly in the light of a recent discussion "on the other side") whether OXT should try to provide some sort of introductory lessons to LCB: which must rank as one of the world's least documented programming languages.

Certainly this: https://livecode.com/topic/creating-an-lcb-library/ won't cut "it" for a lot of beginners:
-
Screenshot 2024-01-21 at 12.32.39.png
Screenshot 2024-01-21 at 12.32.39.png (124.05 KiB) Viewed 933 times
-
For starters this:
-
Screenshot 2024-01-21 at 12.34.54.png
Screenshot 2024-01-21 at 12.34.54.png (37.92 KiB) Viewed 933 times
-
Geekspeak is symptomatic of people who have no experience of teaching.

Rule number 1 of teaching (especially a new subject): assume your pupils/students know NOTHING, so everything (especially terminology) has to be explained in the simplest possible terms.

Rule number 2 of teaching (if your learners already have some competence in the target subject area): work on the 'L + 1' rule: teach them something that is just ahead of what they already know: do NOT hurl them in the deep end of the swimming pool when all they know is how to flounder around with water-wings.

Here's an illustration of how 'instructors' tend to assume learners know something which they, the instructors, have not bothered to find out whether they, the learners, do or not:
-
Screenshot 2024-01-21 at 12.39.57.png
Screenshot 2024-01-21 at 12.39.57.png (37.4 KiB) Viewed 933 times
-
The learner may NOT know how to save a file with a suffix that is different from the one supplied by their text editing application.

The other, incidental, shag about those slides from "the other side" is that they are not downloadable, and so not portable.
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 2776
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: LCB?

Post by richmond62 »

Aha . . .

You can export each of those slides as a PDF with Safari. 8-)

Mind you, those crossed-out bits make me feel a bit lumpy (let's hope its just something screwy with the text rendering):
-
Screenshot 2024-01-21 at 12.59.35.png
Screenshot 2024-01-21 at 12.59.35.png (22.84 KiB) Viewed 920 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 2776
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: LCB?

Post by richmond62 »

The Atom text-editor has gone:
-
Screenshot 2024-01-21 at 13.04.25.png
Screenshot 2024-01-21 at 13.04.25.png (24.77 KiB) Viewed 918 times
-
Screenshot 2024-01-21 at 13.06.14.png
Screenshot 2024-01-21 at 13.06.14.png (58 KiB) Viewed 917 times
-
You have to admire "the other side" for being "so" busy on their product development they cannot spare anyone to keep their website and so on up to date.

HOWEVER, for those who are prepared to fiddle around:

https://github.com/atom/atom/releases/tag/v1.60.0

Not that it will do you much good:
-
Screenshot 2024-01-21 at 13.13.18.png
Screenshot 2024-01-21 at 13.13.18.png (110.14 KiB) Viewed 917 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 2776
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: LCB?

Post by richmond62 »

Probably a better bet, on MacOS, to stick to BBEdit:
-
Screenshot 2024-01-21 at 13.14.54.png
Screenshot 2024-01-21 at 13.14.54.png (53.28 KiB) Viewed 916 times
-
Redundant slide:
-
Screenshot 2024-01-21 at 13.18.48.png
Screenshot 2024-01-21 at 13.18.48.png (267.57 KiB) Viewed 913 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 2776
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: LCB?

Post by richmond62 »

My experience with 9-12 year old children is that they do NOT know the Geekspeak I learnt in 1984 at the university of Durham; so.obviously, I have had to update my Geekspeak from terms such as 'directory' to 'folder':
-
Screenshot 2024-01-21 at 13.20.53.png
Screenshot 2024-01-21 at 13.20.53.png (30.7 KiB) Viewed 911 times
-
What comes out of my examination of ONLY the first 12 or so slides of the LiveCode LCB course are these points:

1. It is designed for people who are already fairly competent at computer programming and understand a lot of computer meta language.

2. It is out of date.

Obviously this is NOT suitable as some sort of absolute beginners course, nor even for that matter, a course for people who have ONLY worked with LC/OXT for a fairly short time.
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1538
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: LCB?

Post by tperry2x »

Hi Richmond,
I covered the sunsetting of Atom here
viewtopic.php?p=5639#p5639
You can use Pulsar, and I also included the Livecode syntax files

For LCB, please see the section in the guides:
builder.png
builder.png (126.86 KiB) Viewed 899 times
Livecode builder is not at all easy, and Paul is probably the best person to ask as he definitely has a handle on creating things with it.
viewtopic.php?p=5855#p5855
User avatar
richmond62
Posts: 2776
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: LCB?

Post by richmond62 »

Whoops: I am still looking at 0.99 where things "look different".

Where would the download link be?
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1538
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: LCB?

Post by tperry2x »

That is included in v0.99 as well. :D
From the toolbar - user guides, or help menu - might have to turn on the "Use 'All Guides' stack" in Preferences > Dictionary
guides-in-099.png
guides-in-099.png (147.63 KiB) Viewed 873 times
User avatar
richmond62
Posts: 2776
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: LCB?

Post by richmond62 »

OK: got that.

But, as I have stated here and "elsewhere" that's a fat lot of good for new users.

(after all, what you have done is repackaged LC's documents in an different presentation stack.)
The first thing that, IMHO, needs to be made explicitly clear it its relationship with LiveCode:

1. Is LCB a full-blown programming language which can be used completely independently of LC?

2. Is LCB a sort of semi-complete language which can only be used 'hooked on' to LC to extend LC's capabilities?

3. Something somewhere between #1 and #2?
As a 10 year old I know (my younger son, 18 years ago) managed to produce a functioning calculator ("F*ck off, Dad, I can do it myself.") with ONLY the LC setup, it would be super if there were a way a 10 year old could do something with LCB completely by themselves . . .
In an ideal world this would probably have to be worked out with several focus groups:

1. Half a dozen 9-12 year olds who are "wet behind the ears."

2. Half a dozen adults who are "wet behind the ears."

3. Half a dozen adults who have worked with LiveCode for quite some time.

4. Half a dozen adults who are competent in programming languages other than LiveCode.

And, quite obviously, whoever were to conduct these focus groups who have to be competent in LCB already (so, no, Richmond is not offering to do any of these focus groups, for the simple reason that he knows less about LCB than about speaking Cambodian).

Like anything else that does not result in a half-c*ck job this would involve time and money.
To which I WOULD add, in our slightly different situation (3 programmers and a dog . . . "Woof, Woof!"), would be - somehow to get something going with LCB that would make more sense than the thing I criticised earlier (LC's in-house slide show for people who already understand quite a bit): even, possibly a dedicated series of threads within these forums.

Personally this gives me the "screaming ab-dabs", especially as, when I was learning programming languages (BASIC 5, FORTRAN IV, PASCAL 5) nobody mentioned 'tokens'. One can only imagine what some 10 year old is going to make of it, or, for that matter, my friend Georgi (parent of a kid I teach, who is 40) is going to understand (even though he IS getting somewhere with xTalk):
-
Screenshot 2024-01-21 at 16.30.16.png
Screenshot 2024-01-21 at 16.30.16.png (115.04 KiB) Viewed 858 times
-
"The structure of tokens" . . . WOT?
Identifiers declared in a module are placed in a scope named using the module name. This allows disambiguation between an identifier declared in a module and an identical one declared in any of its imports, by using a fully qualified name.
I cannot pretend to understand that: and I have 47 years of computer programming experience: sometimes I wonder how I have managed to survive without knowing WTF tokens, namespaces, and modules are.

But I have, and have produced effective software for the last 32 years without that knowledge: and what it 100% crystal clear to me is that all for very jazzy terms will NOT help any would-be learners whatsoever.

Like everything else in the 'Dictionary', all that stuff is for people who ALREADY have their skates on: and the problem is how to get new boys and girls to the state that they can use that documentation to achieve anything useful.
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1538
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: LCB?

Post by tperry2x »

richmond62 wrote: Sun Jan 21, 2024 2:22 pm after all, what you have done is repackaged LC's documents in an different presentation stack.
A lot more than that actually, I've corrected a lot, but okay...
richmond62 wrote: Sun Jan 21, 2024 2:22 pm But, as I have stated here and "elsewhere" that's a fat lot of good for new users.
Noted, but do you think I understand LCB?
I'm not going to change it if I don't know what I'm changing it to. In the absence of anyone else offering anything constructive...
User avatar
richmond62
Posts: 2776
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: LCB?

Post by richmond62 »

A lot more than that actually, I've corrected a lot, but okay...
Fantastic: but I do not have the time to go through all the documentation with a fine-toothed comb.
I'm not going to change it if I don't know what I'm changing it to.
I am not suggesting that you DO change it.

What I am doing is raising the issue that we might need a "Goofy Guide to LCB" which LiveCode certainly has not done.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: LCB?

Post by OpenXTalkPaul »

richmond62 wrote: Sun Jan 21, 2024 11:07 am The Atom text-editor has gone:
-
Screenshot 2024-01-21 at 13.04.25.png
-
Screenshot 2024-01-21 at 13.06.14.png
-
You have to admire "the other side" for being "so" busy on their product development they cannot spare anyone to keep their website and so on up to date.

HOWEVER, for those who are prepared to fiddle around:

https://github.com/atom/atom/releases/tag/v1.60.0

Not that it will do you much good:
-
Screenshot 2024-01-21 at 13.13.18.png
This was mentioned recently here in another thread. GitHub dropped support for the Atom Coding Text editor. But there's a an independent fork called Pulsar, and all of Atom's add-on packages repo are now available through that app (including the LC/LCS/LCB language support packages.

I downloaded those slides somehow, they were being publicly shared via Google Docs. I also have the linked files that go with it. I'll upload later.

I agree we could certainly use a better introductory tutorials and how-tos for Extension Builder (specially for making language modules, as there is zero documentation on that aspect), there was some effort to make a community info resource 'Missing Manual' for Extension Builder on GitHub, initiated by MacMikey IIRC (sorry, I don't know their RL name), but that hasn't seen much activity recently.

Personally I think its a damn shame they more effort to get people to adopt it.

Which recent announcement are you referring to? Are they dropping LCB support or something?
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: LCB?

Post by OpenXTalkPaul »

I answered this before with 'Something in between', because Extension builder does compile (not interpreted like script) bytecode modules and it does have language features, like statically typed variables, that are similar to lower-level languages like C++, but it was also made to look similar xTalk script. It was designed as a replacement for the 'Externals SDK' (externals such as revSpeak, mergRecorder, etc.), the idea being to make it easier for more regular xTalk scripters to write add-ons for the Engine. There is included an command-line app called lc-run that can execute modules without the scripting engine (a lot of like using WebAssembly .wasm files from the command-line, which is also possible to do).

I put this Extending...Extension Builder Guide into the Advanced category though, because it's not for beginners and it's not entirely complete either (but we can add to it).

You can make custom controls (widgets) with it but you have to learn some of its Canvas drawing API, which is similar to Turtle graphics/postscript/SVG commands (move-to, line-to, curve-to , etc.). To use the Foreign Function Interface (libFFI, which is commonly used in other scripting languages such as Python, Lua, etc.), to hook into C,++,ObjC,JAVA,JavaSCript libraries or OS APIs requires some understanding of those other languages and the APIs you want to tap into, and requires to make the binding strings, which prepares those external functions to be used from Extension Builder / script by providing some needed info such as what type of variable each parameter is expecting and what type of data it returns.

You also need to learn a bit about the MetaData that it was designed to use for things like creating property controls for the property inspector or for adding in-line documentation (which gets parsed into the dictionary when an Extension is installed). This is a particularly good area to add some Extension Builder documentation or some sort of widget template maker tool. I always have to look up what tags can be used and what property-inspector editors names are. AI started a pre-made template 'widget' that was set-up with basic properties (like the 'Pink Circle' demo but with a lot more of the Meta Data stuff filled in). Another thing is the sub-directories / files that can be added, like to include a 'Guide' or have default scripts (like a pre-filled out 'on mouseDown' handler for one example), and how exactly to set it up so that the Builder picks up and packs all of those files (sometimes getting those default-scripts to work is a PIA)

The best way to learn Extension Builder is the same way that's best to learn xTalk script IMO, which is by looking at existing examples (probably the majority of those examples are from me, sorry) and pulling them apart to see how they work, and also a lot of trial and error. I have picked up some debugging techniques and written some helper handlers to make some things little bit easier.

I would like to do something on this 'Learn Extension Builder' front. If I could get one or two of you guys up to speed on making Extension Builder modules and writing FFI strings to tap into stuff like GTK (which that alone is sometimes is a lot of work), it could help expand possibilities in different areas of interest for all of us. There's just so much to do it's a bit overwhelming sometimes to even know what should be worked on and in what order.
A lot of useful things can be done with it and some things (like wrapping a small and simple API such as NSSound), are not all that hard to do once you are familiar with language and its development workflow.
User avatar
tperry2x
Posts: 1538
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: LCB?

Post by tperry2x »

In much the same way as menu builder will help you put together menus, would it be possible to have a 'lcbMaker' (name not important, but you get the idea), that puts LCB code together for you to customise later?

"xTalk-Builder's buddy"
"XTBuilder Assistant"...

You choose from dropdown menus what you want it to do, like putting something together in automator on MacOS. You don't need to know the LCB language, just have an idea of what you want to create.

The idea is it'd allow you to save, load, edit your LCB code and walk you through it.

Something like this idea.
Mac-Automator-PDF-to-Image-579937649.jpg
Mac-Automator-PDF-to-Image-579937649.jpg (492.84 KiB) Viewed 689 times
You didn't need to know or understand applescript to use it, you just chose what you wanted it to do - you can then save this as a mini-application.

So, similar idea: a user could pick what they wanted their lcb extension to do from a series of presets/drop-down menus, then let it write the lcb script for them?
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: LCB?

Post by OpenXTalkPaul »

tperry2x wrote: Tue Jan 23, 2024 8:24 am In much the same way as menu builder will help you put together menus, would it be possible to have a 'lcbMaker' (name not important, but you get the idea), that puts LCB code together for you to customise later?

"xTalk-Builder's buddy"
"XTBuilder Assistant"...

You choose from dropdown menus what you want it to do, like putting something together in automator on MacOS. You don't need to know the LCB language, just have an idea of what you want to create.

The idea is it'd allow you to save, load, edit your LCB code and walk you through it.

Something like this idea.
Mac-Automator-PDF-to-Image-579937649.jpg
You didn't need to know or understand applescript to use it, you just chose what you wanted it to do - you can then save this as a mini-application.

So, similar idea: a user could pick what they wanted their lcb extension to do from a series of presets/drop-down menus, then let it write the lcb script for them?
Yet another thing I've wanted to work on, some sort of Extension Builder helper tool. I can think of quite a bit of functionality that would be useful. Particularly for Widgets where there's a lot of 'classic control' properties that can be used, to have checkboxes to pick which ones to use and have all the associated metadata for each auto-filled out, that would be very helpful to me, and probably anyone who's just getting started. I would probably just have it make a square with a border (maybe with transparency and/graduations to provide a little more example syntax) by default. Probably most realistic to go for a basic template generator sort of stack, similar to menu builder. Trying to build a 'No Code' UI for LCB that's similar to Automator would be a lot I think (but maybe it could be built on it in later iterations).

I also have some general purpose handlers I could include in a snippets collection menu or something like that. These would be handlers that do basic useful things like divide the widget area into boxes in an X/Y Grid, do object introspection like log info about any NSObject passed to it (useful for macOS/iOS/Objective C stuff), reverse the byte order of a 4byte integer, or convert a 4byte integer to a 4char Code (used by some APIs), etc. This would be more towards the direction of an Extension Builder IDE of sorts.

I have already wrapped a good amount of generally useful Objective C objects/methods (NSObjects,NSArrays,NSImage, etc.) but I had planned that I would eventually put all of those into a library module that can then easily be reused just like an C #INCLUDE (in LCB the equivalent is 'use'), and then include it with the IDE.

In comparing to AppleScript I think the regular xTalk script would be like AppleScript and Extension Builder would be like AppleScriptObjC or like writing an OSAX (Open Scripting Architecture Extension, which would be coded in C++, Objective C, or Swift)

I really want a 'Palette Builder' stack! HyperCard had one and I think it would be nice to have one that's loosely model on that. This would make palettes of buttons grids that could have text, svg graphics and/or image data and that in its basic form each button sends (post) a simple callback messages to the scripting engine (in HC's Palettes you could add up to 32K of HyperTalk script to each button too). This could also have some auto-fill-scripts checkboxes for things like enable drag-drop in your output palette stack or add a script to enable a key combo to open the pallet as editable topLevel.
Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests