Interpreted BASIC?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Is there a very simple interpreter for BASIC for BASH?

Thanx!

FW

Re: Interpreted BASIC?
Am 24.03.21 schrieb me # home.com@3:770/3 in RBERRYPI:

Hallo F.,

FW> Is there a very simple interpreter for BASIC for BASH?

I haven't tried it myself, but there is a "bwBASIC" (Bywater BASIC) which
is a small BASIC interpreter modeled after GW-BASIC.
And there is FreeBASIC, which is more like QuickBASIC/QBASIC, but it is  
also a compiler.

Maybe that helps you a little.

Regards,
Anna


Re: Interpreted BASIC?
On Wed, 24 Mar 2021 10:43:18 +0100, F. W. wrote:

Quoted text here. Click to load it
It would appear that that are three:  bwbasic, sdlbasic and yabasic

sdlbasic says its for game development using the SDL library. The SDL  
library manages video, audio, input devices, CD-ROM, threads, shared  
object loading, networking and timers.

bwbasic looks like a more complete ANSI Standard BASIC interpreter than  
yabasic and could be the only one to have a built-in editor.

All are supported on other operating systems as well as Linux.

FYI I used the command line:

sudo apt search "basic interpreter" | less

to find these Raspbian packages. Use "sudo apt install packagename" to  
install one or more of them. I have no idea which is the best: I haven't  
written BASIC since around 1985.

--  
Martin    | martin at
Gregorie  | gregorie dot org


Re: Interpreted BASIC?
On 24-03-2021 12:01, Martin Gregorie wrote:
Quoted text here. Click to load it

Won't you only find packages that have the exact description "basic  
interpreter" that way, or is the search cleverer than that?

Two Raspberry Pi related options:
- Gordon's RTB seems to have vanished from the repos but can be  
downloaded here:  
https://projects.drogon.net/rtb/rtb-download-and-install/ I just tried  
it and it still works, and it does GPIO, but unfortunately for OP it  
requires a graphical screen. (And to install libsdl-sound1.2 first, even  
if you don't use sound.)
- Also graphical, harking back to the inspiration for the Raspberry Pi:  
https://www.bbcbasic.co.uk/bbcsdl/

The only interpreter that I saw (in a web search) that does support  
command line/batch mode is apparently bwbasic, which is in the standard  
repo like you found.

Re: Interpreted BASIC?
On Wed, 24 Mar 2021 12:23:43 +0100, A. Dumas wrote:

Quoted text here. Click to load it
Its cleverer than that: it matches packages using a regex. Changing the  
regex to "basic.*interpreter" added one other relevant hit:  
 'brandy', a BBC BASIC V interpreter

Be aware that 'apt search' is looking at the package's description, not  
its name, so a fairly generic regex like the one I used is likely to  
include irrelevant packages in its hits list. Since it only displays the  
first sentence in each description, its not always obvious why a  
particular hit got into the list.


--  
Martin    | martin at
Gregorie  | gregorie dot org


Re: Interpreted BASIC?
On 24/03/2021 11:23, A. Dumas wrote:
Quoted text here. Click to load it

Following is not really the answer to the OP, but I grew up with this  
thing, and think the javascript emulation is cool.

https://clp.bbcrewind.co.uk/jsbeeb/index.html

enter the following at the prompt (on a PC keyboard for * use the @  
character, next to the return/enter key)

*EXEC !BOOT

and you will be starting the game, Elite ...


The site https://clp.bbcrewind.co.uk may interest some with memories of  
long ago, the beginning of my interest in home computing.

--  
Adrian C

Re: Interpreted BASIC?
Quoted text here. Click to load it

It should work on the console without any GUI running.

Try running it with the -D flag:

  rtb -D

then looking at the list of modes it prints, then you can pick the mode/resolution with

  rtb -m X

where X is the mode number listed from the -D command. Mode 0 is usually
the highest resolution one which is the default if you don't use the
-m flag.

RTB (and wiringPi) are sort of on holiday right now - I've had some health
issues in the past year or 2 and am now in the middle of moving house,
so once the dust has settled I'll be doing more with them.

Gordon

Re: Interpreted BASIC?
On 25-03-2021 17:22, Gordon Henderson wrote:
Quoted text here. Click to load it

Right! Thanks. I looked at the documentation and did try the -D flag but  
I was another step removed, over ssh, and it just would not start. I  
have not tried forwarding the X-server, that seemed a little over the  
top for OP who intended it as a bash tool.

Quoted text here. Click to load it

All the best!

Re: Interpreted BASIC?
Quoted text here. Click to load it

If you use ssh -X then it should also work, but it'll be slow. Running it over VNC
also works.

Gordon

Re: Interpreted BASIC?
On 3/24/21 3:43 AM, F. W. wrote:
Quoted text here. Click to load it


https://www.thefreecountry.com/compilers/basic.shtml
will show you. There is also opencomal which is a basic like language  
with more structure.

Re: Interpreted BASIC?
Am 24.03.2021 um 16:52 schrieb ray:
Quoted text here. Click to load it

Thank you! Vintage-Basic is excellent!

FW


Re: Interpreted BASIC?
On 24/03/2021 09:43, F. W. wrote:
Quoted text here. Click to load it

If you are looking for an interactive interpreter as an alternative to a  
bash shell, and I would recommend iPython rather than a BASIC variant.  
Python is far more powerful language with a vast range of library  
modules, and iPython allows you to use all of that interactively.

---druck

Re: Interpreted BASIC?
On 24/03/2021 20:45, druck wrote:
Quoted text here. Click to load it

I'd suggest PowerShell ...

--  
Adrian C

Re: Interpreted BASIC?
On 25-03-2021 11:47, Adrian Caspersz wrote:
Quoted text here. Click to load it

On the Raspberry Pi?! Because we're in comp.sys.raspberry-pi here.

Re: Interpreted BASIC?
On 25/03/2021 11:34, A. Dumas wrote:
Quoted text here. Click to load it

Yup.

--  
Adrian C

Re: Interpreted BASIC?
On Thu, 25 Mar 2021 12:42:24 +0000

Quoted text here. Click to load it

... or you could run RiscOS and you'd have BBC BASIC built in - an *extremely*
powerful (and quick) version.

Mind you this all depends on what other connectivity you need.

--  
W J G


Re: Interpreted BASIC?
On Thu, 25 Mar 2021 12:42:24 +0000

Quoted text here. Click to load it

Why?

The more sophisticated Windows users think PowerShell is wonderful
because it give them access to a lot of stuff the GUI doesn't touch,
including a lot of things that *should* be in management GUIs e.g.
finding mailbox sizes in the last version of Exchange that I had
dealings with. That shouldn't be a command-line-only job, given what
else the GUI does cover.

But it's *Windows* stuff. *nix has always had a shell (indeed many) to
reach the command-line APIs of various daemons and applications. This
chap wants to get back to BASICs. Why, we don't know. I occasionally
dabble with VBA in Access, and even more occasionally in Excel, but I
have no other use for any form of BASIC.

--  
Joe


Re: Interpreted BASIC?

| The more sophisticated Windows users think PowerShell is wonderful
| because it give them access to a lot of stuff the GUI doesn't touch,
| including a lot of things that *should* be in management GUIs e.g.
| finding mailbox sizes in the last version of Exchange that I had
| dealings with. That shouldn't be a command-line-only job, given what
| else the GUI does cover.
|
| But it's *Windows* stuff. *nix has always had a shell (indeed many) to
| reach the command-line APIs of various daemons and applications.

  I thought they ported it to Linux. At any rate, that's why
they produced it in the first place. It's superfluous, poorly
designed crap that's not dependably on all systems and has
become a venue for attacks. The only reason they
came out with it was to provide something for Linux
sever admins that would look familiar. As far as I'm concerned,
Linux can have it. Windows script with COM is far more
extensive and adaptable.  



Re: Interpreted BASIC?
On 25/03/2021 20:31, Joe wrote:
Quoted text here. Click to load it

For me PowerShell doesn't absolutely need any such sophistication  
(/bloat) like on Windows, but I find it useful as a language on the  
command line.

Some people like PHP on the command line, but that's them ..

For scripting use, PowerShell's language features (variables,  
conditionals, pipelines, iterations, parameters, heredocs, etc....) have  
been stolen from Bash and considerably improved upon.

I float between Bash and PowerShell, though only done a couple of  
PowerShell projects on Linux (network card throughput testing was one),  
I much prefer the syntax and tools available (VSCODE)

My other pain point lately is the Puppet language and Icinga. ugh...

Replace all! by PowerShell


Has anyone seen my straight jacket?

--  
Adrian C

Re: Interpreted BASIC?
On Fri, 26 Mar 2021 10:01:45 +0000, Adrian Caspersz wrote:

Quoted text here. Click to load it
Yes, though something I've see recently (a 20,000 line script written  
using the Bourne Shell) has left me reeling and gagging and wishing I'd  
never see it.  

That said, bash is fine for the relatively short scripts I write with it,  
but the way that it tends to stop on finding the first error makes it  
unsuitable for anything longer than a few tens of lines, in my opinion,  
anyway, because the stop-on-error approach makes debugging a large script  
very slow unless you writeand test incrementally, which is still slow  
going.  

The two best scripting languages I've used are the mainframe scripting  
language implemented for VME/B the ICL 2900 operating system, and IBM's  
OS/400 scripting language, which both have very similar abilities, in  
particular:

- very consistent syntax and utility naming conventions: on both OSen you  
can reliably guess the name of a utility you've not previously used  
though OS/400 muddies this because all names are max 9 characters and it  
doesn't use name extensions such as .txt or .html

- VME/B used two names for everything: a long name and and an
  abbreviation and the abbreviation formats were equally consistent, so
  the deletefile(myfile) command deleted 'myfile' and so did xf(myfile).
  You tended to use long names when writing SCL procedures (i.e. shell
  scripts) and short names when typing commands into a terminal.

- OS/400 was just carefilr with its horrid short names, but at least if
  you knew that if crtcblpgm was the COBOL compiler, crtrpgpgm was the
  RPG3 compiler, crtplipgm compoiled PL/1 and crtftnpgm compiled Fortran.

- both compiled their script equivalents (procedures) very fast and had
  good error reporting while compiling them.

- both used typed parameters allowed each parameter to be given a type,
  name, default value and a short description.

- both had the equivalent of -? or --help but it worked by flashing up
  a full-screen display of the procedure name and parameters, showing
  type, name default value and description so you just entered your
  parameters and hit the 'do it' key.

- both had a well-thought-out equivalent to the Unix/Linux 'apropos'
  tool for finding commands by name.

Something like that would be a huge improvement for Linux, especially if  
it was somehow possible to agree a more rational set of command names,  
but I cant see the latter happening before the heat death of the universe.


--  
Martin    | martin at
Gregorie  | gregorie dot org


Site Timeline