D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Return to .... BASIC ...

 

On Fri, 16 Mar 2012, Simon Waters wrote:

On 15/03/12 08:55, Gordon Henderson wrote:

(and I may yet build a simple editor in)

Whilst I'm somewhat surprised you didn't find a version of the BASIC you
needed, isn't adding an editor the first step on the path to feature creep?

I did look at other Linux Basics and there are quite a few! But it was more about a desire to write one myself - from scratch as it were.

But yes, editor, "feature creep", etc. a friend who's helping me test it wants simple sprites - probably not hard to do though - then there's sound and accessing the GPIO pins on the RPi, and serial port and better fonts, and ...

I'm pondering writing my own language at the moment, but fear I lack
your skills, and am busy trying to establish if what I want to do has
already been done better than I will ever do it already.

Think of it as a challenge! I like to set myself a challenge every year and after finding some of my old BASIC programs, my challenge this year was to get them going again... And just about everything I've done has already been done - I don't think I've done anything new - e.g. the algorithm I use for expression evaluation (shunting yard) was written the year before I was born... (and I use a sorting algoritm first described in 1959)

There's very little actually "new" these days - one of my concerns is that by not teaching it in schools it might actualy be forgotten... I've already had one of my clients asking me why his new sorting routine was going slow.. He'd re-invented the delayed replacement sort )-:

Anyway, I don't think I could write a chess playing program...

I've written interpreters for many different "languages" in the past, but they've always been rather simplistic and never featured a proper expression evaluator, and while I'm not a compiler writer, I saw this as a challenge and am quite pleased with the results (although my parser/tokeniser sill needs a bit of work) - it runs marginally faster than Brandy (BBC Basic) too and "only" about 150 times slower than native C (ackermann recursion function stress test) I also abandoned all the "traditional" BASIC memory management and let libc do it for me (via malloc/free) although I had initially hoped I could make a cut-down version run on an Arduino - even on a "mega" with 8KB of RAM, it's looking highly unlikely...

The last time I wrote a turtle graphics interpreter it was in Apple BASIC and runs really really slow. Turtle graphics are fun which is why I put them into RTB.

I might have time tomorow to do some more with it. Might even put the source up, but which free license to choose... !!! although I might just start with producing a Debian package.

Cheers,

Gordon

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq