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

Re: ScriptBasic

Thu Jun 20, 2019 2:10 am

Nice addition to the AIR space. :D

That memory leak test made my day.

Mystery why I can't run hfibo (recursive) on my RPi 3 B. It runs out of memory.

newfibo (AIR) runs in 38 seconds on the RPi 3 B.

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

Re: ScriptBasic

Thu Jun 20, 2019 3:30 am

Airr,
I don't know if using 'top' is the correct way to check for leaks;
Top is a pretty crude tool. But when you watch a program running for an hour or so and you see that top reports the memory consumption going up every few seconds, eventually going through 10%, 20% , 40%, 80% of your available 8GB RAM, you know there is a problem and there is only one outcome. The program and/or system it's running on will die from lack of memory.

I'm pretty sure that if you run any of the ScriptBasic fibos once in a program and then exit then ScriptBasic cleans up all memory nicely. I'm pretty sure valgrind reports no leaks in this case.

But that is not what I have been doing...

I demonstrate the memory leak with a modified 1milfibo program that puts the fibo calculation into a function and calls it endlessly, it's here:
posting.php?mode=reply&f=34&t=238001#pr1482283

When you run that you can definitely see memory leaking in top.

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

Re: ScriptBasic

Thu Jun 20, 2019 5:10 am

The question still remains why I can't run the recursive fibo without running out of memory on the RPi 3 B.

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

Re: ScriptBasic

Thu Jun 20, 2019 5:56 am

AIR,

I'm going to create a new sandbox repo called RaspberryBASIC. This branch will only include extension modules that would be appropriate for the RPi. (no MySQL, ODBC, ...) It would include the WPI, IUP, GMP, SLD gfx & draw. The main focus of this branch would be its device / sensor interface library.

Most developers like to work on their laptop so traditional ScriptBasic would be maintained as usual.

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

Re: ScriptBasic

Thu Jun 20, 2019 6:07 am

This makes no sense to me. High level languages should be cross platform.

Even if some libs/modules/extensions are platform specific.

Having yet another fork of SB is even more confusing it than it is now.

It's more maintenance work.

Plenty of people use MySql and such on their Pi.

I don't get it.

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

Re: ScriptBasic

Thu Jun 20, 2019 6:10 am

I'm looking for community feedback. I'm trying to make the ScriptBasic user experience more adaptable to their needs.

If you don't install the dependencies will mkdist.sh create a no frills install or complain about missing files?

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

Re: ScriptBasic

Thu Jun 20, 2019 8:40 am

Heater wrote:
Thu Jun 20, 2019 6:07 am
High level languages should be cross platform.
Agree 100%. The only RPI-specific library supplied with BBC BASIC is gpiolib.bbc, everything else is totally cross-platform including 2D and 3D graphics, sound, music, shader programming, socket access (TCP and UDP), fonts, dialog boxes etc, making it possible to write programs that will run virtually anywhere without modification.

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

Re: ScriptBasic

Thu Jun 20, 2019 10:37 am

ScriptBasic wrote:
Thu Jun 20, 2019 5:56 am
I'm going to create a new sandbox repo called RaspberryBASIC. This branch will only include extension modules that would be appropriate for the RPi. (no MySQL, ODBC, ...) It would include the WPI, IUP, GMP, SLD gfx & draw.
A more appropriate course would be to extend the "./extensions" directory to have "./extensions/generic", "./extensions/pi", "./extensions/windows", "./extensions/linux" etc. Though you might choose to have the platform specific division higher up in the directory structure.

Having separate repos for different platforms is IMO a bad idea and will just make things more complicated for people who may be undertaking ScriptBasic development on multiple platforms. That could easily lead to fixes done for one repo not propagating to others, creating a maintenance nightmare.

Calling it "RaspberryBASIC" is just another layer of confusion on top of that which we already have.

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

Re: ScriptBasic

Thu Jun 20, 2019 3:34 pm

The concensious is leave things as they are. Hopefully this means that the users / developers of ScriptBasic are taking ownership in the project.

Don't be shy, I like hearing about issues / features you would like changed or enhanced. Getting BIGINT support in ScriptBasic was a direct result of input from the members of this forum. Let's keep the momentum going.

A lower key approach to my idea of a fork may be a custom mkdist.sh script for different platforms. Mostly a extension module collection.

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

Re: ScriptBasic

Thu Jun 20, 2019 11:11 pm

ScriptBasic wrote:
Thu Jun 20, 2019 3:34 pm
A lower key approach to my idea of a fork may be a custom mkdist.sh script for different platforms. Mostly a extension module collection.
Why? The mkdist.sh script works on Arm/x86/x64 Linux, and on macOS.

If you don't want specific modules, when building for a given platform just remove them from the extensions folder. Or better yet, create a file called "notunix.txt" in the folder for the extension you do not want built. Then do a 'make clean' if you've already run the ./setup script, and then re-run ./setup

Of course, anyone can modify (or create anew) the mkdist.sh script to suit their needs. I created it to personally avoid issues with multiple copies of SB being installed breaking stuff (as you've (@ScriptBasic) experienced more times than I care to count).

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

Re: ScriptBasic

Thu Jun 20, 2019 11:56 pm

Thanks AIR for the mkdist.sh details. It seems the flexability is there to meet anyone's needs.
Or better yet, create a file called "notunix.txt" in the folder for the extension you do not want built.
Best option in my opinion as well.

The fork idea is officially dead by popular demand.

The feedback I'm getting is most interested in BASIC with the RPi would prefer the console stdio interface due to ssh connections rather than running full desktop. The clue was zero interest in IUP or the SDL based extension modules.
Last edited by ScriptBasic on Fri Jun 21, 2019 2:57 am, edited 2 times in total.

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

Re: ScriptBasic

Fri Jun 21, 2019 1:40 am

@hippy,

I got tied up chasing ghosts with hfibo and GMP and put my GPIO interests aside.

Can you give me an update where you are with your SB extension module?

AIR,

Did you get hippy's bug notification that text associated to error codes isn't being displayed? I think this is an extension module issue only.
(as you've (John) experienced more times than I care to count)
If it wasn't for the -D option, I would be lost. I would like the -v option to show scriba's full path. I've run the wrong scriba more than once. :?

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

Re: ScriptBasic

Fri Jun 21, 2019 3:28 am

I pushed the WiringPi GPIO extension module to the extensions project ScriptBasic sandbox repository.

Direct Link

Note: The WiringPi library from Gordon's site is a prerequisite to use.

I'm going to be creating a ScriptBasic Examples project sandbox repository. They are currently spread out over numerous sites.

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

Re: ScriptBasic

Fri Jun 21, 2019 11:29 am

ScriptBasic wrote:
Fri Jun 21, 2019 1:40 am
Can you give me an update where you are with your SB extension module?
This is the latest update of the 16th June version; uses sb-dev git branch, has the named constants issue fixed and includes raising errors. My test program is included below.

It is interesting that 16th June release got downloaded 14 times. That does seem to suggest there is some interest in using ScriptBasic.

Code: Select all

PRINT "Started\n"
IMPORT gpio.bas
PRINT "Imported\n"
PRINT gpio::version(), "\n"
IF gpio::runningWithSudo() <> 0 THEN
  PRINT "Running with sudo\n"
ELSE
  PRINT "Running without sudo\n"
END IF
result = gpio::enter()
IF result <> 0 THEN
  PRINT "Initialised : ", result, " - FAILED\n"
ELSE
  PRINT "Initialised : ", result, " - Okay\n"
  PRINT "GPIO Address : ", + gpio::getGpioPtr(), "\n"
  FOR pin = 0 TO 27
    IF gpio::getAllow(pin) = 1 THEN
      PRINT pin, " = ", gpio::getAlt(pin), " ", gpio::getAltName(pin), "\n"
    ELSE
      PRINT pin, " ! ", gpio::getAlt(pin), " ", gpio::getAltName(pin), "\n"
    END IF
  NEXT
  pin = 0
  PRINT "Pulsing GPIO", pin, "\n"
  gpio::setAllow(pin)
  gpio::setPin(pin, 0)
  gpio::setAlt(pin, gpio::ALT_OUTPUT)
  FOR count = 1 TO 10
    gpio::setPin(pin, 1)
    gpio::setPin(pin, 0)
  NEXT
  gpio::leave()
END IF
PRINT  "Finished\n"
sb-gpio.tar.gz
(13.62 KiB) Downloaded 18 times

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

Re: ScriptBasic

Fri Jun 21, 2019 2:28 pm

It would be great if ScriptBasic finds a home on the Raspberry Pi.

Did you resolve your error message text being displayed for your extension module?

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

Re: ScriptBasic

Fri Jun 21, 2019 3:09 pm

Yes, it would be great for ScriptBasic to have a home on the Pi.

It would be a thousand times better for ScriptBasic to feel at home on a PC, running Windows or Linux, and on Mac, and on pretty much anything else that supports a C compiler.

Pretty much everything I have ever written that runs on a Pi was developed, in whole or in part, on some other machine. I appreciate a seamless transfer from dev system to Pi and vice versa.

It would be even better if it could be used on embedded systems that don't support a C compiler. Having been cross-compiled elsewhere.

Given that ScriptBasic is just a command line C program, all this should be possible relatively easily.

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

Re: ScriptBasic

Fri Jun 21, 2019 3:18 pm

As I mention before, ScriptBasic is an embeddable sculpting engine API by design. Scriba is a pre-assembled example of how it works.

Scriba uses C as its host. SBT embeds ScriptBasic into itself. ScriptBasic is an object oriented design.

I'm going to create a SBLite (full featured) interpreter that will be less than a dozen lines of code that will run the interpreter as a shared object with a footprint of about 12 KB. The major difference from scriba is it doesn't support any of the command line options. (-D, -d, ...)

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

Re: ScriptBasic

Fri Jun 21, 2019 5:35 pm

ScriptBasic would be great IF ..

Let me know if I can help you resolve your SB IF.

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

Re: ScriptBasic

Fri Jun 21, 2019 6:13 pm

ScriptBasic wrote:
Fri Jun 21, 2019 2:28 pm
Did you resolve your error message text being displayed for your extension module?
No; that's a ScriptBasic bug so "not my problem to solve", but I'm not sure whose problem it is to solve.

I did take a look at the source, and I'm guessing the 'report.c' code is where it's at, but it's all utterly impenetrable without understanding how things work underneath the hood and I don't have any interest in figuring that out.

And this is perhaps the biggest issue with ScriptBasic; that it's no longer an authored or owned project, is merely being carried around. It seems it's pretty much a 'dead in the water' project when it comes to fixing any bugs which may be found. One simply has to put up with those bugs or take on the mantle of becoming the new owner, having to understand it all, or a lot of it.

Those bugs may be liveable with for some, and what ScriptBasic offers some people may outweigh such issues, but it's not a great shape for any project to be in.

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

Re: ScriptBasic

Fri Jun 21, 2019 6:47 pm

ScriptBasic is a MIT based Open Source project. No one is getting paid to maintain it or covering the costs of facilitating it. I provide those services and well as project management as a contribution to the project I believe strongly in. If you have no interest in contributing to the project, that's fine but don't put the guilt on others saying they aren't doing their job. If you find something that isn't working for you, do your best to identify the source and AIR and I will try to do our best to find resolve. That is how true open source projects work. Everyone is responsible and no one is to blame.

Feel free to fork ScriptBasic and show us what you can do with the BASIC to make it superior. I've spent 15 years getting my arms around the design and feature set. I'm sure you're a better C programmer than I so maybe it won't take you as long.

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

Re: ScriptBasic

Fri Jun 21, 2019 7:41 pm

ScriptBasic,

Sometimes I don't understand what you are saying...
ScriptBasic is an embeddable sculpting engine API by design.
That is very commendable but it it not what one reads here: http://scriptbasic.com/

Meanwhile here: https://sourceforge.net/projects/scriptbasic/ says:

"ScriptBasic is a mature Basic interpreter that can be used for server side CGI scripting, utility programming or to develop GUI desktop applications. A multi-threaded HTTP Basic application server is available as well with session support."

And this: https://sandbox.allbasic.info:8181/scri ... reated_asc Says nothing.

The new: https://www.scriptbasic.org also gives no immediate clue as to what ScriptBasic is.
Scriba uses C as its host.
ScriptBasic is written in C. Is it not?
SBT embeds ScriptBasic into itself.
What is "SBT"?
ScriptBasic is a MIT based Open Source project.
Apart from using the MIT licence how is it based on anything from MIT?
That is how true open source projects work. Everyone is responsible and no one is to blame.
I'm not sure about that. If I write code and publish it and it has bugs then that is my fault. No one else is responsible but me.

My observation is that "true" open source projects have an author who takes his responsibility for correctness seriously. Perhaps until such time he can step down and let whatever community around the thing take care of it.

Classic examples are Python and the Linux kernel.
ScriptBasic would be great IF .. Let me know if I can help you resolve your SB IF.
Let's start with the meaningless error messages and the memory leaks...

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

Re: ScriptBasic

Fri Jun 21, 2019 7:52 pm

ScriptBasic works for me. I joined this forum to share what I like about it. If you think it's too buggy or not supported at the level you are use to, use something else. It's really that simple.

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

Re: ScriptBasic

Fri Jun 21, 2019 8:16 pm

Yes, it's really simple for us. In this day and age we are so amazingly lucky that we can use C, C++, D, Rust, Python, Javascript, Ruby, Go, Java, Erlang and a great many others beside.

You did ask for "IFs". So I did my best to answer.

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

Re: ScriptBasic

Fri Jun 21, 2019 8:19 pm

Now we need to find contributors interested in those IFs.

As an example it took me 10 minutes to resolve Hippy's grip about the wordy FATAL syntax error message. How much pain did he incur before mentioning it bothered him?

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

Re: ScriptBasic

Fri Jun 21, 2019 8:41 pm

Imagine setting up a canvas and a pallet of paint in a busy lobby somewhere with a sign saying ...

If you're an artist, please contribute to this unfinished masterpiece.

Return to “Other programming languages”