Running a full C program inside a stack?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Running a full C program inside a stack?

Post by EssoAir » Fri Feb 28, 2014 2:06 pm

Hello everyone,

I was wondering if it was possible to run a full-on C program inside a LiveCode stack. Specifically, I'm interested in making a UI for Tox-core (https://tox.im/).

Can this be done?

Esso

Klaus
Posts: 11313
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Running a full C program inside a stack?

Post by Klaus » Fri Feb 28, 2014 2:20 pm

Hi Esso,
EssoAir wrote:Can this be done?
not out of the box!

If this is a command line tool, you may be able to control it with some SHELL() commads,
but TOX looks like a fully compiled app with a built-in GUI.


Best

Klaus

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: Running a full C program inside a stack?

Post by BvG » Fri Feb 28, 2014 2:27 pm

Well in a sense externals are C code running within the engine. So if you can compile an external then that'd be what you want. Also, there's a lot of possibilities to talk to other programs, often making it unnecessary to actually include them, for example:

shell() (as Klaus suggested)
open process
sockets (locally or over networks)
using files as communication
etc.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Running a full C program inside a stack?

Post by EssoAir » Fri Feb 28, 2014 2:46 pm

Klaus wrote:Hi Esso,
EssoAir wrote:Can this be done?
not out of the box!

If this is a command line tool, you may be able to control it with some SHELL() commads,
but TOX looks like a fully compiled app with a built-in GUI.


Best

Klaus
The core is separate from the GUI programs. Its a command-line tool with its own distributed network. I just want to make my own GUI for it

Klaus
Posts: 11313
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Running a full C program inside a stack?

Post by Klaus » Fri Feb 28, 2014 2:56 pm

EssoAir wrote:The core is separate from the GUI programs. Its a command-line tool with its own distributed network. I just want to make my own GUI for it
Then you should be able to control it with a lot of SHELL() calls :D

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Running a full C program inside a stack?

Post by EssoAir » Fri Feb 28, 2014 4:17 pm

Klaus wrote:
EssoAir wrote:The core is separate from the GUI programs. Its a command-line tool with its own distributed network. I just want to make my own GUI for it
Then you should be able to control it with a lot of SHELL() calls :D
But how do i deploy it? I cant assume the user already has it insitalled. How do i use shell() calls to deploy it to a computer?

Also, shell() doesnt work on mobile. how do i get it working on android and iOS?

Klaus
Posts: 11313
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Running a full C program inside a stack?

Post by Klaus » Fri Feb 28, 2014 4:24 pm

EssoAir wrote:But how do i deploy it? I cant assume the user already has it insitalled.?
You will need to also install all the neccessary excutables with your app (as far as TOX allows).
EssoAir wrote:How do i use shell() calls to deploy it to a computer?
? See above.
EssoAir wrote:Also, shell() doesnt work on mobile. how do i get it working on android and iOS?
Ah, mobile, looks this is not doable on mobile except maybe with an external?

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Running a full C program inside a stack?

Post by EssoAir » Fri Feb 28, 2014 4:26 pm

Klaus wrote:
EssoAir wrote:But how do i deploy it? I cant assume the user already has it insitalled.?
You will need to also install all the neccessary excutables with your app (as far as TOX allows).
EssoAir wrote:How do i use shell() calls to deploy it to a computer?
? See above.
EssoAir wrote:Also, shell() doesnt work on mobile. how do i get it working on android and iOS?
Ah, mobile, looks this is not doable on mobile except maybe with an external?

Here is the android port https://github.com/Astonex/Antox

Klaus
Posts: 11313
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Running a full C program inside a stack?

Post by Klaus » Fri Feb 28, 2014 5:16 pm

EssoAir wrote:Here is the android port https://github.com/Astonex/Antox
Yes, someone obviously compiled the source code for Android :D
Sorry, no idea if and how this could help you.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2847
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Running a full C program inside a stack?

Post by mwieder » Fri Feb 28, 2014 7:48 pm

Esso- What's your end goal here? Are you trying to add additional functionality to the tox project? Are you intending to launch a different process and then in the middle of that launch the tox client as a side effect? Just curious because tox is designed to be self-contained - as an end user, I'd regard any additions that weren't freely accessible through the github project as suspect.

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Running a full C program inside a stack?

Post by EssoAir » Sat Mar 01, 2014 3:43 am

mwieder wrote:Esso- What's your end goal here? Are you trying to add additional functionality to the tox project? Are you intending to launch a different process and then in the middle of that launch the tox client as a side effect? Just curious because tox is designed to be self-contained - as an end user, I'd regard any additions that weren't freely accessible through the github project as suspect.
To your second point, yes I agree, FOSS is best

To your first, no its not. libtoxcore and venom/qt/antox/etc are separate things. Anyone can make a gui that connects with the network.

My end goal is simply to make my own GUI. It may not be possible in LiveCode, but if it is I'd like to give it a shot. Its just for fun I guess

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2847
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Running a full C program inside a stack?

Post by mwieder » Sat Mar 01, 2014 4:05 am

Esso-

Cool. Fun can be its own end goal.

I submitted a bug to the tox project because there's a missing Makefile that prevents the project from being built (other than the Android parts).
If you need to access the commandline tools on a mobile device, though, I'm not sure the sandboxing of individual apps will allow that.
I'm not convinced one way or the other, but I think that's the avenue to investigate before embarking on too much work.
But if that's a problem, then maybe building an external wrapper for the commandline would do the trick.

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Running a full C program inside a stack?

Post by EssoAir » Sat Mar 01, 2014 4:20 am

mwieder wrote:Esso-

Cool. Fun can be its own end goal.

I submitted a bug to the tox project because there's a missing Makefile that prevents the project from being built (other than the Android parts).
If you need to access the commandline tools on a mobile device, though, I'm not sure the sandboxing of individual apps will allow that.
I'm not convinced one way or the other, but I think that's the avenue to investigate before embarking on too much work.
But if that's a problem, then maybe building an external wrapper for the commandline would do the trick.
Hmmm, im a web developer by trade, and while I do know Java and Livecode, your words confuse me. I know what sandboxing is, but I dont know how to do it and wtf is a wrapper? What I think "wrapper" what comes to mind is <div id="wrapper" class="bordered themed otherClass"><!-- Content --></div> LOL

Post Reply

Return to “Talking LiveCode”