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

Re: ScriptBasic

Sat Apr 13, 2019 9:53 pm

This project is just over 20 years old. I'm not starting over. Feel free to do with ScriptBasic as you like. I will continue to support the project as I have in the past.

The software on the ScriptBasic.com site is outdated and unusable. I will chat with Peter about redirecting the site to ScriptBasic.org.

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

Re: ScriptBasic

Sat Apr 13, 2019 10:28 pm

Sounds like a good idea.

Only when I enter https://www.scriptbasic.org into my browser I ends up at https://www.scriptbasic.org/forum/.

No immediate description of what scriptbasic is or why I might want it, no examples, no download and install instructions, no documentation at all. Just a forum about something or other.
Memory in C++ is a leaky abstraction .

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

Re: ScriptBasic

Sat Apr 13, 2019 10:49 pm

I updated the ScriptBasic.org forum (RPi thread) with all the available downloads for the Raspberry Pi.

The scriptbasic-rpi-zero.deb will run on all versions of the Raspberry Pi.

The scriptbasic-2.1-linux-armhf.deb and sb.AppImage.zip downloads will only work on the ARMv7 class of boards.

The instructions for installing the .deb files are the same. Just use the appropriate file name for the install you're doing.

One of my goals this year is to get a professional looking open source home page built for the site. If any web developers out there would like to contribute to the project by building a home page for the site, it would be greatly appreciated.

There is a wiki with user and developer documentation. The sandbox icon points to Gitlab repo for the project. (see upper right corner of forum page)

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

Re: ScriptBasic

Sat Apr 13, 2019 11:00 pm

ScriptBasic wrote:
Sat Apr 13, 2019 7:24 pm
If I've read it right; ScriptBasic is effectively 'abandonware' since Peter moved on,
No. you read it wrong. I have over 15 years invested managing the the ScriptBasic project. That doesn't sound like ABANDONWARE to me or the other developers.
I did actually write "If I've read it right; ScriptBasic is effectively 'abandonware' since Peter moved on, but it still has its users and advocates, has yourself and others still keeping it alive".
ScriptBasic wrote:
Sat Apr 13, 2019 7:24 pm
The ScriptBasic.com site is active for historical reasons. It's no longer maintained.
Perhaps one could say "abandoned". Which is what it looks like to me, and why I put it as I did.
ScriptBasic wrote:
Sat Apr 13, 2019 9:53 pm
The software on the ScriptBasic.com site is outdated and unusable.
Exactly. Yet here you are promoting "ScriptBasic".

Maybe it's my mistake for thinking scriptbasic.com was "Scriptbasic", but there's nothing else which seems to be "ScriptBasic" out there as far as I can see.
ScriptBasic wrote:
Sat Apr 13, 2019 7:24 pm
The ScriptBasic.org site is the official domain for the project.
scriptbasic.com declares itself the "official home page" of ScriptBasic. It's what Wikipedia links to as the official site. How would anyone know that the forum is the actual official site, or that it related to a new ScriptBasic not the old ScriptBasic ?

scriptbasic.org jumps straight to a forum. scriptbasic.com links to that, or would if the link worked.

And the download section for source code and binaries hasn't been posted to since the start of 2017.

Added : You say you've updated the "RPi thread" with the source code. But where exactly is that ? I probably will sift through the site to find it, but I really shouldn't have to.

As I said; it's a mess.
ScriptBasic wrote:
Sat Apr 13, 2019 9:53 pm
This project is just over 20 years old. I'm not starting over. Feel free to do with ScriptBasic as you like.
I would love to, but I haven't yet found the source code which I can compile for a Pi. And I can't try integrating it into my C extension as I'd like to try.

I'm not trying to be awkward I just want to use it.

I found the .deb, installed that, its captured my attention, you've got my interest. I now want to do more. If you could just tell people from which link the source code can be downloaded I'm sure they'd be very grateful. That's the way it's normally done, the best way to attract interest in something..

Added : Okay it's that "sandbox" link. A more obvious, better titled, link would have helped.

I'm not having a go at you, not trying to pick a fight; I'm just trying to help you to help us - me the Pi community - and that's for everyone's benefit.
ScriptBasic wrote:
Sat Apr 13, 2019 10:49 pm
One of my goals this year is to get a professional looking open source home page built for the site.
That sounds like a great idea. But don't worry about 'professional', It needs to be more useful than look good. Something simple will do; an explanation of how things are, that script.com is where things were, scriptbasic.org is where it's now at, with links to downloads of binaries and and source.

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

Re: ScriptBasic

Sat Apr 13, 2019 11:28 pm

ScriptBasic,
One of my goals this year is to get a professional looking open source home page built for the site
Good. But...

First things first. At the end of the day all the world needs is the code and some instructions as to how to build and use it. That is just a source repository and a README file.

A good example might be the SpinalHDL harware description language: https://github.com/SpinalHDL/SpinalHDL
There is a wiki with user and developer documentation. The sandbox icon points to Gitlab repo for the project. (see upper right corner of forum page)
No. There is not.

From https://www.scriptbasic.org/forum/ if I hit the "sandbox", whatever that is, I get to https://sandbox.allbasic.info:8181/scriptbasic/sb-dev If I hit the wiki link there I get: "This project has no wiki pages"
Memory in C++ is a leaky abstraction .

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

Re: ScriptBasic

Sat Apr 13, 2019 11:35 pm

Form the scriptbasic.org forum on the RPi thread ... "Most of the ScriptBasic development activity is happening on the All BASIC Forum" which raised a wry smile.

I think I managed to get the source code with -

Code: Select all

cd ~
wget https://sandbox.allbasic.info:8181/scriptbasic/sb-dev/-/archive/master/sb-dev-master.tar.gz
tar -zxvf sb-dev-master.tar.gz
cd sb-dev-master
But then I'm at a loss as to what to do next.

./setup ?

That seems to require -

perl jamal.pl -i

When I run that it asks me ...

Code: Select all

Your Perl installation has the following
directories where these modules can be installed:
1. /etc/perl
2. /usr/local/lib/arm-linux-gnueabihf/perl/5.24.1
3. /usr/local/share/perl/5.24.1
4. /usr/lib/arm-linux-gnueabihf/perl5/5.24
5. /usr/share/perl5
6. /usr/lib/arm-linux-gnueabihf/perl/5.24
7. /usr/share/perl/5.24
8. /usr/local/lib/site_perl
9. /usr/lib/arm-linux-gnueabihf/perl-base
which directory you want me to create a 'jamal'
subdirectory and copy all the listed pm files? Type
the number and press enter:
I have no idea how to answer the question.

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

Re: ScriptBasic

Sat Apr 13, 2019 11:52 pm

hippy wrote:
Sat Apr 13, 2019 11:35 pm
But then I'm at a loss as to what to do next.
I also had trouble finding the source. None of the posts I read mention where the sandbox is and the graphic didn't look like a link.

I think the advice is to download from the clean branch rather than the master repository. Then you need to run setup.

Setup is a Perl script that automatically generates headers and tries to compile everything. It will ask that you install some extra Perl stuff in one of the system libraries. There is also a read me file which lists some Debian packages that are not preloaded into Raspbian by default.

I had a few errors in my build, so I won't post an exact description of what I did. However, enough of ScriptBasic got built that I was able to run the simple test program.

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

Re: ScriptBasic

Sat Apr 13, 2019 11:58 pm

hippy wrote:
Sat Apr 13, 2019 11:35 pm
Form the scriptbasic.org forum on the RPi thread ... "Most of the ScriptBasic development activity is happening on the All BASIC Forum" which raised a wry smile.

I think I managed to get the source code with -

Code: Select all

cd ~
wget https://sandbox.allbasic.info:8181/scriptbasic/sb-dev/-/archive/master/sb-dev-master.tar.gz
tar -zxvf sb-dev-master.tar.gz
cd sb-dev-master
But then I'm at a loss as to what to do next.

./setup ?

That seems to require -

perl jamal.pl -i

When I run that it asks me ...

Code: Select all

Your Perl installation has the following
directories where these modules can be installed:
1. /etc/perl
2. /usr/local/lib/arm-linux-gnueabihf/perl/5.24.1
3. /usr/local/share/perl/5.24.1
4. /usr/lib/arm-linux-gnueabihf/perl5/5.24
5. /usr/share/perl5
6. /usr/lib/arm-linux-gnueabihf/perl/5.24
7. /usr/share/perl/5.24
8. /usr/local/lib/site_perl
9. /usr/lib/arm-linux-gnueabihf/perl-base
which directory you want me to create a 'jamal'
subdirectory and copy all the listed pm files? Type
the number and press enter:
I have no idea how to answer the question.
I created the subdirectory

/usr/local/lib/site_perl

then changed the owner to be my personal account

Code: Select all

$ sudo mkdir /usr/local/lib/site_perl
$ sudo chown pi:pi /usr/local/lib/site_perl
and then selected option 8 for the Perl install directory.
Last edited by ejolson on Sun Apr 14, 2019 12:00 am, edited 1 time in total.

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

Re: ScriptBasic

Sat Apr 13, 2019 11:58 pm

So one needs Perl to build BASIC. Right?

But, given I have Perl to hand why would I need BASIC?

I get more confused every day...
Memory in C++ is a leaky abstraction .

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

Re: ScriptBasic

Sun Apr 14, 2019 12:05 am

Heater wrote:
Sat Apr 13, 2019 11:58 pm
So one needs Perl to build BASIC. Right?

But, given I have Perl to hand why would I need BASIC?

I get more confused every day...
Are you saying that Basic should be used instead to build Perl?

I think the main use of Perl is for some sort of automatically generated language parser. If I understood correctly, Perl is doing the work of yacc and lex.

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

Re: ScriptBasic

Sun Apr 14, 2019 12:18 am

ejolson,
Are you saying that Basic should be required instead to build Perl?
No. Of course not.

Forgive me if I am wrong but I get the idea that what we have here is a BASIC language system written in C. Perhaps even C++.

As such all that is required is a C compiler and most likely make.
I think the main use of Perl is for some sort of automatically generated language parser. If I understood correctly, Perl is doing the work of yacc and lex.
OMG.
Memory in C++ is a leaky abstraction .

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

Re: ScriptBasic

Sun Apr 14, 2019 12:24 am

A Perl module the ScriptBasic build system needs is the reason for the following command. Do this first before running ./setup Make sure your developer dependencies are installed.

Code: Select all

sudo perl jamal.pl -i


If you're looking for pre-built installs, they can be found on the ScriptBasic.org forum.

If you're looking for docs the link just above the sandbox graphic will get you to the project wiki. (user & dev docs)

If you're looking for source, click on sandbox graphic and use the cleanup branch.


I wish I could dedicate more time this but I have clients screaming as well.

Have fun and I'll try to answer your questions as they come up.

User avatar
Gavinmc42
Posts: 4363
Joined: Wed Aug 28, 2013 3:31 am

Re: ScriptBasic

Sun Apr 14, 2019 12:26 am

Have a look at Sakaki's wiki on her Gentoo64 github pages.
I did not even know github did a wiki until then.
https://github.com/sakaki-/gentoo-on-rpi3-64bit/wiki
Not sure how many pages she has done, must be hundreds?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: ScriptBasic

Sun Apr 14, 2019 12:27 am

Heater wrote:
Sat Apr 13, 2019 11:58 pm
So one needs Perl to build BASIC. Right?

But, given I have Perl to hand why would I need BASIC?

I get more confused every day...
It's not unusual. One needs C to build Python, Perl, node.js, and probably most other things. And many builds use some scripting language or other to glue things together; node.js building uses Python.

I'm currently working on a Python program which generates C extensions for use with Python :D

Let's not go down the rabbit hole of why anyone would need anything other than C / Assembler or feign outrage or confusion when other language tools are being used to build some other language compilers.

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

Re: ScriptBasic

Sun Apr 14, 2019 12:52 am

hippy,
Let's not go down the rabbit hole ...
Yeah, OK, I know what you mean.

It troubles my mind anyway...

Somehow we got the first programs into computers by toggling switches to set memory locations. That was used to create symbolic assembly languages. Which in turn were used to write compilers for high level languages like C.

And so it goes ... until we find we need frikken Python to build a Javascript engine. Or Perl to build BASIC.
Memory in C++ is a leaky abstraction .

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

Re: ScriptBasic

Sun Apr 14, 2019 12:55 am

ejolson wrote:
Sat Apr 13, 2019 11:58 pm
I created the subdirectory
/usr/local/lib/site_perl ...
Many thanks. Without doing any apt-get installs of prerequisites I managed to get something built, so moving forward. This is on Pi 3B, Raspbian Stretch Full.

Code: Select all

cd ~
wget https://sandbox.allbasic.info:8181/scriptbasic/sb-dev/-/archive/cleanup/sb-dev-cleanup.tar.gz
tar -zxvf sb-dev-cleanup.tar.gz
cd sb-dev-cleanup
sudo mkdir /usr/local/lib/site_perl
sudo chown pi:pi /usr/local/lib/site_perl
perl jamal.pl -i
                            -- select /usr/local/lib/site_perl (8)
./setup

Code: Select all

scriba executable OK  
sbhttpd executable OK  
libscriba library OK  
MODULE sqlite:   dll FAIL lib FAIL bas OK  
MODULE mt:       dll OK   lib OK   bas OK  
MODULE odbc:     dll FAIL lib FAIL bas OK  
MODULE ux:       dll OK   lib OK   bas OK  
MODULE sdbg:     dll OK   lib OK   bas OK  
MODULE sbt:      dll OK   lib OK   bas OK  
MODULE ip:       dll OK   lib OK   bas OK  
MODULE json:     dll OK   lib OK   bas OK  
MODULE curl:     dll FAIL lib FAIL bas OK  
MODULE slre:     dll OK   lib OK   bas OK  
MODULE mxml:     dll OK   lib OK   bas OK  
MODULE hash:     dll OK   lib OK   bas OK  
MODULE cgi:      dll OK   lib OK   bas OK  
MODULE mysql:    dll FAIL lib FAIL bas OK  
MODULE trial:    dll OK   lib OK   bas OK  
MODULE t:        dll OK   lib OK   bas OK  
MODULE dbg:      dll OK   lib OK   bas OK  
MODULE curses:   dll FAIL lib FAIL bas OK  
MODULE zlib:     dll OK   lib OK   bas OK
But yay! ...

Code: Select all

[email protected]:~/sb-dev-cleanup $ ./bin/exe/scriba -v
ScriptBasic v2.1
Variation >>STANDARD<< build 1
Magic value 859037492
Node size is 24
Extension interface version is 11
Compilation: Apr 14 2019 01:49:07
And, with that, "Bong!", said Zebedee, "Time for bed".

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

Re: ScriptBasic

Sun Apr 14, 2019 1:08 am

Congrats!

You built your first version of ScriptBasic.

./setup --help

Will give you more options using the ScriptBasic build system. (build with no modules, build a particular module, ...)

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

Re: ScriptBasic

Sun Apr 14, 2019 4:00 am

ScriptBasic running Fibonacci(24) in three asynchronous threads on my RPi 3B. The execution time is still under a second. It would be great to see the results of other scripting engines doing the same thing.

sbt_fibonacci_main.sb

Code: Select all

' SBT Fibonacci Main

IMPORT sbt.bas
IMPORT mt.bas

SB_ThreadStart("sbt_fibonacci_thread.sb", "1","/etc/scriba/basic.conf")
SB_ThreadStart("sbt_fibonacci_thread.sb", "2","/etc/scriba/basic.conf")
SB_ThreadStart("sbt_fibonacci_thread.sb", "3","/etc/scriba/basic.conf")

WHILE mt::GetVariable("T3") = undef
WEND
sbt_fibonacci_thread.sb

Code: Select all

' SBT Fibonacci Thread

IMPORT sbt.bas
IMPORT mt.bas

tnum = COMMAND()

FUNCTION Fibonacci(n)
  IF n <= 2 THEN
    Fibonacci = 1
  ELSE
    Fibonacci = Fibonacci(n - 1) + Fibonacci(n - 2)
  END IF
END FUNCTION

PRINT Fibonacci(24)," - Thread ",tnum,"\n"
mt::SetVariable("T" & STR(tnum)), tnum

SB_ThreadEnd
Results

Code: Select all

[email protected]:~/sbrpi/examples $ time scriba sbt_fibonacci_main.sb
46368 - Thread 2
46368 - Thread 1
46368 - Thread 3

real	0m0.993s
user	0m3.670s
sys	0m0.000s
[email protected]:~/sbrpi/examples $ 

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

Re: ScriptBasic

Sun Apr 14, 2019 4:22 am

ScriptBasic wrote:
Sun Apr 14, 2019 4:00 am
ScriptBasic running Fibonacci(24) in three asynchronous threads on my RPi 3B. The execution time is still under a second. It would be great to see the results of other scripting engines doing the same thing.

sbt_fibonacci_main.sb

Code: Select all

' SBT Fibonacci Main

IMPORT sbt.bas
IMPORT mt.bas

SB_ThreadStart("sbt_fibonacci_thread.sb", "1","/etc/scriba/basic.conf")
SB_ThreadStart("sbt_fibonacci_thread.sb", "2","/etc/scriba/basic.conf")
SB_ThreadStart("sbt_fibonacci_thread.sb", "3","/etc/scriba/basic.conf")

WHILE mt::GetVariable("T3") = undef
WEND
sbt_fibonacci_thread.sb

Code: Select all

' SBT Fibonacci Thread

IMPORT sbt.bas
IMPORT mt.bas

tnum = COMMAND()

FUNCTION Fibonacci(n)
  IF n <= 2 THEN
    Fibonacci = 1
  ELSE
    Fibonacci = Fibonacci(n - 1) + Fibonacci(n - 2)
  END IF
END FUNCTION

PRINT Fibonacci(24)," - Thread ",tnum,"\n"
mt::SetVariable("T" & STR(tnum)), tnum

SB_ThreadEnd
Results

Code: Select all

[email protected]:~/sbrpi/examples $ time scriba sbt_fibonacci_main.sb
46368 - Thread 2
46368 - Thread 1
46368 - Thread 3

real	0m0.993s
user	0m3.670s
sys	0m0.000s
[email protected]:~/sbrpi/examples $ 
Can those threads share memory or are they running as separate processes?

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

Re: ScriptBasic

Sun Apr 14, 2019 4:27 am

MT is an extension module that allows sharing variables among threads in the same process. This is true multi-threading not spawning additional processes.

Notice that each thread can have it own basic.conf file.
Last edited by John_Spikowski on Sun Apr 14, 2019 4:54 am, edited 1 time in total.

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

Re: ScriptBasic

Sun Apr 14, 2019 4:39 am

I wonder if anyone is thinking AI robotics yet?

User avatar
Gavinmc42
Posts: 4363
Joined: Wed Aug 28, 2013 3:31 am

Re: ScriptBasic

Sun Apr 14, 2019 6:35 am

I wonder if anyone is thinking AI robotics yet?
Always ;)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: ScriptBasic

Sun Apr 14, 2019 8:41 am

ScriptBasic wrote:
Sun Apr 14, 2019 4:00 am
ScriptBasic running Fibonacci(24) in three asynchronous threads on my RPi 3B. The execution time is still under a second. It would be great to see the results of other scripting engines doing the same thing.

Code: Select all

import threading
import time

def Fibonacci(n):
  if n <= 2 : return 1
  else      : return Fibonacci(n - 1) + Fibonacci(n - 2)

def FiboThread():
  global running
  print(Fibonacci(24))
  running = running - 1

running = 3
threading.Thread(target=FiboThread).start()
threading.Thread(target=FiboThread).start()
threading.Thread(target=FiboThread).start()
while running > 0:
  time.sleep(0.02)

Code: Select all

[email protected]:~ $ time python fibo.py
46368
 46368
46368

real    0m0.481s
user    0m0.453s
sys     0m0.091s

Code: Select all

[email protected]:~ $ time python3 fibo.py
46368
46368
46368

real    0m0.635s
user    0m0.618s
sys     0m0.001s

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

Re: ScriptBasic

Sun Apr 14, 2019 2:18 pm

scruss wrote:
Sat Apr 13, 2019 3:35 am
hippy wrote:
Sat Apr 13, 2019 1:44 am
I'm still after the holy grail of a 'boot to Python' Pi clone of the micro:bit, …
here y'go, Arthur: boochow/micropython-raspberrypi: bare metal Raspberry Pi Zero / Zero W port of MicroPython
Just a follow-up as I seem to have got that compiling.

The 'gcc-arm-none-eabi' install was pretty quick, mere minutes. The first 'git submodule update --init' takes some time, sits there for ten minutes or so appearing to do nothing ...

Code: Select all

cd ~
sudo apt-get install gcc-arm-none-eabi
git clone https://github.com/boochow/micropython-raspberrypi.git
cd micropython-raspberrypi
git submodule update --init
cd micropython
git submodule update --init
cd ../raspberrypi
make BOARD=RPI1				or make BOARD=RPI2

Code: Select all

[email protected]:~/micropython-raspberrypi/raspberrypi $ ls -l ./build/*.img
-rwxr-xr-x 1 pi pi 257301 Apr 14 15:02 ./build/firmware.img
I haven't checked it does boot. I will take any further discussion of Bootable MicroPython to its own thread.

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

Re: ScriptBasic

Sun Apr 14, 2019 4:20 pm

It would be nice to know the order in which each Python thread finished. Can Python threads share variables among themselves? Can Python threads rerun themselves using the current variable states or reinitialized? Can Python run threads synchronously? (like a RUN in BASIC)

Return to “Other programming languages”