Heater
Posts: 12603
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Fri May 10, 2019 9:28 am

RichardRussell,
Why would you want to?
I wouldn't. It's what I found when I looked for "bbcbasic":

Typing "bbcbasic" into a search box gets this as the first hit: http://www.bbcbasic.co.uk/bbcbasic.html

That looks very much like the BBCBasic download page. It even says "DOWNLOADS". So guess what I do next?

The link you just gave links to a random, unknown, website: www.rtr.myzen.co.uk. The kind of place I would not trust binary executables from.

Can I grab the source code and build instructions from github or some such?

Heater
Posts: 12603
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Fri May 10, 2019 9:53 am

RichardRussell,
I disagree with you quite fundamentally,..
I'm sure many do. And I do understand the reasons why.
...it goes against an important educational principle: that a student should be able to progress at his own pace....
The advice the BBC received (from some of the UK's top educational experts at the time) was the opposite of what you propose, that a language should be chosen which was ideally suited to beginners but which at the same time had the power and sophistication to allow teaching of more advanced concepts...
That all makes sense to me as well.

However, I will point out that in the decades since BASIC started getting extended with BBCBasic, all the MS versions and other variants, CS education and the computing skills of those leaving school plummeted. So much so that Eben Upton noticed it among applicants to Cambridge and decided something had to be done.

Which is odd because all that stuff was available for the PC's everyone had. I posit that it all became too complex for kids to even stick their nose into.

Clearly the educational advice did not work.

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: ScriptBasic

Fri May 10, 2019 9:56 am

Heater wrote:
Fri May 10, 2019 9:28 am
That looks very much like the BBCBasic download page. It even says "DOWNLOADS". So guess what I do next?
You could have clicked on the BBC BASIC for SDL 2.0 for Mac OS-X, Linux (x86), Raspberry Pi, Android, iOS and Windows™ Vista, 7, 8/8.1 and 10 link.
The link you just gave links to a random, unknown, website: www.rtr.myzen.co.uk. The kind of place I would not trust binary executables from.
It's where the download link you tried goes, so how did you discover it was a 32-bit binary if you aren't prepared to trust it?! My Windows and MacOS binaries are signed with a Comodo certificate, but I'm not aware that Linux has that option universally.

My initial post in the 'Introduction to BBC BASIC' thread here has all the relevant links, including to the source at GitHub.

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: ScriptBasic

Fri May 10, 2019 10:04 am

Heater wrote:
Fri May 10, 2019 9:53 am
Clearly the educational advice did not work.
I woudn't say that, but government policy intervened (in the UK). At some point in the 1990s it was decided that kids shouldn't be taught how to program, but simply how to use common software applications such as Microsoft Office. It's that policy change that led to the dire state of affairs that Eben commented upon, not the quality of teaching or choice of programming language etc. Programming was reintroduced to the curriculum as a result.

As evidence that the BBC Computer Literacy Project was sucessful I would point to the fact that the UK has led in the field of games programming, particularly, since those days. Many of the world's top developers in that field would credit the BBC Micro and BBC BASIC for getting them started.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22662
Joined: Sat Jul 30, 2011 7:41 pm

Re: ScriptBasic

Fri May 10, 2019 10:06 am

Heater wrote:
Fri May 10, 2019 9:28 am
RichardRussell,
Why would you want to?
I wouldn't. It's what I found when I looked for "bbcbasic":

Typing "bbcbasic" into a search box gets this as the first hit: http://www.bbcbasic.co.uk/bbcbasic.html

That looks very much like the BBCBasic download page. It even says "DOWNLOADS". So guess what I do next?

The link you just gave links to a random, unknown, website: www.rtr.myzen.co.uk. The kind of place I would not trust binary executables from.

Can I grab the source code and build instructions from github or some such?
If you are implementing download security by how official the web address looks, you need to think about your security. Anyone can buy an official sounding web address....

Same with github, anyone can upload stuff to github and make it look official....
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Heater
Posts: 12603
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Fri May 10, 2019 10:20 am

RichardRussell,
You could have clicked on the BBC BASIC for SDL 2.0 for Mac OS-X, Linux (x86), Raspberry Pi, Android, iOS and Windows™ Vista, 7, 8/8.1 and 10 link.
I could have done. If such a thing existed on the BBCBascic DOWNLOADS page Google found for me here:
http://www.bbcbasic.co.uk/bbcbasic.html
...how did you discover it was a 32-bit binary if you aren't prepared to trust it?!
Sometimes I take risks. In this case I guessed "rtr" was you, I can trust you can't I?
My Windows and MacOS binaries are signed with a Comodo certificate, but I'm not aware that Linux has that option universally.
Never heard of such a thing.

A simple SHA-256 hash from a widely known and trusted web site would do for me. And using HTTPS.
...including to the source at GitHub.
Got it. Got some building to do...

User avatar
PeterO
Posts: 4723
Joined: Sun Jul 22, 2012 4:14 pm

Re: ScriptBasic

Fri May 10, 2019 10:22 am

I'm not impressed with the installation process....
A tar ball ! Ugh ! And a file called "install64.txt" which isn't even an executable but tells me to manually install some packages ! If the installation is this manual it will discourage it's adoptedion in an educational environment.

And then , when I do get it to run I just get a popup asking me to make a choice between "Andy Parkes' "BBCEdit"" and "Richard Russell's "SDLIDE" with no information about what these are or why I should choose one over the other. Asking users to make an uniformed decision isn't helpful.
This is not the way to get people to try out your software :shock:

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: ScriptBasic

Fri May 10, 2019 10:41 am

Heater wrote:
Fri May 10, 2019 10:20 am
I could have done. If such a thing existed on the BBCBascic DOWNLOADS page Google found for me here:
http://www.bbcbasic.co.uk/bbcbasic.html
In the first column, under VERSIONS.
Never heard of such a thing.
You're concerned about security but have never heard of Code Signing Certificates? :roll:

hippy
Posts: 5326
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: ScriptBasic

Fri May 10, 2019 10:46 am

jahboater wrote:
Thu May 09, 2019 6:31 pm
How about a new challenge.

Implement a Dartmouth BASIC interpreter in your language of choice:
But to what end, for what purpose, to prove what ?

I'm not sure how it's a "challenge" in any shape or form, merely an exercise in pointlessness and squandering resources which could be put to better use.

Why avoid Basic when this thread can be as easily derailed as the other ?

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: ScriptBasic

Fri May 10, 2019 10:50 am

PeterO wrote:
Fri May 10, 2019 10:22 am
I'm not impressed with the installation process....
I'm open to suggestions. Linux is not my main programming platform (I'm a dyed-in-the-wool Windows user) and I was advised that a zip was the most universal way of distributing BBC BASIC given the large number of 'flavours' of Linux. If there's a better way that won't tie the user to a specific distro I am very happy to change it.
And then , when I do get it to run I just get a popup asking me to make a choice between "Andy Parkes' "BBCEdit"" and "Richard Russell's "SDLIDE" with no information about what these are or why I should choose one over the other.
I honestly don't know how to solve that problem other than to delete one or the other, which would not be fair to the author. Which you prefer to use is going to be a highly subjective choice, and really the only way is to try both for a while to see how you get on with them. Naturally I always use my own IDE but that came along quite a while after Andy's.
This is not the way to get people to try out your software :shock:
So tell me what to do, I'm very receptive to advice. I find it difficult to support so many different platforms, most of which I know little about (the beauty of SDL is that one doesn't need to know about the OS one is targetting in detail), so I'm reliant on feedback from those that do.

User avatar
bensimmo
Posts: 4059
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: ScriptBasic

Fri May 10, 2019 11:10 am

Heater wrote:
Fri May 10, 2019 9:53 am
RichardRussell,
I disagree with you quite fundamentally,..
I'm sure many do. And I do understand the reasons why.
...it goes against an important educational principle: that a student should be able to progress at his own pace....
The advice the BBC received (from some of the UK's top educational experts at the time) was the opposite of what you propose, that a language should be chosen which was ideally suited to beginners but which at the same time had the power and sophistication to allow teaching of more advanced concepts...
That all makes sense to me as well.

However, I will point out that in the decades since BASIC started getting extended with BBCBasic, all the MS versions and other variants, CS education and the computing skills of those leaving school plummeted. So much so that Eben Upton noticed it among applicants to Cambridge and decided something had to be done.

Which is odd because all that stuff was available for the PC's everyone had. I posit that it all became too complex for kids to even stick their nose into.

Clearly the educational advice did not work.
Clearly it *did* work, the BBC BASIC era brought the people you know and love to do their job. They are you 40something old programmers of today.
It is the decades after that that had the problem, the none BBC BASIC era of child.
The one that know word, excel and how to layout a letter and a bit about how to use an office environment that are the problem.
The 486 and Windows95 era of child.

The government obviously predicted it needed a different type of workforce at that point and moved the syllabus as such.

hippy
Posts: 5326
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: ScriptBasic

Fri May 10, 2019 12:26 pm

RichardRussell wrote:
Fri May 10, 2019 10:50 am
PeterO wrote:
Fri May 10, 2019 10:22 am
I'm not impressed with the installation process....
I'm open to suggestions. Linux is not my main programming platform (I'm a dyed-in-the-wool Windows user) and I was advised that a zip was the most universal way of distributing BBC BASIC given the large number of 'flavours' of Linux. If there's a better way that won't tie the user to a specific distro I am very happy to change it.
A .deb or something which installed and configured everything one needed would be ideal but distributing as a .tar.gz or .zip with a written list of instructions and what to do isn't unusual.

A .tar.gz would probably be more familiar to most Linux users. And that may also have the advantage of creating a sub-directory to extract into rather than inadvertently extracting everything into /home/pi as I initially did. But that's just a documentation issue -

Code: Select all

cd ~
mkdir bbcsdl
cd bbcsdl
wget http://www.rtr.myzen.co.uk/bbc-rpi.zip
unzip bbc-rpi.zip
RichardRussell wrote:
Fri May 10, 2019 10:50 am
PeterO wrote:
Fri May 10, 2019 10:22 am
And then , when I do get it to run I just get a popup asking me to make a choice between "Andy Parkes' "BBCEdit"" and "Richard Russell's "SDLIDE" with no information about what these are or why I should choose one over the other.
I honestly don't know how to solve that problem other than to delete one or the other, which would not be fair to the author. Which you prefer to use is going to be a highly subjective choice, and really the only way is to try both for a while to see how you get on with them.
That can probably be resolved by stating that in the initial pop-up; "You need to select an IDE to edit your source code. Try them both and see which you like. Just close BBC BASIC and run ./bbcsdl again to select the other option".

A note on how to change the IDE or get the selection pop-up again if "Don't ask again" has been ticked in the installation guide wouldn't go amiss.
RichardRussell wrote:
Fri May 10, 2019 10:50 am
PeterO wrote:
Fri May 10, 2019 10:22 am
This is not the way to get people to try out your software :shock:
So tell me what to do, I'm very receptive to advice.
I don't think it's that bad. It's better than a lot of what I have encountered. At least it worked when the instructions given were followed.

I can't say I'm that impressed with it running on my Pi 3B - far too sluggish and laggy - but in terms of installation it was reasonable enough.

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: ScriptBasic

Fri May 10, 2019 12:50 pm

hippy wrote:
Fri May 10, 2019 12:26 pm
That can probably be resolved by stating that in the initial pop-up; "You need to select an IDE to edit your source code. Try them both and see which you like
I agree that the "Choose IDE" in the title bar isn't obvious. I'll experiment with adding that text or something like it.
A note on how to change the IDE or get the selection pup-up again if "Don't ask again" has been ticked in the installation guide wouldn't go amiss.
Delete /home/pi/.local/share/BBCBasic/chooseide.dat
I can't say I'm that impressed with it running on my Pi 3B - far too sluggish and laggy
Have you enabled the 'experimental' GL (VC4) driver? Without the hardware acceleration it provides, SDL2's graphics are very slow (even more so after the mesa regression that happened between Jessie and Stretch). Here, with that driver enabled, I find BBC BASIC quite responsive on an RPi 3 but I'm using a 1280x720 display so performance may be hit if yours is bigger. What CPU usage is reported when running glxgears?

Heater
Posts: 12603
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Fri May 10, 2019 12:58 pm

RichardRussell,
In the first column, under VERSIONS.
Excuse me for being led down a cul-de-sac by "DOWNLOADS" in big friendly capital letters....
You're concerned about security but have never heard of Code Signing Certificates?
Sure, I have signed all kind of things, never heard of Comodo though. Is that a Windows thing or do you have instructions for checking the file signature from Linux?

Anyway....

Yay! I got BBC BASIC built from source on a Debian PC and it runs:

Code: Select all

$ git clone https://github.com/rtrussell/BBCSDL.git
$ cd BBCSDL/
$ ls
$ vim licence.txt 
$ cd bin/
$ ls
$ cd linux/
$ ls
$ make
$ sudo apt-get install libsdl2-dev 
$ make
$ sudo apt-get install nasm
$ make
$ sudo apt-get install libsdl2-ttf-dev 
$ make
$ sudo apt-get install libsdl2-net-dev
$ make
$ ls
$ ./bbcsdl 
$ cd heater/fibo_4784969/BASIC/
$ ls
$ /home/heater/BBCSDL/bin/linux/bbcsdl fibo_bbc.bas 
That was painless enough. In the absence of any build instructions I had to sniff around and guess. Did I do right this time Richard?

Boo! It does not understand BASIC:

Code: Select all

10 PRINT "HELLO WORLD"

Syntax error
>
Ah well. Let's try ScriptBasic's fibo program which is said to run under BBC BASIC:

Code: Select all

$ cd ~/fibo_4784969/BASIC
$ ~/BBCSDL/bin/linux/bbcsdl fibo_script.bas
That pops up a dialog box that helpfully announces "Bad program". Then segfaults when I click OK.

Not going well here.

What to do?

Edit: After desperately hunting around for a "getting started" page of the BBC BASIC documentation I tried this:

$ bbcsdl -c fibo.bbc

Which I read somewhere was supposed to compile the program. Nothing happens.

From within the bbcsdl terminal window I tried:

> RUN "fibo.bbc"

After reading somewhere else that should run from the file. It just responds with "Mistake".
Last edited by Heater on Fri May 10, 2019 1:33 pm, edited 1 time in total.

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: ScriptBasic

Fri May 10, 2019 1:26 pm

Heater wrote:
Fri May 10, 2019 12:58 pm
Boo! It does not understand BASIC:

Code: Select all

10 PRINT "HELLO WORLD"
That's perfectly valid BBC BASIC code. I'm wondering whether you're trying to run it without an IDE! BBC BASIC (in this version) is not a scripting language and doesn't fully support a console-style interface. You can enter immediate-mode commands, but not numbered program lines.

Since you've built it from the source you may not have copied all the supporting BASIC files, in particular you need bbcsdl.bbc in the folder where you've built the binary plus the lib/ and examples/tools/ trees for the IDEs to run. Everything's in the GitHub repo but you may not have extracted it all, or not to the right place. Edit: You've probably built the binary in the bin/linux/ directory, copy it up two levels into the BBCSDL directory and run it there. That may fix everything.

It would have been so much easier if you had the confidence to download and install the pre-built binary!

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: ScriptBasic

Fri May 10, 2019 1:44 pm

RichardRussell wrote:
Fri May 10, 2019 1:26 pm
You've probably built the binary in the bin/linux/ directory, copy it up two levels into the BBCSDL directory and run it there. That may fix everything.
Just some more clarification, in case anybody else hits the same problem. BBC BASIC is expecting the binary (bbcsdl, or bbcsdl.exe in Windows) to be in the project root, the same directory which contains bbcsdl.bbc. If run there, and all the support files in lib/ and examples/ are present, it will automatically invoke the Choose IDE dialogue. Thereafter you will be in the GUI environment.

If you don't want to use the GUI, bbcsdl will accept a command-line argument of a BASIC program to run, but it must be in the internal (tokenised) .bbc format not a plain text file. BBC BASIC is not designed to be used as a scripting language but if you really want to run a plain text program at the command line this wiki article describes how to do it.

Heater
Posts: 12603
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Fri May 10, 2019 2:34 pm

Yay! I now have the bbcsdl executable in the right place and on my PATH. I now get an IDE.

I can run it from our fibo_4784969/BASIC repo directory like so:
$ cd fibo_4784969/BASIC/
$ ls
classic.bas fibo.bas fibo.bbc integer.bas README.md visual.bas
$ bbcsdl
The IDE comes up and I select "File->Load" and navigate to our fibo.bbc file. It opens in the edit window nicely.

Boo! Nothing works.

I hit the arrow icon in the icon bar, guessing it is "run". That results in a Window opening displaying the helpful message:
Syntax error
>
OK. What about the gears looking icon, that looks like it builds something.

That asks me if I want to build an application called fibo.zip.

I hit "Create Application" and a dialog announces "Application Bundle Created Successfully". Cool.

I hit that arrow/run icon again. Again "Syntax error".

What to do?

The code I want to run is ScriptBasic's fibo. Which is now in the fibo_4784969 repository if that helps: https://github.com/ZiCog/fibo_4784969/b ... C/fibo.bbc

User avatar
ScriptBasic
Posts: 1226
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Fri May 10, 2019 2:58 pm

Why is it called fibo.bbc when it's ScriptBasic specific?

Heater
Posts: 12603
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Fri May 10, 2019 3:03 pm

ScriptBasic,
Why is it called fibo.bbc when it's ScriptBasic specific?
Because you said above that it was, or should, be BBCBasic compatible.

Because you asked above if anyone had run it under BBC Basic.

Am I wasting my time here?

I now have some BASIC code that is apparently not compatible with any known BASIC engine.

I have a BASIC engine that won't run BASIC.

What to do?

User avatar
ScriptBasic
Posts: 1226
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Fri May 10, 2019 3:12 pm

I converted a QuickBasic Fibo to run under ScriptBasic. There are unique keywords in that script like SPLITA and a line number/ label scheme other BASICs don't support.

Anyone trying to run that BASIC fibo should use the original or further edit my version and eliminate all line number labels except the ones used by GOTO/GOSUB.

Heater
Posts: 12603
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Fri May 10, 2019 3:23 pm

I know the original works. ejolson wrote it so that was always a certainty.

ejolson
Posts: 3016
Joined: Tue Mar 18, 2014 11:47 am

Re: ScriptBasic

Fri May 10, 2019 3:24 pm

Heater wrote:
Fri May 10, 2019 3:03 pm
What to do?
Run the original classic Basic code with the three changes mentioned in this post which says
RichardRussell wrote:
Tue May 07, 2019 12:30 pm
BBC BASIC ran the 'classic' version with the only modifications being to change LOG to LN (in BBC BASIC LOG is base-10) and to add at the beginning:

Code: Select all

      HIMEM = PAGE + 20000000
      q1 = 0 : q2 = 0
The first line increases the amount of available memory, and the second initialises q1 and q2 (in BBC BASIC variables do not have a 'default' value).
Code written in more paradigmatic BBC Basic is included in the avoiding Basic thread here, though it lacks the Karatsuba algorithm.
Last edited by ejolson on Fri May 10, 2019 3:32 pm, edited 1 time in total.

Heater
Posts: 12603
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Fri May 10, 2019 3:31 pm

So far with BBC BASIC when I load and try to run our various BASICs I get the following:

For the "classic.bas" => "Mistake at line 100"

For "fibo.bas" => "Mistake"

For "integer.bas" => "Mistake at line 100"

For "visual.bas" => "Mistake"

Does this thing actually run any kind of BASIC?

Heater
Posts: 12603
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Fri May 10, 2019 3:38 pm

ejolson,

I copied classic.bas to classic_bbc.bas. Made the changes you suggested above. Load and run it. I get:

Mistake at line 100
>

I despair, this is like getting Squeak to work.
Last edited by Heater on Fri May 10, 2019 3:40 pm, edited 1 time in total.

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: ScriptBasic

Fri May 10, 2019 3:39 pm

ejolson wrote:
Fri May 10, 2019 3:24 pm
Run the original classic Basic code with the three changes mentioned
And be patient! Although BBC BASIC will run the classic Fibo with those changes, it's very slow and takes several minutes to complete the million-digit challenge even on a fast PC (one issue is the use of GOTO and line numbers, which are much slower than the structured equivalents like WHILE etc). A version optimised for BBC BASIC ought to run much faster, and apparently there is one but I haven't tried it.

One thing this thread has made me think about (well actually the closed thread - many thanks to John for allowing his ScriptBasic thread to be highjacked) is writing a 'bigint' library for BBC BASIC. Yes, it could call into an external library like HIME or GMP or MAPM, but it would be much more satisfying - although not as fast - to write a native code library..

I've already started to think about how I might leverage BBC BASIC's array arithmetic to boost performance of such a library. If we are into challenges, how about a challenge to write a big integer library in your favourite BASIC dialect, no assembler code or calls to external modules allowed?

Return to “Other programming languages”