Replace LiveCode Script with JavaScript, forever

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5056
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Replace LiveCode Script with JavaScript, forever

Post by richmond62 » Tue Aug 11, 2020 10:26 am

And here is, as you might say, the image that makes a certain point re my remarks:
-
Screenshot 2020-08-11 at 12.22.59.png
-
Look to the left!

Ooooo: it's Javascript.

And so it goes;
-
Screenshot 2020-08-11 at 12.25.49.png

bogs
Posts: 4791
Joined: Sat Feb 25, 2017 10:45 pm

Re: Replace LiveCode Script with JavaScript, forever

Post by bogs » Tue Aug 11, 2020 11:11 am

richmond62 wrote:
Tue Aug 11, 2020 7:46 am
No constructive point in the OP's original post
I do think a bit more documentation about how one might connect "something" written in LiveCode
with "something" written in another programming language might not be a bad thing.
FourthWorld wrote:
Tue Aug 11, 2020 8:14 am
Here's a good starting point:
https://livecode.com/resources/api/#liv ... ript/shell
@ Richard -
I have to admit, Richard, I'm not sure how 'shell' would be used as a bridge from Lc to say, any other programming language either, unless you mean to write out and save a code snippet, then use shell to execute it at system level. The question would then be how you get any information back from said execution?

@ Richmond -
Hybrid programming might prove quite useful under certain circumstances; and while that
probably sounds like rediscovering the wheel, a way to make a 'wheel' using LiveCode that was well
documented would be a good thing.
I'd agree with that (the documentation part), but hybrid programming is nothing new. You've had experience with BBC basics, and while I don't know much about that family specifically, I *do* know that lots of other basics (and a few other high level languages) had inline assemblers or even the ability to use straight up binary available in them to speed up things they were just too slow at.

It wouldn't be much of a leap to think Lc could do the same, but I'm not sure of the benefit if it were applied to say, inline scripting of another scripting language ;)
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5056
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Replace LiveCode Script with JavaScript, forever

Post by richmond62 » Tue Aug 11, 2020 11:19 am

HyperCard of course . . .

All pause for bowing heads and muttering "ॐ, ॐ,ॐ" at mention of HyperCard.

did allow AppleScript inline . . .

bogs
Posts: 4791
Joined: Sat Feb 25, 2017 10:45 pm

Re: Replace LiveCode Script with JavaScript, forever

Post by bogs » Tue Aug 11, 2020 11:32 am

That isn't still available in Lc? Shows how little I know :P :P

However, I was referring to a completely different scripting language, in this case .js :P
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5056
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Replace LiveCode Script with JavaScript, forever

Post by richmond62 » Tue Aug 11, 2020 11:40 am

https://livecode.com/infinite-livecode-an-example/

"The engineering team at LiveCode recently published a technical whitepaper on how we’d like to make LiveCode Builder interoperate better with other languages by improving its so-called ‘foreign function interface’."

Aha . . .

Well, not quite what I meant.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8139
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Tue Aug 11, 2020 4:05 pm

richmond62 wrote:
Tue Aug 11, 2020 10:26 am
And here is, as you might say, the image that makes a certain point re my remarks:
-
Screenshot 2020-08-11 at 12.22.59.png
-
Look to the left!

Ooooo: it's Javascript.

And so it goes;
-
Screenshot 2020-08-11 at 12.25.49.png
JavaScript is used for the Dictionary, which is displayed using a Browser widget.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8139
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Tue Aug 11, 2020 4:09 pm

bogs wrote:
Tue Aug 11, 2020 11:11 am
richmond62 wrote:
Tue Aug 11, 2020 7:46 am
No constructive point in the OP's original post
I do think a bit more documentation about how one might connect "something" written in LiveCode
with "something" written in another programming language might not be a bad thing.
FourthWorld wrote:
Tue Aug 11, 2020 8:14 am
Here's a good starting point:
https://livecode.com/resources/api/#liv ... ript/shell
@ Richard -
I have to admit, Richard, I'm not sure how 'shell' would be used as a bridge from Lc to say, any other programming language either, unless you mean to write out and save a code snippet, then use shell to execute it at system level. The question would then be how you get any information back from said execution?
In LC, shell is a function; any result from executing it will be the return value.

It's fun to play with - consider exploring with bash to get a feel for how it works. Using rsync with it is even more fun (and very practical, since you can make your own rsync GUI to run your backups with it).
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8139
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Tue Aug 11, 2020 4:13 pm

richmond62 wrote:
Tue Aug 11, 2020 11:19 am
HyperCard of course . . .

All pause for bowing heads and muttering "ॐ, ॐ,ॐ" at mention of HyperCard.

did allow AppleScript inline . . .
Similarly, LC offers "do <otherLanguageStatements> as...", where the "as" clause specifies the target language, where the target language can be any of the host-OS-provided options returned with the alternateLanguages function.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8139
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Tue Aug 11, 2020 4:14 pm

richmond62 wrote:
Tue Aug 11, 2020 11:40 am
https://livecode.com/infinite-livecode-an-example/

"The engineering team at LiveCode recently published a technical whitepaper on how we’d like to make LiveCode Builder interoperate better with other languages by improving its so-called ‘foreign function interface’."

Aha . . .

Well, not quite what I meant.
The list of things not wanted may be infinite. Can you describe what you do want?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bogs
Posts: 4791
Joined: Sat Feb 25, 2017 10:45 pm

Re: Replace LiveCode Script with JavaScript, forever

Post by bogs » Tue Aug 11, 2020 4:24 pm

FourthWorld wrote:
Tue Aug 11, 2020 4:13 pm
Similarly, LC offers "do <otherLanguageStatements> as...", where the "as" clause specifies the target language, where the target language can be any of the host-OS-provided options returned with the alternateLanguages function.
Pretty useless on 'nix though, as it is only supported on Mac, Win, and html5.
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8139
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Tue Aug 11, 2020 5:07 pm

bogs wrote:
Tue Aug 11, 2020 4:24 pm
FourthWorld wrote:
Tue Aug 11, 2020 4:13 pm
Similarly, LC offers "do <otherLanguageStatements> as...", where the "as" clause specifies the target language, where the target language can be any of the host-OS-provided options returned with the alternateLanguages function.
Pretty useless on 'nix though, as it is only supported on Mac, Win, and html5.
Lot's of things are "useless" on Linux (macOS is a certified Unix), like LC's window registry functions, support for macOS bundles, hardware integration for mobile devices, and other platform-specific features.

Most interoperability on Linux is done with stdin and stdout, where LC's shell function is the natural go-to.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5056
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Replace LiveCode Script with JavaScript, forever

Post by richmond62 » Tue Aug 11, 2020 5:13 pm

Can you describe what you do want?
Prickle, prickle . . . 8)

Seems I did that earlier:
What I meant is, for the sake of argument, to program a front-end in LiveCode and some of the
"heavy lifting round the back" in another language and be able to "spit out" a standalone application at the end of the work.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5056
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Replace LiveCode Script with JavaScript, forever

Post by richmond62 » Tue Aug 11, 2020 5:23 pm

the host-OS-provided options returned with the alternateLanguages function
-
Well, yeah:
-
Screen Shot 2020-08-11 at 7.17.11 pm.png
-
But that completely misses the point.

I don't want to use Applescript in LiveCode (I want to use LiveCode). 8)

BUT I want, when I "get stuck" with LiveCode (or, far more likely, when I find I can do somethings rather
more easily in, say, LISP), to do part of my programming work outwith the LiveCode IDE and then connect that work with
my LiveCode work into one functioning unit.

A chap who lives in my block of flats is a 'serious programmer' (i.e. not like Richmond)
and regularly does programming on the same project in C, C++, C#, PASCAL and Java.
Attachments
Babel.livecode.zip
Grab it while its lukewarm.
(977 Bytes) Downloaded 17 times

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8139
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Tue Aug 11, 2020 8:05 pm

richmond62 wrote:
Tue Aug 11, 2020 5:13 pm
Can you describe what you do want?
Prickle, prickle . . . 8)

Seems I did that earlier:
What I meant is, for the sake of argument, to program a front-end in LiveCode and some of the
"heavy lifting round the back" in another language and be able to "spit out" a standalone application at the end of the work.
I wouldn't want to see the company take on the considerable effort to create a standalone packager for any language that doesn't already have one.

As you say, "I want to use LiveCode".
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8139
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Tue Aug 11, 2020 8:06 pm

richmond62 wrote:
Tue Aug 11, 2020 5:23 pm
A chap who lives in my block of flats is a 'serious programmer' (i.e. not like Richmond)
and regularly does programming on the same project in C, C++, C#, PASCAL and Java.
In practical terms, what does that mean? Has he found a compiler that will let you mix all those languages in source files, and produce a single executable?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Feature Proposals”