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

Re: ScriptBasic

Tue May 14, 2019 5:08 pm

I do realize that BASIC is a language. I have seen the book. I have used it.

I do realize that all those many and varied incompatible languages that happen to have with "BASIC" in the name are not BASIC.

I also realize that this is why the world avoids all those many and varied incompatible languages that happen to have with "BASIC" in the name.

If only the BASIC guys could have got their heads together and agreed on some standard for the future of BASIC.

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

Re: ScriptBasic

Tue May 14, 2019 5:20 pm

jamesh wrote:
Tue May 14, 2019 4:16 pm
So just don't write crap code, irrespective of whether the compiler/interpreter find it valid or not.
I would counter that this isn't really about writing code, more about what a compiler should do with crap code when a programmer writes that, when a programming language allows that to be done.

I would hope it's interesting to those who are into compiler writing or programming language design but can well understand why it won't be to anyone who isn't.

BTW: What colour paint have you got drying ? Do you know its Pantone number ?

:P :P

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

Re: ScriptBasic

Tue May 14, 2019 5:31 pm

Having to set how much memory the interpreter uses isn't what I would call a modern BASIC. That's nuts for this day and age. IMHO

Does BBC BASIC do threading?
Last edited by ScriptBasic on Tue May 14, 2019 5:35 pm, edited 1 time in total.

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

Re: ScriptBasic

Tue May 14, 2019 5:34 pm

Heater wrote:
Tue May 14, 2019 5:08 pm
I also realize that this is why the world avoids all those many and varied incompatible languages that happen to have with "BASIC" in the name.
But a huge part of the world doesn't. They pick a Basic variant they like the look of, or maybe the only one which exists for their platform or can be afforded, lash themselves to it, ignore all other variants, and have an entirely happy and productive life.
Heater wrote:
Tue May 14, 2019 5:08 pm
If only the BASIC guys could have got their heads together and agreed on some standard for the future of BASIC.
There's no need. Those using the basic they've chosen are happy with what they are using, don't care if anyone else is using that or isn't.

You're trying to solve a problem which basic users don't believe they have.

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

Re: ScriptBasic

Tue May 14, 2019 5:41 pm

You missed Small Basic, my son was very happy using that until he hit its limits.
Managed to do all sorts of fun things.

Pantone 18-1754 perhaps?
Visual Basic for Applications is probably my most used Basic.


And people think Python programmers have it hard with V2 and V3

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

Re: ScriptBasic

Tue May 14, 2019 5:44 pm

There are a ton of hobby BASIC's out there that are cute and fun to play with like a game.

I would never use any of them for projects for my clients.

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

Re: ScriptBasic

Tue May 14, 2019 5:54 pm

hippy,
You're trying to solve a problem which basic users don't believe they have.
I do believe you are right.

As long as people can play happily in their little sand box they don't have a problem. No blame there. Good on them.

I too was once innocent and happy in BASIC land.

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

Re: ScriptBasic

Tue May 14, 2019 5:56 pm

ScriptBasic wrote:
Tue May 14, 2019 5:31 pm
Having to set how much memory the interpreter uses isn't what I would call a modern BASIC.
BBC BASIC isn't a "modern" BASIC in that sense; it would impossible to be whilst maintaining compatibility with its namesake of 38 years ago. It's not surprising that it retains some of the original features such as a small memory footprint by default (the BBC Micro could have as little as 5Kbytes free memory in some graphics modes!). Nevertheless that default memory is sufficient for the vast majority of programs and occasionally having to increase it does not impair its functionality.

BBC BASIC's capabilities and achievements are there for everybody to see.

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

Re: ScriptBasic

Tue May 14, 2019 6:03 pm

How much demand is there for BBC BASIC to run 38 year old code?

Would you say BBC BASIC caters to the retro crowd?
Last edited by ScriptBasic on Tue May 14, 2019 6:07 pm, edited 1 time in total.

User avatar
rpdom
Posts: 14436
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: ScriptBasic

Tue May 14, 2019 6:07 pm

ScriptBasic wrote:
Tue May 14, 2019 6:03 pm
How much demand is there for BBC BASIC to run 38 year old code?
Quite possibly very little.

However there may be a relatively large demand for code that has been written since then in BBC BASIC and needs to retain that compatibility.

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

Re: ScriptBasic

Tue May 14, 2019 6:16 pm

Just the name itself says RETRO.

I think all new RPi beginners should give BBC BASIC a spin to get their creative side going.

I personally have no interest in the beginner segment. I enjoy working with the old pros that are tried of building frameworks and just want to glue together what they need and then move on to the next task on their list.

User avatar
scruss
Posts: 2259
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: ScriptBasic

Tue May 14, 2019 6:33 pm

Heater wrote:
Tue May 14, 2019 4:07 pm

With this discussion I discover that GOTO is a lot more harmful than I ever imagined. Seems that supporting GOTO in a language is totally confusing to the guys defining/building the language. With the result that various implementations of the same language end up treating GOTO differently.
Oh, just you wait … some BASIC dialects had effectively two GOTO instructions: the regular one and EXIT nnn which, well, I'll let the Digital Group* MAXI BASIC Level 1.1 manual explain:

Code: Select all

EXIT 

The EXIT statement is identical to a GOTO except that it has the 
effect of terminating any active FOR loops and reclaiming the 
associated internal stack memory. It should be used for branching out of a 
FOR loop. 

100 IF A (J) = 100 EXIT 320 
All that pales into insignificance compared to what can happen with IF on a multi-statement line, though. Some BASIC interpreters immediately skip to the next line if the test fails, others execute the rest of the line. Probably a good reason for disallowing multi-statement lines ...

--
*: nothing to do with DEC, they were an S100 system vendor from Colorado.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

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

Re: ScriptBasic

Tue May 14, 2019 7:04 pm

@ScriptBasic,
I enjoy working with the old pros that are tried of building frameworks and just want to glue together what they need and then move on to the next task on their list.
I can appreciate that.

Thing is there are so many ways to "glue together" what we need. BASH, Perl, PHP, Python, jay Javascript, Lua, Scala ...

It's a hard sell now a days.

Are sure that "ScriptBasic" does not say "Retro"?

@Scruss,

That "EXIT" does not sound so crazy. It's like "break" in a C loop. Except there is no {} scopes in BASIC so you need to specify which FOR you mean.

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

Re: ScriptBasic

Tue May 14, 2019 7:45 pm

Heater wrote:
Tue May 14, 2019 7:04 pm
That "EXIT" does not sound so crazy. It's like "break" in a C loop.
Did you notice: it's EXIT nnn; it can jump anywhere, quite unlike break. I'm pleased to say that BBC BASIC doesn't support that.

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

Re: ScriptBasic

Tue May 14, 2019 7:53 pm

It's a hard sell now a days.
I don't have to 'sell' ScriptBasic. It does that itself after people try it.

It has a bad case of the "Too good to be true" syndrome.

I would be interested how many here on the forum have already tried ScriptBasic?
Heater wrote: Are sure that "ScriptBasic" does not say "Retro"?
Absolutely. You're really not the best person to critique BASIC with the limited exposure you have had.

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

Re: ScriptBasic

Tue May 14, 2019 8:24 pm

ScriptBasic,
"Too good to be true" syndrome.
Speaking as an old pro who spends his time glueing stuff together here are some things I am tackling at the moment, for fun and/or profit, and the languages I use to tackle them:

1) Communicating with a CockroachDB database cluster - C++, Javascript, Python
2) Messaging with NATS - C, C++, Javascript, Free Pascal
3) Decoding some weird proprietary protocol - C++
4) Messaging using ASN.1 - C++
5) Logic design for FPGA - Scala, Verilog
6) Firmware for RISC V processor - C, assembler
7) Real time data visualization in the browser - Javascript.
8) Back end web server/web socket server - Javascript.
9) Misc. glue - Python

If ScriptBasic can help with any of those I'm all ears. Always need more glue.

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

Re: ScriptBasic

Tue May 14, 2019 8:36 pm

ScriptBasic,
You're really not the best person to critique BASIC with the limited exposure you have had.
Just noticed your post edit there.

I think that is a bit cheeky given that I first used BASIC in 1973. Then BASIC on the TRS 80, the CP/M machines, the Atari ST, GW BASIC on MS-DOS, Visual Basic on early Windows.

More than enough BASIC for anyone.

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

Re: ScriptBasic

Tue May 14, 2019 8:38 pm

First step is install it and try out some of the extension modules that should make your life easier. If you have any questions, you know where to find me.

You had no idea what PowerBasic was or a couple others mentioned that are popular. It didn't seem to be your language of choice. Good thing is if you like C, you'll love how easy it is to use ScriptBasic.

If your C++ centric then ScriptBasic might not be for you.
It's API is ANSI C based.
Last edited by ScriptBasic on Tue May 14, 2019 9:17 pm, edited 2 times in total.

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

Re: ScriptBasic

Tue May 14, 2019 8:50 pm

RichardRussell wrote:
Tue May 14, 2019 5:56 pm
ScriptBasic wrote:
Tue May 14, 2019 5:31 pm
Having to set how much memory the interpreter uses isn't what I would call a modern BASIC.
BBC BASIC isn't a "modern" BASIC in that sense; it would impossible to be whilst maintaining compatibility with its namesake of 38 years ago. It's not surprising that it retains some of the original features such as a small memory footprint by default (the BBC Micro could have as little as 5Kbytes free memory in some graphics modes!).
Resource limits are an essential part of any program execution environment necessary for robustness, reliability and security--modern or not.

In the case of interpreted Basic, it may also be important to enforce resource limits in the interpreter. Otherwise the operating system will kill the interpreter when the limits set by ulimit and cgroups are violated rather than the misbehaving program running inside the interpreter.

Making the default memory limit relatively small has the advantage of encouraging programmers to think about how much memory their program reasonably needs. Knowledge about how much memory a program will use can further help scheduling systems in NUMA architectures and clusters to determine on which socket or node to run the code.

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

Re: ScriptBasic

Tue May 14, 2019 8:59 pm

ScriptBasic wrote:
Tue May 14, 2019 8:38 pm
if you like C, you'll love how easy it is to use ScriptBasic.
What features does ScriptBasic have for accessing memory directly? In converting C code to BBC BASIC, which I do quite frequently because so many algorithms and examples are published in C, I often find myself converting C's & (address-of) operator directly into BBC BASIC's ^, and C's * (indirection) operator directly into BBC BASIC's ! or ?.

(Heater, look away now or your head will explode)

Code: Select all

      v = 0
      address_of_v = ^v
      !address_of_v = 123456
      PRINT v
So many BASICs provide only rudimentary PEEK and POKE, or no memory-access capability at all, making direct conversion from C impossible. I'd be lost without BBC BASIC's operators.

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

Re: ScriptBasic

Tue May 14, 2019 10:22 pm

All I can say is give SciptBasic a try. You might like it.

@JamesH,

What would you like to see ScriptBasic focus on?

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

Re: ScriptBasic

Tue May 14, 2019 11:26 pm

ejolson wrote:
Tue May 14, 2019 8:50 pm
In the case of interpreted Basic, it may also be important to enforce resource limits in the interpreter. Otherwise the operating system will kill the interpreter when the limits set by ulimit and cgroups are violated
Indeed. A potential issue with languages that dynamically allocate and free memory is that it can be hard to be certain that they won't fail after an extended period of running, for example as a result of memory becoming excessively fragmented. If the memory is allocated 'up front' and only freed on termination, as it is in BBC BASIC, there should be no possibility of such a 'long-delayed' failure.

One of the more interesting current applications of BBC BASIC is in carrying out seismic monitoring of the Colosseum in Rome, Italy. The program runs 24 hours a day on an unattended PC, so reliability is paramount. I would be uneasy about such an application using a language with 'behind the scenes' dynamic memory allocation.

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

Re: ScriptBasic

Wed May 15, 2019 12:07 am

ScriptBasic has config file parameters you can set for max memory, recursion limit and more. I guess I was surprise so much additional memory was needed for Fibonacci.

LIMIT VALUES:

The maximal number of steps allowed for a program to run ; comment it out or set to zero to have no limit maxstep 30000

The maximal number of steps allowed for a program to run ; inside a function. ; comment it out or set to zero to have no limit maxlocalstep 0

The maximal number of recursive function call deepness ; essentially this is the "stack" size maxlevel 300

The maximal memory in bytes that a basic program is allowed to use ; for its variables maxmem 1000000

Note: A valve of zero means not limit checking is done. If ScriptBasic is used without a config file, the internal defaults are used. (values shown are defaults)

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

Re: ScriptBasic

Wed May 15, 2019 3:31 am

Richard wrote: What features does ScriptBasic have for accessing memory directly?
On Windows the DLLC extension module has a dynamic FFI, access / creation of C structures. Wide / bstr and quad variable support, low level COM, virtual DLLs and more. On Linux just PEEK/POKE, varptr.

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

Re: ScriptBasic

Wed May 15, 2019 4:32 am

Heater wrote:
Tue May 14, 2019 5:08 pm
I also realize that this is why the world avoids all those many and varied incompatible languages that happen to have with "BASIC" in the name.
In the latest TIOBE index, for May 2019, the top BASICs are Visual Basic .NET at number 5 (having risen since last time) with just over 5% rating and Visual Basic at number 16 with 1.3%. Sadly BBC BASIC (the only other BASIC they list) has fallen out of the top 50, so I don't have an actual rating, but 3rd most popular BASIC (according to them) ain't bad!

Return to “Other programming languages”