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

PaulDaMacMan
Posts: 306
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Replace LiveCode Script with JavaScript, forever

Post by PaulDaMacMan » Fri Mar 27, 2020 1:48 am

FourthWorld wrote:
Fri Mar 27, 2020 12:37 am
The OP left the room after his first post here, two months ago.
I know, I needed a break from working and I was bored/perusing the boards and just wanted to throw in my 0.5 cents.
My LCB Repos: https://github.com/PaulMcClernan/

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

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Fri Mar 27, 2020 3:25 am

Oh, it's not just you, it's all of us. Most of the threads here have one good question at the start, a very long multi-page series of tangents and diversions, and once in a while the OP returns to tell us how the project actually turned out. And once in a while they just never come back at all.

In this case, with just a single post and a request that kinda doesn't even make any sense (if we're going for popularity why not kill all languages and everyone use Java for everything?), I'm guessing he works for one of the way-too-many JS packager IDEs and seeing LC on the TIOBE list irked him.
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: 4965
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Replace LiveCode Script with JavaScript, forever

Post by richmond62 » Fri Mar 27, 2020 10:20 am

I mentioned that I could not understand what was such a big thing about some new GUI IDE for Python that looked very shabby,
and pointed to LiveCode, on Reddit, and got such a slew of insults re LiveCode and personal insults ("you must be a cretin to use LiveCode.")
I became convinced that the Python crowd on Reddit could not "see the wood for the trees" as my old History teacher used to say.

An obsession with a single thing (religion, politics, programming language, car make) is rarely healthy.

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

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Fri Mar 27, 2020 3:59 pm

According to the Python conference sessions I've watched, it seems there are more apps in the mobile app stores made with LiveCode than with Python.

Today may have changed since I last watched them, but I don't see a lot of strong Python IDEs with mobile packagers. And given that Python had no built-in GUI support (few languages outside of xTalks do), it's not surprising, since one need to include Qt or other GUI framework in addition to the Python engine and one's own code. Not at all impossible, obviously, not apparently rare compared to the large role Python plays as a system management language.

But there's no doubt about Python's quality and popularity, so it's surprising anyone would have an insecurity complex over 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/

okk
Posts: 132
Joined: Wed Feb 04, 2015 11:37 am

Re: Replace LiveCode Script with JavaScript, forever

Post by okk » Mon Jul 06, 2020 12:44 pm

richmond62 wrote:
Fri Mar 27, 2020 10:20 am
some new GUI IDE for Python that looked very shabby,
What was the name of that IDE? I am looking for something - even shabby - to make apps that have a dedicated GUI for executing python code, but I seem unable to find anything that gets close to Livecode in terms of development speed and user friendliness. I checked the Qt Creator IDE which seemed somewhat similar to LC, but workflow with python was still pretty cumbersome.

In my ideal world I would use LC for most of the development tasks like for example creating the user interface and the user interactions, but I could also access from within my LC program the fantatstic python libraries like for machine learning and so on. I know about shell function but I am not sure I fully understand how it could interact with python code.

And i disagree with the OP btw.

Best
Oliver

mrcoollion
Posts: 577
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Replace LiveCode Script with JavaScript, forever

Post by mrcoollion » Mon Jul 06, 2020 1:45 pm

On Windows, it is pretty easy to run Python scripts.
Just install Python for Windows https://www.python.org/downloads/windows/

Use Shell to execute a python script like this (put the script in a button and put print ("Hello world") into the script).

Code: Select all

on mouseUp
   -- put "c:\Python33\python c:\Python33\PAG_TestScript.py"&cr into tCommandline // This works
   put "py c:\Python33\MyTestScript.py"&cr into tCommandline // Shorter and works also
   set hideConsoleWindows to true
   put shell(tCommandline) into tResult
   set hideConsoleWindows to false
   answer tResult
end mouseUp

okk
Posts: 132
Joined: Wed Feb 04, 2015 11:37 am

Re: Replace LiveCode Script with JavaScript, forever

Post by okk » Sun Jul 12, 2020 3:04 pm

Thanks mrcoollion!
I slowly get familiar with the shell function. I can see how it could work on my own machine. Im my case I want to use python libraries to do some speech recognition and processing with the resulting data feeding back into my livecode application. But how would this work when I want to deliver a standalone application that uses those python scripts? i cannot expect that my users install python and the needed libraries. Could I in theory create an executable from the python scripts (via Pyinstaller for example) and then call this executable from Livecode? But perhaps this discussion should go to another thread on LC and python. Oliver

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

Re: Replace LiveCode Script with JavaScript, forever

Post by richmond62 » Sun Jul 12, 2020 6:27 pm

In my ideal world I would use LC for most of the development tasks like for example creating the user interface and the user interactions, but I could also access from within my LC program the fantatstic python libraries like for machine learning and so on. I know about shell function but I am not sure I fully understand how it could interact with python code.
Um, erm, yes . . . we all have an "ideal world" . . . but, for some funny reason . . . 8)

mrcoollion
Posts: 577
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Replace LiveCode Script with JavaScript, forever

Post by mrcoollion » Mon Jul 13, 2020 12:20 pm

okk wrote:
Sun Jul 12, 2020 3:04 pm
Thanks mrcoollion!
i cannot expect that my users install python and the needed libraries.
There is a portable version of Python available. This makes it possible for you to add the portable python version to your own application install. E.g. https://www.pythonanywhere.com/
This way your user will not have to install Python.

Just an idea......

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

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Mon Jul 13, 2020 4:23 pm

Which OSes don't come with Python preinstalled?
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: 4790
Joined: Sat Feb 25, 2017 10:45 pm

Re: Replace LiveCode Script with JavaScript, forever

Post by bogs » Mon Jul 13, 2020 7:03 pm

Windows, I suspect, and I don't think iOS or Android? This reply from S.O. would tend to confirm at least most Windows vers. don't have it.
https://stackoverflow.com/questions/11057926/what-are-the-list-of-os-that-have-python-preinstalled-and-which-versions#11058049 wrote: There is no such list. However, I think you can safely assume every generic, modern Linux distro will have Python installed (every recent (>2years) with Python 2.5 at least), as well as most Unix SOs (FreeBSD, Solaris etc.). Mac OS X also comes with Python. OTOH you cannot expect it from most Window machines - just a few have Python by default.
As well, there is this little bit from the Python FAQ...
https://docs.python.org/3/faq/installed.html wrote: - Some Windows machines also have Python installed. At this writing we’re aware of computers from Hewlett-Packard and Compaq that include Python. Apparently some of HP/Compaq’s administrative tools are written in Python.

- Many Unix-compatible operating systems, such as Mac OS X and some Linux distributions, have Python installed by default; it’s included in the base installation.
Note that even in the 'nix / BSD world, it is hardly universal, although far more common than say, on Windows.
Image

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

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Mon Jul 13, 2020 7:15 pm

Thanks, Bogs. I can understand mobile OSes not including Python, but on the desktop I guess I've been taking Windows Subsystem for Linux for granted for so long I've forgotten it's not active by default.
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: 4790
Joined: Sat Feb 25, 2017 10:45 pm

Re: Replace LiveCode Script with JavaScript, forever

Post by bogs » Mon Jul 13, 2020 7:38 pm

bogs wrote:
Mon Jul 13, 2020 7:03 pm
and I don't think iOS or Android?
I probably didn't say this part clear enough, I should have said "I know absolutely nothing about mobile, but I don't think it is pre-installed on either of those systems? :D

Maybe someone that actually knows something about mobile would chime in on that side of things haha.
Image

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

Re: Replace LiveCode Script with JavaScript, forever

Post by FourthWorld » Mon Jul 13, 2020 7:58 pm

bogs wrote:
Mon Jul 13, 2020 7:38 pm
bogs wrote:
Mon Jul 13, 2020 7:03 pm
and I don't think iOS or Android?
I probably didn't say this part clear enough, I should have said "I know absolutely nothing about mobile, but I don't think it is pre-installed on either of those systems? :D

Maybe someone that actually knows something about mobile would chime in on that side of things haha.
Seems a safe bet. Python is most usable in contexts where it's called from other apps. Indeed, that's the only reason to have it pre-installed, as opposed to an embedded version. Mobile OS vendors work very hard to minimize the ways different processes interact, so I would expect a general-purpose scripting engine like Python would not fit into such priorities.
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: 4965
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Replace LiveCode Script with JavaScript, forever

Post by richmond62 » Tue Jul 14, 2020 7:10 am

Python is most usable in contexts where it's called from other apps.
So, WTFF (Why The Flying Fantoushies) is is being adopted faster than you can say 'LiveCode' in
educational establishments everywhere while LiveCode is NOT?

Post Reply

Return to “Feature Proposals”