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

Re: ScriptBasic

Wed Jul 03, 2019 1:27 pm

A suggestion for ScriptBasic. Can the IMPORT command handling, eg -

IMPORT iup.bas

Be modified to look for the <file> then <file>.bas so the .bas doesn't have to be explicitly specified in the import command.

It is possible to create 'iup' alongside 'iup.bas' in /usr/local/include/scriba to allow "IMPORT iup" to be used, but it would be nicer if one did not have to.

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

Re: ScriptBasic

Wed Jul 03, 2019 2:35 pm

All the Windows include files end in .inc. The SB build system creates the .bas includes. File name attributes are optional. (.bas, .sb, ...)

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

Re: ScriptBasic

Wed Jul 03, 2019 2:57 pm

ScriptBasic wrote:
Wed Jul 03, 2019 2:35 pm
All the Windows include files end in .inc. The SB build system creates the .bas includes. File name attributes are optional. (.bas, .sb, ...)
Ok. I'll create copies symlinks of the .bas files in /usr/local/include/scriba without extensions.

Code: Select all

import os
path = "/usr/local/include/scriba"
files = os.listdir(path)
for file in files:
  if file.endswith(".bas"):
    if not file[:-4] in files:
      print("Found "+path+"/"+file)
      os.symlink(path+"/"+file, path+"/"+file[:-4])
Last edited by hippy on Wed Jul 03, 2019 6:01 pm, edited 3 times in total.

Airr
Posts: 20
Joined: Sun Jun 16, 2019 5:17 pm

Re: ScriptBasic

Wed Jul 03, 2019 3:30 pm

FWIW, symlinks work also.

One way to do this:

Code: Select all

find ~/sb/include -iname "*.bas" -exec sh -c 'ln -sf "$1" "${1%.*}"' _ {} \;
Change the path to the include folder accordingly....

EDIT: Or if you prefer doing it with Python:

Code: Select all

#!/usr/bin/env python

import os,glob

x = glob.glob('/home/riveraa/sb/include/*.bas')

for f in x:
    os.symlink(f,os.path.splitext(f)[0])
This is rudimentary and doesn't check if the symlink already exists.

AIR.

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

Re: ScriptBasic

Wed Jul 03, 2019 6:00 pm

Airr wrote:
Wed Jul 03, 2019 3:30 pm
FWIW, symlinks work also.
Excellent idea. That's much better, avoids the problems of the .bas changing, and it's much simpler code. Updated my previous post.

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

Re: ScriptBasic

Sun Jul 14, 2019 4:10 pm

Hippy,

How is the GPIO extension module coming along? Did the analyzer app provide any help?

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

Re: ScriptBasic

Mon Jul 15, 2019 2:59 am

David Zimmer wrote the COM/OLE/VB6 extension module and IDE/Debugger. This is Dave's observation of ScriptBasic under the covers. (early look)

ScriptBasic Embedding

I would love to hear AIR's take about working with ScriptBasic source.

For me, ScriptBasic taught me to appreciate language development. I'm still unwrapping the gift.

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

Re: ScriptBasic

Mon Jul 15, 2019 1:57 pm

ScriptBasic wrote:
Sun Jul 14, 2019 4:10 pm
Hippy,

How is the GPIO extension module coming along? Did the analyzer app provide any help?
Still the same as it was about three weeks ago. I still haven't got round to doing any physical hardware testing.

https://www.raspberrypi.org/forums/view ... 5#p1483069

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

Re: ScriptBasic

Mon Jul 15, 2019 5:52 pm

I'm thinking of digging into my box of home automation sensors and get the GPIO focus with ScriptBasic going again. Have you tried the WiringPi extension module?

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: ScriptBasic

Thu Jul 18, 2019 2:30 am

About the BrandyBASIC extensions to ScriptBasic, do they support tokenized BBC BASIC V code (like normal Brandy BASIC does)? Also what features are missing (if you know).
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

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

Re: ScriptBasic

Thu Jul 18, 2019 3:25 am

The Brandy extension module is only the graphics portion of the language. You are still using ScriptBasic

The Brandy extension module is a wrapper for a generic shared object I created that can be used by any language. I did a few BaCon examples.

I would like to see the Brandy and SDL_gfx work together in conjunction. I had SDL_draw working together with the Brandy module.


Brandy and ScriptBasic

Brandy and C BASIC

Brandy and BaCon

Brandy generic shared object source

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: ScriptBasic

Thu Jul 18, 2019 3:44 pm

ScriptBasic wrote:
Thu Jul 18, 2019 3:25 am
The Brandy extension module is only the graphics portion of the language. You are still using ScriptBasic

The Brandy extension module is a wrapper for a generic shared object I created that can be used by any language. I did a few BaCon examples.

I would like to see the Brandy and SDL_gfx work together in conjunction. I had SDL_draw working together with the Brandy module.


Brandy and ScriptBasic

Brandy and C BASIC

Brandy and BaCon

Brandy generic shared object source
Ok kool. It does look like it would be fairly easy to translate between BBC BASIC and ScriptBASIC with those extensions.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

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

Re: ScriptBasic

Thu Jul 18, 2019 4:02 pm

Open Source Robitc Arm

It uses WiringPi and the RPi. This would be a great ScriptBasic project. CNC 101

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

Re: ScriptBasic

Thu Jul 18, 2019 5:54 pm

Let me know when you get ScriptBasic going on your RPi. I will push the Brandy extension module source to the sandbox.

David,

Before we kick this off I want to be up front and say this is your baby going forward. I will setup a project in the sandbox and make you the maintainer. If you're good with that I will support you to the best of my abilities.

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

Re: ScriptBasic

Thu Jul 18, 2019 9:18 pm

ScriptBasic wrote:
Thu Jul 18, 2019 5:54 pm
Let me know when you get ScriptBasic going on your RPi. I will push the Brandy extension module source to the sandbox.

David,

Before we kick this off I want to be up front and say this is your baby going forward. I will setup a project in the sandbox and make you the maintainer. If you're good with that I will support you to the best of my abilities.
It looks like a port of Perl is available on RISC OS, so there might be some hope of building ScriptBasic too.

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

Re: ScriptBasic

Thu Jul 18, 2019 9:39 pm

Even if Perl wasn't available, you could still compile ScriptBasic using existing headers. You would only need to run make.

It would be cool to see SB running on RISC OS.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: ScriptBasic

Thu Jul 18, 2019 10:06 pm

ScriptBasic wrote:
Thu Jul 18, 2019 5:54 pm
Let me know when you get ScriptBasic going on your RPi. I will push the Brandy extension module source to the sandbox.

David,

Before we kick this off I want to be up front and say this is your baby going forward. I will setup a project in the sandbox and make you the maintainer. If you're good with that I will support you to the best of my abilities.
Let me see how well I do with getting it running in the first place. Then I will be able to decide if I can devote enough time to it to be worthwhile for others.

I will definitely be attempting to get it up and running though. A quick question:
What are all dependancies for building (I will skip over the perl bit, as headers can be edited by hand). And other than a C Library and SDL are there any other requirements at run time (like anything POSIX, etc)?

I thank you.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: ScriptBasic

Thu Jul 18, 2019 10:10 pm

Is there by any chance an archive of the current source? If not that is ok.

Also should I join the allbasic forums if I decide to take this up?
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

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

Re: ScriptBasic

Thu Jul 18, 2019 10:44 pm

Good idea joining AllBasic. That is where AIR and I discuss ScriptBasic development issues. It mostly a forum of BASIC developers.

As soon as you decide to accept this mission impossible task I will generate the resources you need.

There are two requirements to compile ScriptBasic on an OS.

1. Must have a ANSI C compliant compiler

2. Must support POSIX standards

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: ScriptBasic

Fri Jul 19, 2019 3:48 am

ScriptBasic wrote:
Thu Jul 18, 2019 10:44 pm

2. Must support POSIX standards
That may take some extra work. UnixLib on RISC OS is not exactly complete (it is only designed to aid in porting software).

Though I have decided it is worthwhile to get going on the RISC OS target.

I have already got the SDL dev libraries installed, as well as the tools that should be needed. Just need the ScriptBasic source and the modules for BBC BASIC functions (may also see about some of the other features of ScriptBasic as I learn to play with it).

Need a bit of help to get the code:
Unfortunately I am not finding the actual git url to download the existing code. If you could post the url to clone the repo I would appreciate it.

As far as the rest, we will get to that when I am ready to post some changes.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

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

Re: ScriptBasic

Fri Jul 19, 2019 4:28 am

Here is the runtime and source for the Brandy extension module for the Rpi.

SDL 1.2 is a dependency.
Attachments
SB_Brandy_SRC.zip
(23.42 KiB) Downloaded 2 times
SB_Brandy_RT.zip
(37.83 KiB) Downloaded 3 times

verhas
Posts: 2
Joined: Fri Jul 19, 2019 1:55 pm

Re: ScriptBasic

Fri Jul 19, 2019 3:43 pm

I designed and created the version of ScriptBasic that was developed from 1995 till 2006. I have not touched the code since then. If you have any architectural questions, like why unbound arrays and similar questions I may, if I remember, answer some of those. There are also some things that I do not remember why I did that the way I did. Note it was more than 25 years ago.

The original intention of ScriptBasic was to create a BASIC like interpreter that can be embedded into C application to open the possibility for the users to script. That time Python was far from the popularity it is now. Today my brother in law learns Python. He is a biologist. That day even BASIC or any programming would have been a freak-out for a biologist. BASIC was the candidate if any at all that could provide scripting.

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

Re: ScriptBasic

Fri Jul 19, 2019 6:05 pm

Thank you Peter for joining us!

It's great hearing from the author of this amazing BASIC. My hope is your love for BASIC will restore your memory and allow you to mentor us here on the forum.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: ScriptBasic

Fri Jul 19, 2019 9:47 pm

@ScriptBasic:
Could I get that git url for the main ScriptBasic source?

Or am I going to have to load up a JS browser to extract the url?
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

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

Re: ScriptBasic

Fri Jul 19, 2019 10:12 pm

You can git pull or clone this url.

https://sandbox.allbasic.info:8181/scri ... sb-dev.git

It would be great if a Brandy / Matrix compatible shared object / extension module could be standardized so legacy code could run under a more modern version of BASIC. There really is no limit how far one could go extending a Brandy like environment.

Return to “Other programming languages”