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

Re: ScriptBasic

Wed May 15, 2019 2:38 pm

OK, so getting more reports in this thread.

Please keep on topic, and I suspect the semantics of what is and isn't BASIC is off topic. And that's off topic for the entire forum, not just this thread.

Is that enough warning?
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."

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

Re: ScriptBasic

Wed May 15, 2019 2:45 pm

jahboater wrote:
Wed May 15, 2019 1:12 pm
ScriptBasic wrote:
Wed May 15, 2019 1:10 pm
There is only one version of C
Only BASIC has more variations than C.
Not sure I understood that.
There is only one C (as per the ISO C18 standard), any compiler not correctly supporting that is in error.
There are, it is true, "extensions", but they are always in addition to the standard.
It appears gcc offers the following dialects of C accessible using the -std flag: c89, iso9899:1990, iso9899:199409, c99, c9x, iso9899:1999, iso9899:199x, gnu89, gnu99, gnu9x. It also includes settings for trigraphs, openmp and cilk. There is apparently no support for the original Kernighan and Ritchie dialect or any of the far and near keywords used on segmented Intel hardware running in real mode. There are primitives for short vectors (which keep getting longer) that are different for NEON, Altivec, SSE and AVX. As gcc doesn't appear to emulate these vector types and instructions for architectures which don't have them, this can introduce additional incompatible language variations.

I remember one forum member who essentially said, if it can't be compiled by the Ritchie C compiler it isn't really C. This is similar to looking at the Dartmouth compilers (or Microsoft interpreters) to determine whether something is Basic.

From this point of view the differences between ScriptBasic, BBC Basic and the others are pretty much as expected for dialects of a language that has been around a long time.
Last edited by ejolson on Wed May 15, 2019 2:58 pm, edited 3 times in total.

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

Re: ScriptBasic

Wed May 15, 2019 2:55 pm

ScriptBasic,
With the C BASIC gcc pre-processor, I make C look like BASIC. All modern languages are a descendent of BASIC program flow including C.
James has warned us not to get off topic. But as this is your thread and your topic I hope I'm allowed to protest at the above statement.

C is so clearly a descendant of ALGOL. With its support for structured programming that BASIC did not have at the time.

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

Re: ScriptBasic

Wed May 15, 2019 2:56 pm

ScriptBasic wrote:
Wed May 15, 2019 2:36 pm
With the C BASIC gcc pre-processor, I make C look like BASIC. All modern languages are a descendent of BASIC program flow including C.
Err, no. Algol58, CPL, Cobol, FORTRAN etc all came before BASIC. CPL was a forerunner of C.

https://en.wikipedia.org/wiki/History_o ... _languages
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."

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: ScriptBasic

Wed May 15, 2019 2:58 pm

hippy wrote:
Wed May 15, 2019 2:34 pm
One wouldn't expect Visual Basic to compile Xojo program without error, or vice-versa, any more than you would expect Go to compiler a Rust program without error, or vice-versa. They are all their own unique languages, even if they may be descended from the same parent.
Agreed!

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

Re: ScriptBasic

Wed May 15, 2019 3:00 pm

This thread has been driven somewhat off-topic since the "Why Avoid Basic?" thread got locked, seems to have similarly become anti-Basic and driven in an "anything but basic" direction, but that may just be my personal feelings. Whatever; I'll be glad to see it back on-topic.

And in that respect -

How does one add libraries/modules for ScriptBasic. I tried to use the IUP library, added an "import iup.bas" line but just get a "not found" error -

Code: Select all

[email protected]:~/tmp $ cat iup.sb
IMPORT iup.bas
IUP::Open()
IUP::Info(INFO)
PRINT "SYSTEMLANGUAGE: ",INFO{"SYSTEMLANGUAGE"},"\n"

Code: Select all

[email protected]:~/tmp $ scriba iup.sb
iup.sb(1): error &H3e:Include file is not found

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: ScriptBasic

Wed May 15, 2019 3:05 pm

ejolson wrote:
Wed May 15, 2019 2:45 pm
It appears gcc offers the following dialects of C accessible using the -std flag: c89, iso9899:1990, iso9899:199409, c99, c9x, iso9899:1999, iso9899:199x
Also C11, C17, C18 and the forthcoming C2x

No!

These are successive ISO standards for the same single language. Unlike Python, they are extremely careful to avoid invalidating the vast amount of existing C code worldwide.

Well off topic, sorry.

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

Re: ScriptBasic

Wed May 15, 2019 3:12 pm

jamesh wrote:
Wed May 15, 2019 2:56 pm
ScriptBasic wrote:
Wed May 15, 2019 2:36 pm
With the C BASIC gcc pre-processor, I make C look like BASIC. All modern languages are a descendent of BASIC program flow including C.
Err, no. Algol58, CPL, Cobol, FORTRAN etc all came before BASIC. CPL was a forerunner of C.

https://en.wikipedia.org/wiki/History_o ... _languages
There is a reason I like programming in ALGOL-60 : From http://i.stanford.edu/pub/cstr/reports/ ... 73-403.pdf
C.A.R. Hoare wrote: The more I ponder the principles of language design, and the techniques which put them into practice, the more is my amazement and admiration of ALGOL 60. Here is a language so far ahead of its time, that it was not only an improvement on its predecessors, but also on nearly all ts successors.
8-) 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

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

Re: ScriptBasic

Wed May 15, 2019 3:13 pm

KEEP ON TOPIC. Also talking to myself.
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."

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

Re: ScriptBasic

Wed May 15, 2019 3:21 pm

How does one add libraries/modules for ScriptBasic. I tried to use the IUP library, added an "import iup.bas" line but just get a "not found" error -
I haven't relased the IUP (PUI) extension module for the RPi. The RPi isn't a default distribution for IUP. I had to compile a distribution native on the RPi. Still testing.

If you would like to help test the IUP ext. module, join the RaspberryBASIC.org forum. I'll create a thread for it.

The RPi distribution comes with the following extension modules.

MySQL
SQLite
JSON
XML
cURL
SBT - threading support

Available but not in the core distribution.

BBC BASIC graphic primatives
SDL_gfx
Tiny Scheme
Draw
IUP
JAPI
JS - V7 JavaScript
GPIO
SHAT - RPI Sence HAT sensors

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

Re: ScriptBasic

Wed May 15, 2019 4:08 pm

IUP INFO example.

Code: Select all

IMPORT iup.bas
ih = IUP::Open()

IUP::Info(INFO)

PRINT "SYSTEMLANGUAGE: ",INFO{"SYSTEMLANGUAGE"},"\n"
PRINT "DRIVER: ",INFO{"DRIVER"},"\n"
PRINT "SYSTEM: ",INFO{"SYSTEM"},"\n"
PRINT "SYSTEMLOCALE: ",INFO{"SYSTEMLOCALE"},"\n"
PRINT "COMPUTERNAME: ",INFO{"COMPUTERNAME"},"\n"
PRINT "USERNAME: ", INFO{"USERNAME"},"\n"
PRINT "MONITORSINFO: ",INFO{"MONITORSINFO"},"\n"
PRINT "SCREENSIZE: ",INFO{"SCREENSIZE"},"\n"
PRINT "SCREENDEPTH: ",INFO{"SCREENDEPTH"},"\n"
PRINT "VIRTUALSCREEN: ",INFO{"VIRTUALSCREEN"},"\n"
PRINT "DLGFGCOLOR: ",INFO{"DLGFGCOLOR"},"\n"
PRINT "DLGBGCOLOR: ",INFO{"DLGBGCOLOR"},"\n"
PRINT "DEFAULTFONT: ",INFO{"DEFAULTFONT"},"\n"
PRINT "DEFAULTFONTSIZE: ",INFO{"DEFAULTFONTSIZE"},"\n"
PRINT "TXTFGCOLOR: ",INFO{"TXTFGCOLOR"},"\n"
PRINT "TXTBGCOLOR: ",INFO{"TXTBGCOLOR"},"\n"

IUP::CLOSE(ih)
Output

Code: Select all

[email protected]:~/sbrpi/examples $ scriba iupinfo.sb
SYSTEMLANGUAGE: en-us
DRIVER: GTK
SYSTEM: Linux
SYSTEMLOCALE: UTF-8
COMPUTERNAME: RPi3B
USERNAME: pi
MONITORSINFO: 0 0 1824 984

SCREENSIZE: 1824x984
SCREENDEPTH: 24
VIRTUALSCREEN: 0 0 1824 984
DLGFGCOLOR: 46 52 54
DLGBGCOLOR: 237 237 237
DEFAULTFONT: PibotoLt 12
DEFAULTFONTSIZE: 12
TXTFGCOLOR: 0 0 0
TXTBGCOLOR: 255 255 255
[email protected]:~/sbrpi/examples $ 

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

Re: ScriptBasic

Wed May 15, 2019 4:10 pm

ScriptBasic wrote:
Wed May 15, 2019 2:15 pm
1. Retro - Dartmouth like, line number centric, GOTO / GOSUB for structure
Yet you described BBC BASIC as "retro", when it was one of the first BASICs - possibly the very first - to deprecate the use of GOTO/GOSUB and to promote the use of structured programming and named functions with parameters. That was, more than anything else, what the BBC set out to achieve back in 1980. I've not written a BBC BASIC program using GOTO or GOSUB in decades, apart from the occasional test program to check that they still work!
2. Traditional - QuickBasic like, function /:subs for structure.
By your own definition that must be what BBC BASIC is then. I've not (yet) ported the CLASSLIB library, which gives BBC BASIC for Windows some OOP functionality, to BBC BASIC for SDL 2.0 so I won't make any claims for that.

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

Re: ScriptBasic

Wed May 15, 2019 4:16 pm

Sorry Richard!

I still relate BBC BASIC to the ACORN era of the language as I'm only a casual user. Obviously you have progressed from there.

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

Re: ScriptBasic

Wed May 15, 2019 4:43 pm

RichardRussell wrote:
Fri May 10, 2019 12:50 pm
Have you enabled the 'experimental' GL (VC4) driver?
Started a new thread on that : https://www.raspberrypi.org/forums/view ... 8&t=240578

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

Re: ScriptBasic

Wed May 15, 2019 4:43 pm

ScriptBasic wrote:
Wed May 15, 2019 4:16 pm
I still relate BBC BASIC to the ACORN era of the language
That's what I was referring to. The original Acorn (Sophie Wilson) implementation on the 1982 BBC Micro deprecated the use of GOTO/GOSUB and provided structured programming and named function capabilities. It's what BBC BASIC is famous for, above all else. Later Acorn versions added more constructs (like CASE statements and parameters passed by reference) but all the ingredients for it to qualify as 'Traditional' in your terms were there before any of my extensions.

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

Re: ScriptBasic

Wed May 15, 2019 5:29 pm

jahboater wrote:
Wed May 15, 2019 2:02 pm
hippy wrote:
Wed May 15, 2019 1:33 pm
In your link to Dennis Ritchie's history of C in another thread he notes there are many "descendants" of C; Concurrent C, Objective C, C*, C++, and we can add C# and others like Go and Rust, and probably more.

I don't see that as much different to there being multiple descendants of BASIC.
The descendent's of BASIC are all called BASIC. PowerBASIC, BBC BASIC, Script BASIC, QB BASIC etc, and all claim to be the new BASIC.

C is different. The descendants of C that Mr Ritchie mentioned last century have all gone, probably since the first ISO standard was ratified. Later languages like D, Go, Rust and even C# are not C and don't claim to be, even though they may have included concepts from C, just like C included concepts from Algol68, BCPL, PL/1 and B. Since then C has had nearly three decades of strong ISO standards that decent compilers all support. There is only one C.

C++ is the exception as it is (mostly) a superset of C.
I mentioned this before. from the C99 Rationale ...
Minimize incompatibilities with C++. The Committee recognizes the need for a clear and
defensible plan for addressing the compatibility issue with C++. The Committee endorses the
principle of maintaining the largest common subset clearly and from the outset. Such a principle
should satisfy the requirement to maximize overlap of the languages while maintaining a
distinction between them and allowing them to evolve separately.
The Committee is content to let C++ be the big and ambitious language. While some features of
C++ may well be embraced, it is not the Committee’s intention that C become C++.
Missing a point there. You read Basic in a name and assume.it is all BASIC.

People read C in a name and think they are all some C, C++, C# whatever, they're all C to me all the same but just don't seem to work the same way.

That's the point.
You know they are different,.many people do not. In the same way any think Java and Javascript are the same, one just a scripting version of the other.

Rust, that's is own language, has it own name nothing like the others, obviously.

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

Re: ScriptBasic

Wed May 15, 2019 5:29 pm

Though I seem to have missed a few pages, lol

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

Re: ScriptBasic

Thu May 16, 2019 3:23 am

I would be interested to hear how you might see ScriptBasic working with one of your projects. What feature do you need most?

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

Re: ScriptBasic

Thu May 16, 2019 3:34 am

@hippy,

Did you ever have a chance to look at the GPIO extension module using the library you suggested?

GPIO Extension Module

I feel the next step is defining what the arguments need to be and what the functions accomplish.

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

Re: ScriptBasic

Fri May 17, 2019 5:41 pm

I have been waiting to hear back from the author of IUP about a couple obscure warning messages Gtk was outputting to the console while testing the build. He said just ignore them as IUP does things a bit differently that makes Gtk confused.

I should be posting the RPi build of IUP for beta testing this weekend on the RaspberryBASIC.org forum.

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

Re: ScriptBasic

Fri May 17, 2019 6:32 pm

ScriptBasic wrote:
Thu May 16, 2019 3:34 am
Did you ever have a chance to look at the GPIO extension module using the library you suggested?
Not as such. Got side-tracked with other things and had too-many plates spinning at once.

Part of what I've been working on has been making changes to my tools for extension creating so I should be able to get back to extensions after the weekend. Hopefully those tools will be able to generate ScriptBasic extensions as well as Python extensions.

It's Eurovision tomorrow so that's an evening which will be devoid of coding :P

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

Re: ScriptBasic

Fri May 17, 2019 6:42 pm

That's great news!

Maybe we can use your Python extension module builder to embed ScriptBasic in Python using the SBT code.

Python with ScriptBasic flying right seat. Could be interesting.

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

Re: ScriptBasic

Sat May 18, 2019 9:00 am

Continuing from the "general language discussion" thread...

ScriptBasic,
Use the link posted in the quote from the resource post.

The resource page clearly gives the correct link to the ScriptBasic repository.
Yes I know. They do not work.

Code: Select all

$ git clone [email protected]:scriptbasic/sb-dev.git
Cloning into 'sb-dev'...
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ git clone https://sandbox.allbasic.info/scriptbasic/sb-dev.git
Cloning into 'sb-dev'...
fatal: repository 'https://sandbox.allbasic.info/scriptbasic/sb-dev.git/' not found
I make the following observations:

1. An enthusiastic person itching to try ScriptBasic will have a hard tme finding it.

As we discussed a while back, the first thing google finds when looking for scriptbasic downloads is scriptbasic.com. Which you tell us is old out unmaintained and we should not use it.

2. OK. On scriptbasic.com it does say in big friendly red letters to use the "FORUM". Not what one is looking for but lest see...

Oops...That link is broken. What about the "WIKI"? There we find instructions for installing from .debs but no links to get them from!

3. Eventually we find scriptbasic.org.

That is a forum. Not what one is looking for but let's see...

Hmm.. No links to downloads or resources anywhere. Well, except some attached tar files we find in the "Download" discussion area.

4. Ahh...What's that "Sandbox" thing?

Bingo! It links to a source code repository.

Sadly nothing can be fetched from there....see above.

5. Unless one registers oneself on gitlab to get access.

Which is not going to happen. Never had to signup to anything to get an open source projects source code yet.

jalih
Posts: 57
Joined: Mon Apr 15, 2019 3:54 pm

Re: ScriptBasic

Sat May 18, 2019 9:32 am

Heater wrote:
Sat May 18, 2019 9:00 am
Which is not going to happen. Never had to signup to anything to get an open source projects source code yet.
This link seems to work...

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

Re: ScriptBasic

Sat May 18, 2019 10:11 am

jalih,

So it does. Now that I look again I see I can download a source tar ball or zip. Not quite what I had in mind but let's see...

Some time later...

The readme.txt file is is out of date. It suggests visiting scriptbasic.com for build instructions.

The README.md lists dependencies but has no build instructions.

There is a "build.txt" file hat is sadly empty.

Hmmm...OK, with no build documentation let's just install the dependencies and hit the Makefile...

Code: Select all

$ make
gcc  -w -c -o bin/obj/basext.o basext.c
basext.c:3099:10: fatal error: basext.h: No such file or directory
 #include "basext.h"
          ^~~~~~~~~~
compilation terminated.
Makefile:115: recipe for target 'bin/obj/basext.o' failed
make: *** [bin/obj/basext.o] Error 1
Well, there is no "basext.h" file in this tar ball.

I presume that some configuration or code generation needs to be done first. Let's try the install script:

Code: Select all

$ ./install.sh
###ERROR creating directory /etc/scriba
./install.sh: 41: ./install.sh: let: not found
###ERROR setting the permission of /etc/scriba to 555
./install.sh: 46: ./install.sh: let: not found
###ERROR creating directory /usr/share/scriba/include
./install.sh: 60: ./install.sh: let: not found
###ERROR setting the permission of /usr/share/scriba/include to
Ah, it want's root privs. No way is that going to happen, how world one change the installation path?

Damn thing has created a hidden directory in my home directory already. Very impolite considering we have nothing even built yet.

What to do?

Return to “Other programming languages”