Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"In short, _N is Richardian if, and only if, _N is not Richardian."


devel / comp.lang.forth / co-processing Forth with Dash

SubjectAuthor
* co-processing Forth with DashS Jack
`- Re: co-processing Forth with DashS Jack

1
co-processing Forth with Dash

<5c0e0d3a-ea6e-45dd-9f9d-304775fcafb2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15144&group=comp.lang.forth#15144

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:46c8:: with SMTP id h8mr29084430qto.208.1636157153845;
Fri, 05 Nov 2021 17:05:53 -0700 (PDT)
X-Received: by 2002:a05:620a:63d:: with SMTP id 29mr15676349qkv.312.1636157153697;
Fri, 05 Nov 2021 17:05:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 5 Nov 2021 17:05:53 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:7131:1635:c5:fb1e;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:7131:1635:c5:fb1e
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5c0e0d3a-ea6e-45dd-9f9d-304775fcafb2n@googlegroups.com>
Subject: co-processing Forth with Dash
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Sat, 06 Nov 2021 00:05:53 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 38
 by: S Jack - Sat, 6 Nov 2021 00:05 UTC

:) froger
ELF32X86_64 Frog Version 1.0d

"job" fload
"/bin/sh <${IPC0} >${IPC1} &" /SYS \ run DASH in background
CO:OPEN \ open IPC handles
: (LTYPE) CO:SRC 2@ CR TYPE ; \ word to print IPC data
' (LTYPE) is CO:READL \ assign word to data reader

"env" CO:PROTO \ command DASH to dump environment
CO:READL \ get and display the results
ENV=/home/sdwjack69/etc/minrc
PWD=/home/sdwjack69/fth/frog
HOME=/home/sdwjack69
IPC1=/home/sdwjack69/var/fifo/p1
IPC0=/home/sdwjack69/var/fifo/p0
SHLVL=1
BASH_ENV=/home/sdwjack69/etc/minrc
PATH=/home/sdwjack69/bin:/usr/local/bin:/usr/bin:/bin
BASH_FUNC_ipc%%=() { echo "STX" > ${IPC1};
eval "${@}" > ${IPC1};
echo "ETX" > ${IPC1}
} _=/usr/bin/env

'FOO="old magic XYZZY"' CO:WRITEL \ variable assignment in DASH
'echo "${FOO##*\ }"' CO:PROTO \ parse the variable in DASH
CO:READL \ get and display the results
XYZZY

:)
Note:
i. dash shell used instead of bash because it's leaner
i. a minimal environment was used with dash
i. CO:WRITEL write line to co-program
i. CO:PROTO write line to co-program; return data wrapped in STX...ETX
i. CO:READL read lines of data from co-program
--
me

Re: co-processing Forth with Dash

<eeb0ef06-14c3-4c02-8992-c8599ae636e6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15168&group=comp.lang.forth#15168

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:5423:: with SMTP id g3mr71341541qvt.45.1636317369369;
Sun, 07 Nov 2021 12:36:09 -0800 (PST)
X-Received: by 2002:a05:622a:14:: with SMTP id x20mr81083295qtw.372.1636317369170;
Sun, 07 Nov 2021 12:36:09 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 7 Nov 2021 12:36:08 -0800 (PST)
In-Reply-To: <5c0e0d3a-ea6e-45dd-9f9d-304775fcafb2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:c8bc:e2d8:ef67:954d;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:c8bc:e2d8:ef67:954d
References: <5c0e0d3a-ea6e-45dd-9f9d-304775fcafb2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eeb0ef06-14c3-4c02-8992-c8599ae636e6n@googlegroups.com>
Subject: Re: co-processing Forth with Dash
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Sun, 07 Nov 2021 20:36:09 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 12
 by: S Jack - Sun, 7 Nov 2021 20:36 UTC

Some refinements and notes:

i. Use bash for co-shell because it has more functions.
Use the leaner dash for forked-shell which loads every time used.
Minimal shell environment is used with both.

i. The co-shell which runs in background is prohibited from accessing
the keyboard. To do an operation like reading tty will need to be
done with the forked-shell. Data from the forked-shell can return
by the same pipe used by the co-shell output.

--
me

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor