User avatar
gordon@drogon.net
Posts: 1970
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Mon Oct 03, 2016 4:36 pm

Heater wrote:DavidS,
And BBC BASIC V (ARM BASIC) is as structured as C, ARM BASIC even has pointers, which is very important.
So it's not really BASIC at all.

BASIC has line numbers. It has GOTO, GOSUB/RETURN. LET, FOR/NEXT etc. BASIC uses floating point numbers. It allowed defining actual named functions with DEF. Where a "function" is a single expression that can fit on one line.

In fact it looked like what's described in it's manual: See attachment.

Modern so called "BASIC"s with the structured programming constructs etc are not BASIC. They are reincarnations of Algol

Edit: Hmmm...the BASIC manual is too big to attach. It's here: http://www.cs.bris.ac.uk/~dave/basic.pdf
The original Dartmouth BASIC manual is a great read - for someone writing a BASIC interpreter, I guess...

But one thing that's happened to BASIC, probably more than any other computing language is that over the years is that it's evolved, changed and in some cases mutated from what might be considered "True BASIC"... There are now even 2 (almost) competing standards for BASIC too (which very few adhere to)

I'm with you on pointers (and peek/poke) though - they crept into the microcomputer BASICs to make up for limitations in the system - lack of ROM space, so some BASICs set text position with poke, read the keyboard directly with peek, more advanced micro basics (Atom/Beeb, etc.) do have a bit of an underlying operating system to help, but still have overloaded commands (plot, vdu, etc.) In these enlightened days, there's no need for them.

It's still a fascinating observation of computer language evolution though. At the time, computers were mostly loaded from card decks, or tapes - but BASIC was interactive - on a slow (very slow!) printing terminal - so it needed line numbers as screen editors hadn't been invented yet. Latterly some variants didn't need line numbers - goto a label for example.

All good stuff!

-Gordon (the punk-rock BASIC programmer)
--
Gordons projects: https://projects.drogon.net/

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 3:18 am

Heater wrote:DavidS,
And BBC BASIC V (ARM BASIC) is as structured as C, ARM BASIC even has pointers, which is very important.
So it's not really BASIC at all.

BASIC has line numbers. It has GOTO, GOSUB/RETURN. LET, FOR/NEXT etc. BASIC uses floating point numbers. It allowed defining actual named functions with DEF. Where a "function" is a single expression that can fit on one line.

In fact it looked like what's described in it's manual: See attachment.

Modern so called "BASIC"s with the structured programming constructs etc are not BASIC. They are reincarnations of Algol

Edit: Hmmm...the BASIC manual is too big to attach. It's here: http://www.cs.bris.ac.uk/~dave/basic.pdf
It supports all the old BASIC stuff. Though no one uses the old way, it is used gor its structured programming.

It uses veriable types, by using a postfix charactor.


Simple recursive factorial program, uses only 32-bit integer veriables (not tested, though working) EDIT: Tested working.

Code: Select all


f% = 0                     :REM Allocate 32-bit integer veriable.
PRINT "Factorial program" 
PRINT "Ener integer value"

INPUT "Value:",f%      :REM Get user Input.

PRINT FNFact(f%); " Is factorial of "; f%       :REM Call FNFact and display results.
END                   :REM Exit back to system.

DEFFNFact(f%)          :REM Recursive Factorial of f%.
  LOCAL t%                 :REM Allocate t% as a local 32-bit integer veriable, automatic veriable in C.

  IF f% <= 1 THEN
    =1                            :REM If f% is unit or less return 1.
  ELSE
    =f% * FNFact(f%-1) :REM Return the calculated value.
  ENDIF
=0
Veriable names can be longer of course, though I like single char veriables in this kind of example.

EDIT: Remarks added.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 5:08 am

How did you run that factorial program. I'm not having any luck:

Applesoft BASIC

Code: Select all

PareError: Syntax error: Expected line number or separator in line 0
Quite BASIC

Code: Select all

Missing Line number in:f% = 0
PC-BASIC

Code: Select all

LOAD"FACT.BAS"                                                                  
Line buffer overflow                                                            
Ok
Rockerfer BASIC

Code: Select all

Error 26: Syntax error at line No. 1
What is that "=0" for at the end of the factorial function definition.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 5:16 am

Heater wrote:How did you run that factorial program. I'm not having any luck:

Applesoft BASIC

Code: Select all

PareError: Syntax error: Expected line number or separator in line 0
Quite BASIC

Code: Select all

Missing Line number in:f% = 0
PC-BASIC

Code: Select all

LOAD"FACT.BAS"                                                                  
Line buffer overflow                                                            
Ok
Rockerfer BASIC

Code: Select all

Error 26: Syntax error at line No. 1
What is that "=0" for at the end of the factorial function definition.
As was already stated it is in ARM BASIC, aka BBC BASIC V. You know the version of BASIC you asked about.

I would imagine that it will work with out any problem in Brandy BASIC, as Brandy BASIC is BBC BASIC V compatible.

Just load up Brandy BASIC (or another BBC BASIC V compatible) with the current working directory where you saved the factorial program, then type:

Code: Select all

 brandy
 TEXTLOAD "fact"
 RUN
Relpacing fact with what ever you named the file
Though you may have to add line numbers for BRANDY BASIC to run it, do not know.

In RISC OS what ever editor we use automaticaly handles adding line numbers, though that is not needed as a program can be ran without line numbers (kind of, without line numbers the tokenized program ends up with all lines having the line number 0, as the line number tokenization also contains the length of the line).
Last edited by DavidS on Tue Oct 04, 2016 5:20 am, edited 1 time in total.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 5:18 am

What is that "=0" for at the end of the factorial function definition.
That is just for visual reference, it does nothing and is not needed. It is a "return 0" statement that is never reached, I put it there to make more visualy clear where the end of the function is.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 5:28 am

DavidS wrote:Simple recursive factorial program, uses only 32-bit integer veriables
I can't remember if it works the same way in BASIC V as it did on the BBC Micro, but is it still more efficient to use the single-character upper-case integer variables (A%-Z%, _% etc) than to use any other integers? On the BBC they used to be stored in a fixed block of RAM and could also be accessed by physical memory address. That made them faster than dynamic variables and used no additional memory.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 6:29 am

bwBASIC:

Code: Select all

bwBASIC: load "fact.bas"
bwBASIC: run

ERROR: in bwb_exp():  Error detected in parsing expression
sdlBasic:

Code: Select all

Syntax error: Parse error: expected an expression, but got =
f% = 0                     :REM Allocate 32-bit integer veriable.
I guess I have wasted enough time on that fact program. It just does not work.

It was an interesting survey of available BASIC run times though. They are so terrible.

It's a fine demonstration of the point, from another thread, that one should use standardized languages with cross-platform and multiple vendor support, reuse working code made by others where possible and not be endlessly reinventing wheels even if they are small wheels.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 7:40 am

Heater wrote:bwBASIC:

Code: Select all

bwBASIC: load "fact.bas"
bwBASIC: run

ERROR: in bwb_exp():  Error detected in parsing expression
sdlBasic:

Code: Select all

Syntax error: Parse error: expected an expression, but got =
f% = 0                     :REM Allocate 32-bit integer veriable.
I guess I have wasted enough time on that fact program. It just does not work.

It was an interesting survey of available BASIC run times though. They are so terrible.

It's a fine demonstration of the point, from another thread, that one should use standardized languages with cross-platform and multiple vendor support, reuse working code made by others where possible and not be endlessly reinventing wheels even if they are small wheels.
I could find any number of incompatible pre-1989 C compilers to make the same case about C. I could easily show how a simple C program will not compile on 100 different pre-1989 C Compilers, and show that I wish to be as rediculous as you.

If you chose to use BBC BASIC V which is the language in question then it would have worked.

The standard being used here is BBC BASIC V. This is a widely supported standard, available on most Operating Systems on most platforms (in the form of Brandy Basic on most Systems and BBC BASIC V built into RISC OS). So there is an actual standard being used in this case, that you chose to ignore outright.

Or do you have a problem with the current veriant of the language that met the specifications of the BBC (part of the requirement for the BBC Branded computers). Ok this standard has evolved a little, as has the C standard.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

bensimmo
Posts: 1829
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 8:12 am

I hope this is helping the porting project.
(actually it has been quite nice reading the posts :))

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 8:31 am

It seems that the four programming languages that I prefer (ARM BASIC, ARM Assembly Language, Parallax Propeller Assembly Language, and SPIN) all have a couple things directly in common. They are all very usable and simple languages, they are all very good choices for most projects, using them will cause others to look down upon you, you will be an outcast among programmers for using them as your preferred, and people will endlessly attempt to talk you out of using them (despite there utility).

So it really is no need to defend the languages you know to be very well suited for the task(s) at hand.

I should not be surprised I also get ridiculed for using K&R C as I prefer the likes of:

Code: Select all

#include <stdio.h>

main(argc,argv)
char **argv;
{
  int cnt;
  if (argc > 1) { puts("This program does not take parameters"); return 1;}
  
  for (cnt = 11; cnt; --cnt)
  {
    printf("%d is the factorial of %d",fact(cnt),cnt);
  }
 return 0;
}

long fact(f)
long f;
{
  if (f > 1) return fact(f-1) * f; else return 1;
}
So I guess that some will just always be not liked for the way they program, that is the way of things. Despite the required backward compatibility that should allow the above code, some compilers will complain about the implicit definition of main as returning an int, as well as that of argc being an int, these are leagle in K&R C, so if compiled as K&R C code the compiler should not complain, though it does for many modern compilers.

To the original topic:

I think it would be good to have a port of ARM BASIC to Linux on ARM systems. ARM BASIC is a very good language, that is simple to learn, structured, complete, and very well written. ARM BASIC provides a pure interpreter that is capable of running many programs at a good portion of compiled language speeds, do to the interpreter fitting into the CPU Instruction Cache, and most programs fitting into the Data Cache, combined with the way that ARM BASIC is written, as a very very fast interpreter (though ARM specific for sure).

I would also like to be able to have that great assembler built into ARM BASIC available when I have to run Linux.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 2:00 pm

Yay, got the fact program running in Bandy BASIC!

It looks terrible. Let's just say I won't be using that.
Attachments
brandy-snap.png
brandy-snap.png (11.73 KiB) Viewed 2286 times

User avatar
gordon@drogon.net
Posts: 1970
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 3:27 pm

Heater wrote:How did you run that factorial program. I'm not having any luck:

Applesoft BASIC
Interesting mention of Applesoft - the 3rd BASIC I used (or maybe 4th). It was one of the Microsoft BASICs for 8-bit micros at the time - I think there were 8 or 9 variants for different platforms - all almost the same, but not quite - each slightly tailored to the machine in question by the sellers - e.g. Commodore PET and so on.

Also interesting to compare with the BBC B (which came a few years after the Apple II was released). Apple had 48K RAM, 12K of "language" ROM 2K of "monitor" and a few K of hardware IO - BBC Micro, 32K RAM, but 16K "language" ROM, 8K OS ROM and a big chunk of hardware IO space. That extra 4K language and bigger monitor (now called OS) ROM made a big difference to the operability. The BBC Micro had one other big advantage: It was affordable. (Or more affordable than an Apple, but not as popular as the Spectrum which was even cheaper - oh the "holy wars"/snobbery of Sinclair vs. Acorn of the day... :-)

And so BASIC essentially evolved through the 70's and 80's to fit the platform it was running on. I have a Shape PC1211 - a one-line "calculator" that runs BASIC - it has about 1500 bytes of storage...

Remember: Every macro you write in a spreadsheet is in BASIC ;-)

Oh, if you want to go back to the days pre-Apple, etc. then: https://www.youtube.com/watch?v=x-5lfTqdZUY

-Gordon
--
Gordons projects: https://projects.drogon.net/

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 5:08 pm

Heater wrote:Yay, got the fact program running in Bandy BASIC!

It looks terrible. Let's just say I won't be using that.
I do not blame you. You see why I have not much used brandy BASIC :) .

Though I use real ARM BASIC all the time.

Doing it in real ARM BASIC is a lot nicer experience, you use a syntax highlighting editor, that saves the program in tokenized form, and then you can run it by double clicking on the saved program, or from the command line. Though that is on RISC OS, not other platforms (as ARM BASIC is currently confined to RISC OS).

With the real BBC BASIC V (ARM BASIC) that runs only on RISC OS so far you can write full GUI based programs, that can call any system call.

I hope the SDL port if ever done will do as well as the original about system calls, and the assembler.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 6:20 pm

DavidS,
I do not blame you. You see why I have not much used brandy BASIC
Are you then intentionally wasting our time by presenting code that does not run anywhere. And suggesting systems that might run it that you think are crap anyway?

The languages that you prefer are quite OK within their very limited scope of applicability.

I use Spin and PASM. Fully aware that any code I create with them is totally useless and of no interest to anyone outside of Parallax Propeller users. I make that exception because the Propeller is a unique and wonderful chip to use for some jobs.

You cannot say that "they are all very usable...good choices for most project." without the caveat that "as long as your projects are confined to the little world they are usable in"

I don't know about other programmers looking down on you for your languages choices. But clearly of you want to play with your friends it's better to speak the same language. If you want to play alone then do whatever.

Your K&R example works just fine when compiled with GCC. With one minor change. In fact I could get it built with no changes at all. Backward compatibility in the C world is doing very well.

Quite why one would want to be using K&R for new code is beyond me though.

I think the bottom line here might be that programming is not just a technical problem with a "correct" technical solution. It's a social thing. Programmers work together. Code is shared around. Advice is shared around. Common, standardized, languages and systems, cross-platform and all, oil the wheels of this social interaction. It's how everyone works together to build things far bigger than they could ever do alone.

I get the impression that you don't care to take part in any of that and just want to dig your own perfect but lonely furrow.

Ah well.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 8:19 pm

Heater wrote:Yay, got the fact program running in Brandy BASIC!
It looks terrible. Let's just say I won't be using that.
My one complaint about all BBC BASIC dialects: the insistence on upper-case commands looks very dated and ugly. Other BASIC dialects don't have this restriction. At least Brandy allows you to enter code in lower case. ARM BASIC still insists on being case sensitive on input.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

bensimmo
Posts: 1829
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 8:25 pm

In the UK some people want to speak Welsh even though most have no idea what they are saying, they seem quite happy and even out signs up. Enhancing the language as they need, picking bits from here and there.

English on the other hand is quite different from English of old and subtlety different from English of not so long ago, let alone all the variants of English. US America seems to have messed it up and then injected their variants back into the main language. Perhaps even taking over from the main original language.
Anyway how the French and English speakers in Canada talk to each other, I have no idea. Do they have similar disagreements like the English and French speakers with a channel between them?

If only they could all speak one universal language.

bensimmo
Posts: 1829
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 8:27 pm

scruss wrote:
Heater wrote:Yay, got the fact program running in Brandy BASIC!
It looks terrible. Let's just say I won't be using that.
My one complaint about all BBC BASIC dialects: the insistence on upper-case commands looks very dated and ugly. Other BASIC dialects don't have this restriction. At least Brandy allows you to enter code in lower case. ARM BASIC still insists on being case sensitive on input.
Is that not the fault of the BBC system and its keyboard setup, my dad's only just adjusted from all caps type ;-)

I cannot see the problem in all caps, I know the internet has a problem with it though.

User avatar
gordon@drogon.net
Posts: 1970
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 8:50 pm

bensimmo wrote:
scruss wrote:
Heater wrote:Yay, got the fact program running in Brandy BASIC!
It looks terrible. Let's just say I won't be using that.
My one complaint about all BBC BASIC dialects: the insistence on upper-case commands looks very dated and ugly. Other BASIC dialects don't have this restriction. At least Brandy allows you to enter code in lower case. ARM BASIC still insists on being case sensitive on input.
Is that not the fault of the BBC system and its keyboard setup, my dad's only just adjusted from all caps type ;-)

I cannot see the problem in all caps, I know the internet has a problem with it though.
The BBC Micro (and I think the Arc) had a reverse caps setting where typed letters were CAPITAL and shift-typed were lower case. I think you pressed shift+capslock to enable it. (can't be bothered booting my Beeb to find out, sorry). I presume the capitals keywords thing was to save a few bytes in the code on the Beeb (and Atom before it) and was just carried over to the Arc.

-Gordon
--
Gordons projects: https://projects.drogon.net/

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 8:58 pm

Heater wrote:DavidS,
I do not blame you. You see why I have not much used brandy BASIC
Are you then intentionally wasting our time by presenting code that does not run anywhere. And suggesting systems that might run it that you think are crap anyway?
Not a bit. The topic was ARM BASIC, and ARM BASIC is a very good language, as is the Brandy BASIC language (as it is based on BBC BASIC V, which ARM BASIC is the original BBC BASIC V). I do not like the Brandy BASIC enviroment, I do like the way it is done in ARM BASIC.

I only suggested Brandy BASIC as you did not want to try ARM BASIC on RISC OS, at least that is what your posts seem to say.
The languages that you prefer are quite OK within their very limited scope of applicability.

I use Spin and PASM. Fully aware that any code I create with them is totally useless and of no interest to anyone outside of Parallax Propeller users. I make that exception because the Propeller is a unique and wonderful chip to use for some jobs.
+1
And the same goes for the ARM, a fact that seems to have gotten lost in the mix (heck the two processors have a lot in common).
You cannot say that "they are all very usable...good choices for most project." without the caveat that "as long as your projects are confined to the little world they are usable in"
Um, not quite.

Ok that is true for PASM and SPIN, no question there.

Though the ARM is the most common CPU on the planet if I am not mistaken, so ARM assembly has pretty wide spread usage.

And BBC BASIC V can be run on just about any OS by using the correct interpreter, brandy BASIC on many platforms (which I do use on Linux, though only to run programs I write for RISC OS [that do not have any RISC OS Specific code]).

That is also a big reason I would like to see ARM BASIC ported to Linux ARM.
I don't know about other programmers looking down on you for your languages choices. But clearly of you want to play with your friends it's better to speak the same language. If you want to play alone then do whatever.
Yea, though there is no consensus on this, there are many other RISC OS programmers that speak the same language. And there are BBC BASIC V programmers on many other OS's that speak the same language.
Your K&R example works just fine when compiled with GCC. With one minor change. In fact I could get it built with no changes at all. Backward compatibility in the C world is doing very well.

Quite why one would want to be using K&R for new code is beyond me though.
In my eyes it is a little quicker to scan for what you are looking for when editing, nothing more than that, oh and it takes a little less typing to write often cases.
I think the bottom line here might be that programming is not just a technical problem with a "correct" technical solution. It's a social thing. Programmers work together. Code is shared around. Advice is shared around. Common, standardized, languages and systems, cross-platform and all, oil the wheels of this social interaction. It's how everyone works together to build things far bigger than they could ever do alone.

I get the impression that you don't care to take part in any of that and just want to dig your own perfect but lonely furrow.

Ah well.
Oh I love sharing code and ideas. I am far from alone, and enjoy the interactions of other programmers. The common reference is there, and more so than it seems like you think.

There are many many RISC OS users and programmers, there are even more ARM Assembly language programmers, and probably even more BBC BASIC programmers than those two combined.

For K&R C, yes thankfully GCC is one compiler that does a good job with it (even if it does warn about implicit integer declarations). Though most other modern C11+c99+C89 compliant C compilers have a bit more trouble with K&R C, an unfortunate state of affairs.

As such I usually use C99 code for stuff I share, that is written in C.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Tue Oct 04, 2016 9:22 pm

bensimmo,

Perhaps this is way off topic. But...

Wales is a country. It's people have a culture and a national pride. The English pretty much stamped out the Welsh language a long time ago. They made laws forbidding it's teaching in Welsh schools. When I was young and had friends in Wales, many decades ago, nobody spoke or knew any Welsh. I find it amazing that in my lifetime the Welsh language has grown up again. So much so that the UK Government has laws that require the government deals with Welsh speaking people in the Welsh language if they insist. That makes Welsh the only "official" language in the UK. There is no such requirement that my government deal with me in English!

The English language has changed a lot of course. As far as I can tell it has always been a mess of some kind of German, Scandinavian with Latin, Greek, French, whatever thrown in. Despite it's endless mutation my linguist friends tell me it has much the same grammatical structure as ever. Seems the grammar rules lend themselves to adoption of all kind of influences.

It's a bit like how all programming languages, say BASIC, FORTRAN, Javascript, Java, C#, etc, etc all home in on the structure put in place by Algol all those years ago. Although nothing that looks like Algol is in use today.

Steve Drain
Posts: 87
Joined: Tue Oct 30, 2012 2:08 pm
Location: Exeter UK

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Wed Oct 05, 2016 3:57 pm

DavidS wrote:Simple recursive factorial program, uses only 32-bit integer veriables
Sorry David, that is a very poor example to give. Apart from the terrible performance of BBC BASIC used for recursion, the number of factorials that can be expressed as integers is very limited. Even if you use 5-byte float variables there are only 33 that you can express. This is a case for a look-up table, which is what my Basalt language extension module does.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Wed Oct 05, 2016 4:05 pm

Steve Drain wrote:
DavidS wrote:Simple recursive factorial program, uses only 32-bit integer veriables
Sorry David, that is a very poor example to give. Apart from the terrible performance of BBC BASIC used for recursion, the number of factorials that can be expressed as integers is very limited. Even if you use 5-byte float variables there are only 33 that you can express. This is a case for a look-up table, which is what my Basalt language extension module does.
True that it is a bad example, I was only wishing to show that BBC BASIC is structured and capable of recursion.

I guess I probably should have pointed out that it is a poor example, thankyou.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Fri Oct 28, 2016 6:13 am

Heater wrote:It's a fine demonstration of the point, from another thread, that one should use standardized languages with cross-platform and multiple vendor support, reuse working code made by others where possible and not be endlessly reinventing wheels even if they are small wheels.
From a learning point of view, reinventing small wheels is called homework. Without doing homework first, research and development is very difficult.

If the code works and is written in a standard language, a student has little incentive to even read it. If the code doesn't work because it is written in the wrong sort of BASIC, a student must understand the code well enough to fix it. This is low enough hanging fruit for most beginners to reach. At the same time, quite a bit of programming can be learned in the process.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Fri Oct 28, 2016 6:45 am

I agree, from an educational perspective it's great to get a look at and experiment with everything. From operating systems to language design and compiler building to assembler.

Why stop there? What about processor design, microcode, digital logic, how to make logic gates from transistors, how to make transistors, physics, chemistry....? Everything you need to build a computer.

That is a bit different from actually wanting spend a lot of time creating something that will be around for a long time, survive generations of platform changes, is easy to share for use by others and so on.

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

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Fri Oct 28, 2016 7:02 pm

Heater wrote:I agree, from an educational perspective it's great to get a look at and experiment with everything. From operating systems to language design and compiler building to assembler.
+1
Why stop there? What about processor design, microcode, digital logic, how to make logic gates from transistors, how to make transistors, physics, chemistry....? Everything you need to build a computer.
And we do learn all of that in CS, so valid point.
That is a bit different from actually wanting spend a lot of time creating something that will be around for a long time, survive generations of platform changes, is easy to share for use by others and so on.
And what language do we know will 100% survive?

None thus far.

So assumptions. Write in the language that works for you, and enjoy it. Learn as many languages as you can, and form your own personal opinions about each.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

Return to “Other languages”

Who is online

Users browsing this forum: No registered users and 4 guests