Sunday, 5 June 2011

Handlers and BBC BASIC

As I work through creating a test script for all these VFP and SIMD instructions, my mind is wandering a bit to one of the next challenges for TAG.   TAG uses what we call Handlers to develop code for an application.  The handlers respond to events thrown by TAG for all the useful things you might need in a game.   These go from starting up and closing down, to rendering, and collisions.   The events are comprehensive enough to deal with all the major things a game such as BHP requires.

Handlers are developed in assembler through a support library linked into the BASIC assembler.  They are saved as a simple binary file with two entry points at the start, similar to a RISC OS module, one for frame events, and one for IRQ events.  For us technical developers this is great, but for most people this is beyond their capabilities.

We considered writing a C interface, but ultimately for the average-Joe this isn't really much easier than writing in ARM assembler.  You also need a whole load of compilers and stuff to get started and the Acorn PRM documentation is all aimed at assembly programming.

Acorn computers were always the easiest to use and to program.   BBC BASIC was famous for it's no fuss approach to programming, and for being interpreted - making it much easier to understand what was going on.   However over the years the language has become outdated.  It lacks object orientation and Unicode, plus it can not be used outside of an "application" to create Modules or class libraries, nor can it easily be used within another application such as TAG.

Visual BASIC .NET has become the ultimate version of BASIC available today as it is a complete language.  You can do everything that you can do in C/ C++/C# with a much more friendly syntax.   My development teams of nearly 20 people created vast web applications, data-processing systems, and real-time shop floor manufacturing systems with it.  Recently a customer who is into mathematics was dabbling in some programming, and no prizes for guessing he was using VB to write some code.   I asked him about C/C++ and he said it was far to much hassle for what he wanted to do and BASIC was much simpler to use.

Sticking to the Acorn roots I'm contemplating a new version of BBC BASIC.  Simple, interpreted, and as easy to use as always, but modern and powerful in it's capabilities.  Backwards compatible with existing code, but forward thinking as it can be used to develop anything.  Pulling the best bits of VB.NET as a language and syntax it would allow a framework for creating a class library that interfaces with RISC OS, Toolbox, and all the other things required for building applications rapidly.

A debugger is essential and the interpreter could be written with one in mind.  An interpreter makes it possible to change the code in-line whilst debugging rather than having to have vastly complex compiler technology.

Perhaps it's biting off too much, I'm not sure.  All I know is that it's taken a week part time to write an assembler from scratch using BBC BASIC and I'm back in love with the language that started off computing for me in 1984 on the BBC B.  It would be great for RISC OS to maintain the Acorn tradition of being the easiest to use and program operating system bar none.


  1. > It would be great for RISC OS to maintain the Acorn tradition of being the easiest to use and program operating system bar none.

    What do you think about documentation? Perhaps a hypertext manual is something that could be worked on. While the ROOL wiki has a (WIP) version of the PRMs, BASIC possibly qualifies for separate treatment.

    I think that while an online manual would be good, a standalone (locally stored) version could be more useful. Acorn used to use a proprietary hypertext system (the name escapes me now and I don't think it was used for help anyway) or there's StrongHelp. Either of these could be more lightweight than HTML. This is really something for discussion on the ROOL forum but I thought I'd mention it here first.

  2. Stronghelp is fine for documentation in RISC OS. StrongEd and StrongHelp are two of the better apps that we have working. From a TBA standpoint it would be nice to have something that needed documenting up and running! :-)

    I started off with the Welcome guide when I was 10 - that and Acorn User magazine, plus I think it was Input Magazine (just confirmed by Google) that my Mum bought every week.

  3. Thanks for this awesome web page, i like it
    Call 0800-090-3224 for Samsung Support in the UK, Our well expert technicians are here to help for our valuable samsung customer, Samsung Printer customer Support, Samsung customer care, Samsung Help desk Number.