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

A Crittical look at ARM BASIC V.

Wed Nov 20, 2013 5:12 pm

There is an existing thread that attempts to bash BASIC. My goal is to aid in people seing the positives of the ARM BASIC V language (this is the version of ARM BASIC that comes with RISC OS, not one of the many other BBC BASICs).

ARM BASIC V has nearly all of the features of modern programming languages, the only exception being typed structures (though structures are still possible and done). And yet some feel that it is not a usable language. So I will start by asking what the percieved shortcomings are?

ARM BASIC V has been used to write many applications in RISC OS including many that use the WIMP (GUI) with all of the features of a desktop application. There are also a few examples of system modules written in ARM BASIC V. Thus I believe it safe to say that its track record is not an issue.

ARM BASIC V Has been used to write at least 4 different compilers to compile ARM BASIC V (!ABC, !Whizz. !RISCBasic, and AABASIC). Of these only !ABC produces code that works on modern systems. Further demonstrating its utility.

ARM BASIC V has a built in inline assembler, that is also supported by most of the compilers. This assembler has been kept up to date (in the interpreter) and now has full support for the ARMv6/7 instruction set including VFP/NEON.

ARM BASIC V has full support for Pointers (called inderection [actually a bit more accurate than saying pointer]).

ARM BASIC V supports CASE statements for multi element conditions (in the same way as C).

ARM BASIC V has parameterised procedures and functions.

ARM BASIC V provides a means of calling compiled code by address and passing parameters.

ARM BASIC V provides for making direct system calls.

ARM BASIC V has a large library of built in graphics, file IO, Sound, and other statements.

ARM BASIC V provides WHILE loops.

ARM BASIC V Provides typed veriables (using the postfix characters %, $).

ARM BASIC V Allows for direct indexing of strings.

ARM BASIC V suports constants formated as HEX, binary, as well as the normal decimal.


So I ask what is ARM BASIC V Lacking (other than a better compiler and typed structures)?
Last edited by DavidS on Fri Nov 22, 2013 8:48 pm, edited 1 time in total.
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: A Crittical look at BBC BASIC V.

Wed Nov 20, 2013 5:58 pm

And as I am tired of those that seem to constantly just attempt to perpetuate a needle when the haystack is important in other topics of no real interest to me when I say something attempting to be helpful, and get taken so far off topic by these that it is rediculous:

I will from now on until my mind settles on the above: Post only as directly relates to BBC BASIC V and Charm (the programming language).
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

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: A Crittical look at BBC BASIC V.

Wed Nov 20, 2013 6:51 pm

I'm sure BBC BASIC V is a very nice programming language.

I imagine any negative comments made about it would probably pertain to promoting as a language to learn programming with nowadays.

The overwhelming educational push is to use Scratch followed by Python and most people are lined up behind this initiative and looking to push and enhance them.

I think there is a gap between these 2 but I think it should be bridged by a new language, Scratchon or PScratch :), rather than BBC BASIC

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

Twinkletoes
Posts: 210
Joined: Fri May 25, 2012 9:44 pm

Re: A Crittical look at BBC BASIC V.

Wed Nov 20, 2013 8:03 pm

The problem with BBC Basic is the same as with Esperanto. For every one programmer that can code in it, no one else can... ;-)

More modern languages didn't spend 20 years by the side of the road with their thumbs out, hoping someone would notice them, so there is a huge cadre of people who know how to use them and write libraries for them. Regardless of whether a language is "good" or "bad", this is the critical mass effect. I used Delphi (object pascal) for the first 15 years of my adult life. Loved it because it could do everything C++ could do, but it was readable. Delphi's architect went off to build C# and after a few years denying the obvious, that C# was better and more popular, I jumped ship. Never regretted it. Delphi is now one of the languages by the side of the road - it still has its faithful, but they are not numerous enough to allow it to compete with more common languages which have multiple open source projects, component sets, commercial toolkits, unit test suites, profilers etc etc etc

User avatar
DougieLawson
Posts: 39551
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: A Crittical look at BBC BASIC V.

Wed Nov 20, 2013 11:36 pm

Twinkletoes wrote:The problem with BBC Basic is the same as with Esperanto. For every one programmer that can code in it, no one else can... ;-)
That's along the same lines as Edsger Dijkstra's dissertation in 1975: http://www.cs.virginia.edu/~evans/cs655 ... wd498.html
Prof. Dijkstra wrote:It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.
My exposure to BASIC in the 1980s didn't do too much harm. We spent a lot of time hand assembling Z80 machine code and inserting it into the ZX80 RAM with PEEK commands in BASIC programs and jumping through some hoops to get the machine to run it. The move from there to 6502 machine code with a sensible assembler was a relief. My Microtan 65 does have a BASIC ROM, but I need to repair my full QWERTY keyboard to use that.

The one true programming language IS S/370 (and it's later variants S/390 and zArchitecture) assembler. But I'm biased with 30 years of using that for my day job.

Python is a nice sane language and enforces some rigid syntax constraints. I even found a function to get over the missing switch/case construct. It's certainly not as sloppy as BASIC.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

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

Re: A Crittical look at BBC BASIC V.

Wed Nov 20, 2013 11:59 pm

Twinkletoes wrote:The problem with BBC Basic is the same as with Esperanto. For every one programmer that can code in it, no one else can... ;-)

More modern languages didn't spend 20 years by the side of the road with their thumbs out, hoping someone would notice them, so there is a huge cadre of people who know how to use them and write libraries for them. Regardless of whether a language is "good" or "bad", this is the critical mass effect. I used Delphi (object pascal) for the first 15 years of my adult life. Loved it because it could do everything C++ could do, but it was readable. Delphi's architect went off to build C# and after a few years denying the obvious, that C# was better and more popular, I jumped ship. Never regretted it. Delphi is now one of the languages by the side of the road - it still has its faithful, but they are not numerous enough to allow it to compete with more common languages which have multiple open source projects, component sets, commercial toolkits, unit test suites, profilers etc etc etc

Considering that the one negitive of BBC BASIC V being that it has a lot of unneeded libraries available this is an interesting statement.

BBC BASIC V shares that particular negative with C, C++, Pascal, Python, etc. There are way to many unneeded libraries and "toolkits" available to make things more complicated than they need to be.

I do not think that there is any problem with the number of people that have adopted BBC BASIC V (do not froget the V as there are a few different BBC BASICs), the problem is the perception of those that have not. It does and always has had a wide developer base working with it (probably more than 50% of RISC OS developers use BBC BASIC V for some projects).

The other consern is that BBC BASIC V is viewed as not being apropriate for some applications even if something like C is viewed as apropriate. So if there is a way to get the knowledge out that BBC BASIC V truely lives up to the portion of the acronym fo BASIC that sais All-purpose I think that there could be a greate deal more users of the language for things other than just simple front ends and the like.

Further it would be nice to see BBC BASIC V compatible interpreters and compilers on other platforms. At present the only interpreter that is compatible with BBC BASIC V is the BBC BASIC V module in RISC OS, and the only current compilers were designed to run under RISC OS and produce object code for RISC OS. If there is a way to improve the usage it would be a great thing

Thanks to the way that BBC BASIC V is structured it would be possible to create compilers thaat parallel those for C, and Charm in the performance of the compiled code, and in some cases even better as BBC BASIC V suports things like full array operations, stirng operations and more that are intrinsic to the language that could be hand optimized assembly with having to worry about the optimization methods.

I have been thinking about this a lot as one of my current projects that I am doing in Charm because Charm is the single most powerful language other that compiles to reasonable object code that I have yet used, nocking the socks off of the likes of C, C++, etc.. Though yet my project would be even better suited to BBC BASIC V if not for the lack of an up to date compiler that can produce good object code.

If i could get ahold of Darren Windsor (The author of Whizz [A BBC BASIC V compiler that produces good code]) I would ask for his permision to update Whizz to support ARM CPUs that run in 32bit addressing mode, and thus support RISC OS 5.xx.

*** WHIZZ ***
Whizz is a very good start at a BBC BASIC V Compiler written by Darren Windsor in 1999, though the only version I have ever found is 0.01 which produces 26bit ARM code, and only supports a subset of the language (kind of like Brandy BASIC only supports a subset of the older BBC BASIC), though the version number combined with the tone of the documentation say that there whas the intent to update it for better support, as well as looking at the Whizz program itself (Written in interpreted BBC BASIC V so can be read with out problem) makes it obvious that it is meant to be extended.

I do not know if he ever did add anything more to it or not, or if he is still around to ask. I do know that I have not found a correct E-Mail address from him. Though I am also attempting my own hand at a BBC BASIC V compiler to see if I can not create something that will produce reasonable code or not. (Admitedly I only have about two hours per week to spend on that with everything else).
Prof. Dijkstra wrote: It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.
Now this is a statement of ignorence. Firstly which BASIC is he speaking of? Secondly what is the reasoning for the statement other than his personal prejudgement?
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: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 12:12 am

DougieLawson wrote: My exposure to BASIC in the 1980s didn't do too much harm. We spent a lot of time hand assembling Z80 machine code and inserting it into the ZX80 RAM with PEEK commands in BASIC programs and jumping through some hoops to get the machine to run it.
Now that is a radicaly different programming language from BBC BASIC V. in BBC BASIC V we write inline assembly instead. And we use pointers to play with memory.
The move from there to 6502 machine code with a sensible assembler was a relief. My Microtan 65 does have a BASIC ROM, but I need to repair my full QWERTY keyboard to use that.
I used to love 6502 machine language, until I learned ARM (much much much simpler).
The one true programming language IS S/370 (and it's later variants S/390 and zArchitecture) assembler. But I'm biased with 30 years of using that for my day job.
I am sorry.
Python is a nice sane language and enforces some rigid syntax constraints. I even found a function to get over the missing switch/case construct. It's certainly not as sloppy as BASIC.
there is no missing CASE construct in BBC BASIC V. Remember that each BASIC is its own language. Did you read the heading post?

here is a very crude example in BBC BASIC V using only 32Bit integers for the variables:

Code: Select all

INPUT "Enter X: " x% :            REM Get a number from the user.
CASE x% OF                         : REM  Case on X.
  WHEN 1: REM Do something.
  WHEN 2, 3, 4, 5: PROCDoAnotherThing(x%)
  OTHERWISE
     PRINT "Non known option: ";x%
ENDCASE

REM A parameterised procedure.
DEF PROCDoAnotherThing(n%) 
  PRINT "Doing something else with the value: ";x%
ENDPROC
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
DougieLawson
Posts: 39551
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 1:39 am

DavidS wrote:
The one true programming language IS S/370 (and it's later variants S/390 and zArchitecture) assembler. But I'm biased with 30 years of using that for my day job.
I am sorry.
Now don't be rude. It is the very best, the World still runs on IBM Mainframes (at least it's run long enough to pay my mortgage off). Just remember that next time you stick your card in an ATM. Try finding another processor that can do 30,000 I/O operations per second (in parallel) or can run 100,000 transactions per second.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

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

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 2:15 am

DougieLawson wrote:
DavidS wrote:
The one true programming language IS S/370 (and it's later variants S/390 and zArchitecture) assembler. But I'm biased with 30 years of using that for my day job.
I am sorry.
Now don't be rude. It is the very best, the World still runs on IBM Mainframes (at least it's run long enough to pay my mortgage off). Just remember that next time you stick your card in an ATM. Try finding another processor that can do 30,000 I/O operations per second (in parallel) or can run 100,000 transactions per second.
Nothing personal. I just am aware of the instruction set (though now it is little more than a distant memory) and it is the epedimy of CISC. I understand that there are those that like it, though each has there own preferences.
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

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

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 7:28 am

DavidS,
BBC BASIC V has nearly all of the features of modern programming
languages.
It does?

Does it have any of:

First class functions.
Nested (inner) functions.
Closures.
Lambdas.
Self invoking functions.
Complex numbers.
Objects/Classes/User defined types.
Inheritance.
Polymorphism,
Multi-dimensional arrays.
Dictionaries, lists, hashes, tuples, maps.
Operator overloading.
Modules.
Unicode support.
Threads/Processes.
Channels.
Multi-processor support.
Coroutines.
Arbitrary precision arithmetic.
Self modifying code / eval.
Dynamic type system.
Run time type information / introspection.
Events.
Raw string literals.
Templates.

All that aside BASIC V may well be a perfectly fine language that would enable me to write any of the programs that I normally do.

Problem is where do I run my creations?

At this moment I have to hand PC's running Linux and Windows, Macs, Android phones and tablets, Raspberry Pi and other ARM boards running Linux. Embedded devices based on Power PC chips, ARM and Propeller, some with operating systems, some not.

None of these machines has the possibility to run BASIC V. It is essentially useless.

Today we have hundreds, thousands, of programming languages and dialects to choose from. The ones in major use are supported on many operating systems and machine architectures. I'd be nuts to invest huge amounts of time developing code in a language that is not widely supported, used and usable on many different machines including those that don't exist yet.

I didn't get the point about "unneeded libraries" and how having lot's of libraries is a negative point against a language. Someone needed them else they would not exist. If a program does not need them and does not use them they add nothing to complexity.
Last edited by Heater on Thu Nov 21, 2013 9:41 am, edited 1 time in total.
Memory in C++ is a leaky abstraction .

MoosePi
Posts: 112
Joined: Wed Nov 06, 2013 4:42 pm

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 8:44 am

Whilst I appreciate you feel that RiscOS etal is the best thing since "sliced bread" considering your postings, do you really have to invent discussions to gain traction with RiscOS on the Pi ????

BBC Basic had its place with the children of the 70s/80s, but life moves on as we get older ! The youngsters today want pointy-clicky sadly !!

Every single Programming Language, Operating System, Software has its fors and againsts and it is down to personal choice, that is what is so wonderful about all things to do with electronics/computing, there can never be a definitive answer.

Actually I do not live to far away from CJE who has a great shop: http://www.cjemicros.co.uk
Pi Forum Search and Google yields answers to many questions

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

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 12:20 pm

Heater wrote:DavidS,
BBC BASIC V has nearly all of the features of modern programming
languages.
It does?

Does it have any of:

First class functions.
Nested (inner) functions.
Closures.
Lambdas.
Self invoking functions.
Complex numbers.
Objects/Classes/User defined types.
Inheritance.
Polymorphism,
Does C99? What about Tackle?

Those are anti-features.
Multi-dimensional arrays.
Yes.
Dictionaries, lists, hashes, tuples, maps.
Operator overloading.
Again does C99?
Modules.
Yes, duh.
Unicode support.
Threads/Processes.
Channels.
Multi-processor support.
Not the responcibility of the language for any good language. These belong to the domain of how the programer codes.
Coroutines.
Arbitrary precision arithmetic.
Thankfully not. Those are two features that are nearly imposible to optimise for.

Of course you can still use arbitrary persision arithmatic if you manualy code it (like most languages).
Self modifying code / eval.
Yes, though that is a given.
Dynamic type system.
Run time type information / introspection.
Thankfully no it does not.
Events.
As you are talking about how to code not the lang, Yes BBC BASIC V does handle events (required for WIMP (GUI) based programs).
Raw string literals.

Templates.

All that aside BASIC V may well be a perfectly fine language that would enable me to write any of the programs that I normally do.

Problem is where do I run my creations?

At this moment I have to hand PC's running Linux and Windows, Macs, Android phones and tablets, Raspberry Pi and other ARM boards running Linux. Embedded devices based on Power PC chips, ARM and Propeller, some with operating systems, some not.

None of these machines has the possibility to run BASIC V. It is essentially useless.
Well then at least for the time being BBC BASIC V is not for you. My concerns those that can use BBC BASIC V, as well as getting it ported to other platforms for future expansion of the programmer base that uses BBC BASIC V.
Today we have hundreds, thousands, of programming languages and dialects to choose from. The ones in major use are supported on many operating systems and machine architectures. I'd be nuts to invest huge amounts of time developing code in a language that is not widely supported, used and usable on many different machines including those that don't exist yet.
Depends on what you wish to do. Many use GCCs extra non standard features, and the posix extensions, and toolkit this or that. All of these things put limits on where your code will run, yet we do not have this kind of complaint about them.
I didn't get the point about "unneeded libraries" and how having lot's of libraries is a negative point against a language. Someone needed them else they would not exist. If a program does not need them and does not use them they add nothing to complexity.
[/quote]
I just answered this a paragraph ago. It limits compatability, and portability.


How is there the posibility of getting it ported if people will not look at it?
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: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 12:30 pm

MoosePi wrote:Whilst I appreciate you feel that RiscOS etal is the best thing since "sliced bread" considering your postings, do you really have to invent discussions to gain traction with RiscOS on the Pi ????
No. The topic is an implementation of a programming language that i feel could be useful on other platforms as well. Of cource an implementation for other platforms would have to have a different name even though it would be the same language.
BBC Basic had its place with the children of the 70s/80s, but life moves on as we get older ! The youngsters today want pointy-clicky sadly !!
And how do you not have this with BBC BASIC V. Again do not forget the V as there are some radical differences between verients of BBC BASIC.

Many of the WIMP (GUI) based applications on RISC OS are written in BBC BASIC.
Every single Programming Language, Operating System, Software has its fors and againsts and it is down to personal choice, that is what is so wonderful about all things to do with electronics/computing, there can never be a definitive answer.
I agree 100%. My point is that many use invalid information when deciding against BBC BASIC V. There seems to be some strong prejudgement related to the part of the name BASIC, based on completely unrelated languages with the same part of name.
Actually I do not live to far away from CJE who has a great shop: http://www.cjemicros.co.uk
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: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 12:32 pm

@Heater:

I am not sure what you mean by Raw String literals??? String litterals in BBC BASIC V are just a series of characters as with most languages.
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

ZXDunny
Posts: 119
Joined: Sun Jul 08, 2012 7:57 pm

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 1:48 pm

Maybe you should ask yourself why nobody codes in BASIC V? And if it's because nobody runs RISC OS, what can you do about it?

D.

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

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 2:13 pm

ZXDunny wrote:Maybe you should ask yourself why nobody codes in BASIC V? And if it's because nobody runs RISC OS, what can you do about it?

D.
interesting opinion.

Though BBC BASIC V is being ignored by those that are new to RISC OS also. So I guess that that blows the hypothisis that it has to do with people not using RISC OS.

And what does that to do with an interest in getting it onto other systems????
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

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

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 2:37 pm

DavidS,

In many programming languages strings "are just like this". But that means you want a double quote in the string you have to insert some escape sequence and your string "may end up like \"this\"".

This can all get very confusing if you are dealing with regular expressions or wanting to have strings of HTML, XML etc in your code.

Enter the idea raw strings. They have some very special start and end sequences and do not pay attention to escape characters with in the string.

In C++11 we can include arbitrary text in our code like so;

string s = R"(
"My string \ with any / funny "" characters goes here.
)"

There are similar raw string features in BASH, PHP, Python etc,

And this brings us to why it's almost essential to have unicode support in a modern language.
Memory in C++ is a leaky abstraction .

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

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 2:41 pm

ZXDunny wrote:Maybe you should ask yourself why nobody codes in BASIC V? And if it's because nobody runs RISC OS, what can you do about it?

D.
Also every one should use the language they prefer. I am not attempting to change that.

I am ony attempting to get people to realise that BBC BASIC V is a good modern programming language.

People seem to ignore the fact it is truely an all purpose language with strong ability. And people seem to bash it based on there experience with other unrelated BASICs or there prof telling them that BASIC is bad, so they automaticaly apply this to all BASICs not realising that BASIC represents a large group of loosely related languages.


In BBC BASIC V it is very rare to see the use of GOTO (you are probably more likely to see goto in C), and GOSUB has no use wtih the fact that we use named procedures just like C, Pascal, LOGO, and most other programmers.

And what other interpreted language do you use that has full support for making direct system calls, and inline assembly when running interpreted.

I do admit to the two major shortcomings of BBC BASIC V. There is a need for a better compiler, and there is the need for typed structures. These though represent all of the shortcomings of the language. With careful coding and the correct compiler it would be possible to implement an entire OS in BBC BASIC V, regardless of the design of the OS be it a Unixen, Something like RISC OS, some simple mini layer like CP/M, or something completely new in concept.


So I am not attempting to change anyones mind on the language that they use. I am attempting to show that BBC BASIC V is a good language and does not have the negitives that so many attempt to claim it does. As to the lack of typed structures this is one issue that there is talk about resolving, though it could be some time before that happens as there is not an agreement as to how it should be done. Personaly I feel that something like:

Code: Select all

TYPE  MyType
  x%
  y%
  z%
ENDTYPE

DIM MyType TO tmp

tmp.x% = 100   : REM Set element x%.
tmp.y% = LEN("What is a typed structure")
tmp.z% = 0
would make sence, though there is much dissagreement so we have no idea where this will end 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

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 2:53 pm

Heater wrote:And this brings us to why it's almost essential to have unicode support in a modern language.
Not to mention the fact that the length of the string in bytes, is not always equal to the length in characters. And all sorts of other complexities that are difficult to bolt onto a language afterwards. (And doing so would need messy libraries, which were complained about earlier.)

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

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 2:55 pm

Heater wrote:DavidS,

In many programming languages strings "are just like this". But that means you want a double quote in the string you have to insert some escape sequence and your string "may end up like \"this\"".

This can all get very confusing if you are dealing with regular expressions or wanting to have strings of HTML, XML etc in your code.

Enter the idea raw strings. They have some very special start and end sequences and do not pay attention to escape characters with in the string.

In C++11 we can include arbitrary text in our code like so;

string s = R"(
"My string \ with any / funny "" characters goes here.
)"

There are similar raw string features in BASH, PHP, Python etc,


Ah ok. No there is not support for that in BBC BASIC V. Though i can see how it would be convient in some cases as I have ran acrossed many situations that required the inclusion of double quotes, CR characters, etc with in a string. And I have never liked C++, just a personal preference.
And this brings us to why it's almost essential to have unicode support in a modern language.
As to unicode, again not a feature of the language, a feature of how the programmer codes.

If you mean in the standard library, or directly in string litterals that is different and these do not include unicode support in the current implementations of BBC BASIC V. Though you have me thinking a little about BBC BASIC V and usful future extensions. Once Unicode becomes comon on RISC OS it could be usefull to extend BBC BASIC V, or if BBC BASIC V does get taken up on other platforms.


Not quite sure how that would be implemented though as all possible tokens are taken. I guess that there would have a nontokenised addition to support idintifying a string as being unicode. Though the tokenisation method of BBC BASIC V is part of the reason for the super fast interpreter on RISC OS.

All byte values from 0x7F through 0xFF are used for Tokens, though I guess that one of the unused characters bolow 0x1F would work as well, though may still slow down the interpreter when encountered.

Thank you for getting my mind going, of cource the same issue is present with the idea of Typed Structures.
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: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 2:59 pm

Ravenous wrote:
Heater wrote:And this brings us to why it's almost essential to have unicode support in a modern language.
Not to mention the fact that the length of the string in bytes, is not always equal to the length in characters. And all sorts of other complexities that are difficult to bolt onto a language afterwards. (And doing so would need messy libraries, which were complained about earlier.)
Yes I have to agree. This is one of the things that people complained about with the first ANSI C, it defined hacks such as wchar and the functions to use it in the stdlib.

Though with BBC BASIC V there may be a cleaner way to add the suport if someone could figure out where to put the token for the new string type.
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

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

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 3:40 pm

DavidS,
As to unicode, again not a feature of the language, a feature of how the programmer codes.
One could say that of almost any language feature. Why have "while", "for", "repeat" or whatever for loops when you can make them out of "if" and "goto"?

As for unicode. In some programming language I might want to define a string like so:

Code: Select all

string s = "Κυαεκυε ομιθταντυρ σομπρεχενσαμ ιδ σιθ. Μωδω συσιπιαντυρ αν εως, μεα αδ φερεαρ περσιπιθ, εσθ νονυμυ εσεντ μαιεσθατις νο. Υθ σεδ διαμ θαθιων σομμυνε, εραθ ιυδισαβιτ αν φιμ, νισλ γραεσε αλικυανδο θε φις. Εξ δετρασθο επισυρει ρεσυσαβο περ."
Well, that is c++ and I can actually do that. I can even print or compare such strings successfully.

However I might want to pick out characters from that string, like s[3], that does not work because the string is utf8 encoded, each char can take more than one byte and s[3] returns me the wrong thing.

Well, one can get around this by using some unicode aware libraries. But wouldn't it be nicer if this was built into the language so I don't have to worry about it?

It works in JavaScript for example.
Memory in C++ is a leaky abstraction .

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

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 4:06 pm

Heater wrote:DavidS,
As to unicode, again not a feature of the language, a feature of how the programmer codes.
One could say that of almost any language feature. Why have "while", "for", "repeat" or whatever for loops when you can make them out of "if" and "goto"?

As for unicode. In some programming language I might want to define a string like so:

Code: Select all

string s = "Κυαεκυε ομιθταντυρ σομπρεχενσαμ ιδ σιθ. Μωδω συσιπιαντυρ αν εως, μεα αδ φερεαρ περσιπιθ, εσθ νονυμυ εσεντ μαιεσθατις νο. Υθ σεδ διαμ θαθιων σομμυνε, εραθ ιυδισαβιτ αν φιμ, νισλ γραεσε αλικυανδο θε φις. Εξ δετρασθο επισυρει ρεσυσαβο περ."
Well, that is c++ and I can actually do that. I can even print or compare such strings successfully.

However I might want to pick out characters from that string, like s[3], that does not work because the string is utf8 encoded, each char can take more than one byte and s[3] returns me the wrong thing.

Well, one can get around this by using some unicode aware libraries. But wouldn't it be nicer if this was built into the language so I don't have to worry about it?

It works in JavaScript for example.
Yes it is true that extending the library (PRINT, INPUT, etc) to support Unicode text would help as with adding support for a Unicode type specifier. The first part deals with the library not the language, the second part is a small extention to the language. This I said above if you would read the entire post.

The trouble is finding a free token to specify a string as unicode. Even though it is likely that if BBC BASIC V does spread that most things would end up being compiled, there is still the fact that it is one of the fastest PURE interpreters around (PURE as in non JIT), and the way it is tokenised is a big part of that.

As you mention example in C++ remember that C++ like C can not pring anything, they require a library for that, and some weard constructs. Also you would want to define the string as a WCHAR array instead of as a string (which is a char array with some atached methods).
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

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

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 4:51 pm

The fact that C/C++ cannot print anything without a library function is good. Recently the Python guys realized this and new Python has a print function not a print language keyword.

Not sure what you mean by weird constructs. Formatting text output can be complicated, printf reflects the complexity of what it does. iostreams may be a bit cleaner.
Memory in C++ is a leaky abstraction .

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: A Crittical look at BBC BASIC V.

Thu Nov 21, 2013 5:02 pm

DavidS wrote:As you mention example in C++ remember that C++ like C can not pring anything, they require a library for that, and some weard constructs.
But this thread is not about what C++ or C is lacking, it's about what other people think BASIC V is lacking. That's what you asked for in the original post. And you're getting that, I think (I haven't studied all the answers but at least some of the replies are coming from people who have used it, I think...)

Return to “Other programming languages”