After having searched for a few days I'v drawn a blank. Does anyone know
where I can get some kind of BASIC compiler, or even interpreter, for Linux?
Well there are a few options:
1) In both my Slackware 2.3 and 3.0 distributions there is a basic command
that brings up Chipmunk BASIC 1.0. This is a basic interpreter written
in Pascal and comes with the p2c (Pascal to C) translator. It has a document
under /usr/doc/p2c.
2) Therer is another interpreter called By-Water Basic (bwbasic). It lives
on sunsite.unc.edu:/pub/linux/devel/basic.
3) There is a commercial package called Xbasic that is advertised in the
Linux Journal. No clue about its features.
Hope this helps,
BAJ
--
Another random extraction from the mental bit stream of...
Byron A. Jeff - PhD student operating in parallel - And Using Linux!
Georgia Tech, Atlanta GA 30332 Internet: by...@cc.gatech.edu
: After having searched for a few days I'v drawn a blank. Does anyone know
: where I can get some kind of BASIC compiler, or even interpreter, for Linux?
Yes, a basic interpreter exist for linux:
Chipmunk BASIC 1.0
by David Gillespie
I've installed it with the Slackware distib. You can probably find it in major
mirror sites. It's called basic
--
Email : Benjami...@goliath.is.belgacom.be
Fidonet : 2:293/2218.13
Here is a list of basic interpreters for Unix that someone emailed me
a while back. The one below written by David Gillespie is Chipmunk
BASIC.
Adam
<http://reality.sgi.com/csp/ioccc/years.html>
or
<ftp://ftp.netcom.com/pub/rh/rhn/dds.basic.c>
Worlds smallest Basic interpreter. C source.
Obfuscated (IOCCC winner). Only 25 lines long.
Written by: Diomidis Spinellis <d...@cc.ic.ac.uk> 1990
<http://www.Uni-Mainz.DE/~ihm/basic.html>
A Basic interpreter written using flex, bison & C.
Author: i...@kph.uni-mainz.de (under GNU public license).
<ftp://ftp.netcom.com/pub/rh/rhn/basic.shar.Z>
An old Basic interpreter written in Pascal and converted
to C using p2c. PD. Author: Dave Gillespie
<ftp://ftp.netcom.com/pub/rh/rhn/bwbasic-2.20.uu>
Bywater BASIC 2.20, ANSI C source, newest version,
memory leaks fixed! (under GNU public license).
<ftp://ftp.eng.umd.edu/pub/basic/philbasic.tar.gz>
A Basic interpreter modeled after gwbasic. Be sure
and get the patches as well. This was originally written
by Phil Cockcroft when he was a student. With a few changes
and the patches this can be a very usable basic.
(Has anyone figured how to make the above run on a current
shipping *nix system (SunOS, IRIX, HPUX, etc.)?)
<ftp://garbo.uwasa.fi/unix/unmbasic/unmbasic.tar.Z>
BASIC environment from University of New Mexico.
Include matrix commands. Mostly in K&R C plus a bison grammer, but
requires f2c or a Fortran compiler for one of the files.
written by Gary Klimowicz as Vax-Basic (pre-1990?) (public domain?)
Of the above interpreters, Bywater BASIC seems to be the most complete
and portable, but unmbasic and ihm/basic are 30 to 40 times faster
than bwbasic. I seem to remember an sbasic posted to alt.sources, but
it was a very small version of the language. Any others?
--
Adam P. Jenkins
mailto:a...@twain.oit.umass.edu
> Yes, a basic interpreter exist for linux:
> Chipmunk BASIC 1.0
> by David Gillespie
> I've installed it with the Slackware distib. You can probably find it in
> major mirror sites. It's called basic
Oh, *THAT*. :)
Here's the complete sources (relax, it's not that huge. :)
I dunno about 1536 bytes, though, I'm figuring it at 2784 bytes.
/****
dds.c, 1990 Obfuscated C Programming Contest winner...
a complete Basic interpreter in only 1536 bytes
***/
#define O(b,f,u,s,c,a)b(){int o=f();switch(*p++){X u:_ o s b();X c:_ o a b();default:p--;_ o;}}
#define t(e,d,_,C)X e:f=fopen(B+d,_);C;fclose(f)
#define U(y,z)while(p=Q(s,y))*p++=z,*p=' '
#define N for(i=0;i<11*R;i++)m[i]&&
#define I "%d %s\n",i,m[i]
#define X ;break;case
#define _ return
#define R 999
typedef char *A;
int *C, E[R], L[R], M[R], P[R], l, i, j;
char B[R], F[2];
A m[12 * R], malloc
(), p, q, x, y, z, s, d, f, fopen ();
A
Q (s, o)
A s, o;
{
for (x = s; *x; x++)
{
for (y = x, z = o; *z && *y ==
*z; y++)
z++;
if (z > o && !*z)
_ x;
}
_ 0;
}
main ()
{
m[11 * R] = "E";
while (puts ("Ok"), gets (B)
)
switch (*B)
{
X 'R':C = E;
l = 1;
for (i = 0; i < R; P[i++] = 0);
while (l)
{
while (!(s = m[l]))
l++;
if
(!Q (s, "\""))
{
U ("<>", '#');
U ("<=", '$');
U (">=", '!');
}
d = B;
while (*F = *s)
{
*s == '"' && j
++;
if (j & 1 || !Q (" \t", F))
*d++ = *s;
s++;
}
*d-- = j = 0;
if (B[1] != '=')
switch (*B)
{
X 'E':l = -1
X 'R': B[2] != 'M' && (l = *--C) X 'I':B[1] == 'N' ? gets (p = B), P[*d] = S () : (*(q = Q (B, "TH")) = 0, p
= B + 2, S () && (p = q + 4, l = S () - 1)) X 'P':B[5] == '"' ? *d = 0, puts (B + 6) : (p = B + 5, printf
("%d\n", S ()))X 'G': p = B + 4, B[2] == 'S' && (*C++ = l, p++), l = S () - 1 X 'F':*(q = Q (B, "TO")) = 0;
p = B + 5;
P[i
= B[3]] = S ();
p = q + 2;
M[i] = S ();
L[i] = l X 'N':++P[*d] <= M[*d] && (l = L[*d]);
}
else
p = B + 2, P[
*B] = S ();
l++;
}
X 'L': N printf (I) X 'N': N free (m[i]), m[i] = 0 X 'B':_ 0 t ('S', 5, "w", N
fprintf (f, I)) t ('O', 4, "r", while (fgets (B, R, f)) (*Q (B, "\n") = 0, G ()))
X 0: default:
G ()
;
}
_ 0;
}
G ()
{
l = atoi (B);
m[l] && free (m[l]);
(p = Q (B, " ")) ? strcpy (m[l] = malloc (strlen (p
)), p + 1) : (m[l] = 0, 0);
}
O (S, J, '=', ==, '#', !=)O (J, K, '<', <, '>', >)O (K, V, '$', <=, '!', >=)
O (V, W, '+', +, '-', -)O (W, Y, '*', *, '/', /)Y ()
{
int o;
_ *p == '-' ? p++, -Y () : *p >= '0' && *p <=
'9' ? strtol (p, &p, 0) : *p == '(' ? p++, o = S (), p++, o : P[*p++];
}
--
Robert Woodcock - r...@netcom.com
Anyone who uses the phrase "easy as taking candy from a baby" has never
tried taking candy from a baby.
-- Robin Hood
>Benjamin Gonay (go...@goliath.is.belgacom.be) composed eloquently:
>>Nick Hutton (ni...@uunet.pipex.com) wrote:
>>: After having searched for a few days I'v drawn a blank. Does anyone know
>>: where I can get some kind of BASIC compiler, or even interpreter, for
>>: Linux?
>> Yes, a basic interpreter exist for linux:
>> Chipmunk BASIC 1.0
>> by David Gillespie
>> I've installed it with the Slackware distib. You can probably find it in
>> major mirror sites. It's called basic
>Oh, *THAT*. :)
>Here's the complete sources (relax, it's not that huge. :)
>I dunno about 1536 bytes, though, I'm figuring it at 2784 bytes.
Probably someone has formatted it, and it would be 1536 bytes when the
program code was reformatted to 80-char lines?
Whatever, I cannot get it do do anything like a BASIC interpreter. It
just accepts any input and prints "Ok"...
Rob
--
+------------------------------------+--------------------------------------+
| Rob Janssen pe1...@amsat.org | BBS: +31-302870036 (2300-0730 local) |
| AMPRnet: r...@pe1chl.ampr.org | AX.25 BBS: PE1CHL@PI8WNO.#UTR.NLD.EU |
+------------------------------------+--------------------------------------+
>Oh, *THAT*. :)
>Here's the complete sources (relax, it's not that huge. :)
>I dunno about 1536 bytes, though, I'm figuring it at 2784 bytes.
Probably someone has formatted it, and it would be 1536 bytes when the
program code was reformatted to 80-char lines?
Whatever, I cannot get it do do anything like a BASIC interpreter. It
just accepts any input and prints "Ok"...
Hmm? Not same as Chipmunk BASIC, then:
>10 for i = 1 to 20
>20 print 2*i
>30 next i
>run
2
4
6
8
10
[...]
Besides, "strings `which basic`" contains "Pascal system error %d",
which makes it rather dubious that it should have come from an
obfuscated C contest, dontchathink?
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dal...@biostat.ku.dk) FAX: (+45) 35327907
>Oh, *THAT*. :)
>Here's the complete sources (relax, it's not that huge. :)
>I dunno about 1536 bytes, though, I'm figuring it at 2784 bytes.
Probably someone has formatted it, and it would be 1536 bytes when the
program code was reformatted to 80-char lines?
Whatever, I cannot get it do do anything like a BASIC interpreter. It
just accepts any input and prints "Ok"...
Hmm? Not same as Chipmunk BASIC, then:
[snip]
Actually got the obfuscated one to work, you simply have to use
uppercase and absolutely NO spacing (just read the source and
see for yourself ;^) !):
$ a.out
Ok
100 FORI=1TO10
Ok
200 PRINTI
Ok
300 NEXTI
Ok
LIST
100 FORI=1TO10
200 PRINTI
300 NEXTI
Ok
RUN
1
2
3
4
5
6
7
8
9
10
Ok
I keep an updated list of portable BASIC interpreters on the
Chipmunk Basic web page:
<http://www.nicholson.com/rhn/basic>
Most complete portable interpteter is Bywater Basic 2.20 patch
level 01.
Fastest portable interpreter is the one by Marc-Oliver Ihm.
Smallest is the obfuscated one by Diomidis Spinellis (25 lines).
Chipmunk Basic 1.0 is seriously obsolete.
I'm looking for an account on an x86/linux system to build a
Chipmunk Basic 3.4 binary.
--
Ron Nicholson mailto:r...@sgi.com http://www.nicholson.com/rhn/
#include <canonical.disclaimer> // only my own opinions, etc.
>Oh, *THAT*. :)
>Here's the complete sources (relax, it's not that huge. :)
>I dunno about 1536 bytes, though, I'm figuring it at 2784 bytes.
Probably someone has formatted it, and it would be 1536 bytes when the
program code was reformatted to 80-char lines?
Whatever, I cannot get it do do anything like a BASIC interpreter. It
just accepts any input and prints "Ok"...
There is another one called bwbasic. It seems to be fairly usable.
In Germany it is on the S.u.S.E. distribution. Maybe you can find it using
archie.
--
____________________________________________________________________
UM - Consulting Roseneggweg 2
Client/Server Computing D-78244 Gottmadingen
Distributed Databases E-Mail: U.M...@t-online.de
Ulrich Moser Office: Moser....@ch.swissbank.com
Caldera 1.0 comes with a lite version of XBasic if I remember the right way.
Robert
I don't know if anyone pointed this out, but there's a version in the
p2c package in the Slackware distribution.
--
Mark A. Stevens Phone: 708-235-2204
Systems Programmer/Administrator Internet: xm...@uxa.ecn.bgu.edu
Educational Computing Network WWW: http://www.ECNet.Net/users/xmas/
Governors State University VMSHARE: ECE/MARK
I don't know if anyone pointed this out, but there's a version in the
p2c package in the Slackware distribution.
Eh, that's p2c, not b2c. Notihing wroing with pascal, it's just that
it ain't baisc ...
Jon Martin Solaas
jo...@ifi.uio.no
: I don't know if anyone pointed this out, but there's a version in the
: p2c package in the Slackware distribution.
: Eh, that's p2c, not b2c. Notihing wroing with pascal, it's just that it
: ain't baisc...
Are you claiming that the p2c package doesn't contain a BASIC interpreter?
There was one in the package last time I looked -- which was a while back.
--
Grant Edwards | Microsoft isn't the | Yow! I want to dress you up
Rosemount Inc. | answer. Microsoft | as TALLULAH BANKHEAD and
| is the question, and | cover you with VASELINE and
gra...@rosemount.com | the answer is no. | WHEAT THINS..
: Eh, that's p2c, not b2c. Notihing wroing with pascal, it's just that
: it ain't baisc ...
Right. However, p2c includes a basic interpreter written in Pascal (which
you can then translate to C and compile).
Cheers,
Henry Ware
hw...@cs.wvu.edu