spawning processes or calling other programs

146 views
Skip to first unread message

Bill Frug

unread,
Sep 15, 2024, 9:21:09 AM9/15/24
to Shen
Hello

How can I spawn other programs in Shen?

Thanks


Bruno Deferrari

unread,
Sep 15, 2024, 6:29:01 PM9/15/24
to qil...@googlegroups.com
Which port are you using? you have to make use of whatever API the underlying platform provides combined with the foreign-function interface provided by the specific port.

--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/qilang/ac722259-30c6-4c1c-b56b-b8a50ec6e997n%40googlegroups.com.


--
BD

Bill Frug

unread,
Sep 16, 2024, 7:36:56 AM9/16/24
to Shen
 Shen 22.4 
Shen-c on linux

Joel McCracken

unread,
Sep 16, 2024, 7:37:01 AM9/16/24
to qil...@googlegroups.com
So I'm still relatively new to the Shen world, but my tl;dr is: it depends upon what port you're using and what facilities it provides.

Shen as an environment is a bit different from other systems. It is designed to be portable between many different languages and contexts. That means that Shen itself can't make many assumptions - for example, you can't spawn processes in a JavaScript context.

The single exception to this seems to be opening/closing and reading/writing to files. This does provide ways for shen to communicate with the outside world. It seems that Dr Tarver took advantage of this with his recent "Shen IDE" project that provides a UI utility via TCL; shen writes commands/info to a file, tcl reads it and displays. TCL writes information back to Shen via another file, and which Shen reads.

However, there are exceptions here, in that many of the ports provide ways to invoke functionality in the underlying port environment. For some examples: https://github.com/Shen-Language/wiki/wiki/NativeCalls

So, which port? The official SBCL port?

 

Bruno Deferrari

unread,
Sep 16, 2024, 7:43:05 AM9/16/24
to qil...@googlegroups.com
From a quick glance I don't see Shen-C providing any FFI mechanism, but if you look at this file you could follow the same approach and extend it to expose more C functions to Klambda/Shen


--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.


--
BD

Bill Frug

unread,
Sep 16, 2024, 9:00:48 AM9/16/24
to Shen
Thanks all, will check it out.

dr.mt...@gmail.com

unread,
Sep 19, 2024, 6:23:56 AM9/19/24
to Shen
As far as FFI is concerned; this depends on the host port.

Wrt concurrent processing, there is a good portable package that
assumes only one extra command about the KL set; this is, to create
a thread.   AFAIK this is not open to Javascript, but quite a few other
platforms will support it.

This package will come out later this year or early next year.

Mark

Reply all
Reply to author
Forward
0 new messages