Scripting In Commodore BASIC For Windows & Linux 213
SomeoneGotMyNick writes "Someone more nostalgic than I am, and with a lot of time on their hands, had created a scripting language based on Commodore BASIC for Mac OS X. They recently finished a version that works on Windows and Linux. You can pass the text of a BASIC program as a parameter to the program. I found it odd that it took 1.8 MB of source code to compile to an interpreter that used to fit in 8K of ROM space. If this ever becomes popular, perhaps we'll see Obfuscated CBM BASIC contests." In a simliar vein, in the comments someone points out what is essentially an open source AmigaOS Classic.
TI Basic (Score:2, Interesting)
I remember coding four pages from 99er, to make a little box go from one side of the screen to the other and change colors, while playing a midi tune. More serious business was the epic dungeon text adventures!
Now of course this would be nice to have on Linux.
Re:TI Basic (Score:3, Interesting)
Was that a stock 99-4A or did you have the extended memory cartridge?
I really do miss call sprite...
CBM Basic in itself didn't do much (Score:2, Interesting)
If you have any of those old CBM-BASIC listings from 80's computing magazines, it's full of POKE x,y statements (and sometimes the program is just a hex loader with bunch of READ...DATAs). So I'm really not so sure of the value of this experiment.
(One of the longest "commercial" CBM-BASIC programs I remember - that actually used it for lots of things - was Sid Meier's Pirates! [wikipedia.org]. (Haven't tested the newest Remake - I did like Pirates Gold!, the first remake, a lot)
1.8 MB of source for 8K of ROM (Score:5, Interesting)
Don't forget that the commodore cpu was 8 bit and current cpu's are 32 or 64 bit: Most of the commands were 8 bit and their equivalents are bigger nowadays. That explains the 8KB of ROM
And they did not need fancy memory protection stuff, they hacked straight into the hardware. No dll's, so's to use or API's to follow. Even if it is a lot assembly code, there are a lot more bytes in assembly source than in binary executables.
Context, people, context!
Re:Commodore BASIC (Score:4, Interesting)
Compared to...?
I'm actually quite curious what the differences would be that would make it a bad interpreter.
C64 was my first exposure to programming (I was 8 when I got my hot little hands on it), and not having tried anything else from that particular era of home computing I don't have a yardstick to measure that sort of thing.
So please, tell me more :-)
Re:Commodore BASIC (Score:3, Interesting)
Actually Atari Basic was arguably worse the Basic 2.0.
Atari Basic had totally none standard String handling.
C64 Basic lacked extensions for graphics and sound but other than that it wasn't terrible.
I smell a terrible contest.... (Score:2, Interesting)
Is that, some old assembly hackers ought to be able to whip up a fairly tiny basic interpreter. It should be fun in a way and still easier than in the old days of 6502. You have more registers, some basic string instructions, and outstanding support for floating point. I doubt it could be quite as small though, as, the big thing that would bloat it up would be that instructions themselves in 32 bit. For an easier and almost weekend job of it, you could do it in 64 bit assembly for Linux only. That spares you the need to do COM type of stuff and other weirdness that permeates the Windows API. In Linux, you are just doing normal C calls throughout to the OS and so you could bring up basic file services fairly quickly. A clever coder could probably make the BASIC actually be some sort of assembler with it... there's nothing genuinely fancy about it and the memory management of those guys was fairly primitive.
Re:TI Basic (Score:3, Interesting)
I remember a similar demo in the TI/994A Reference Manual. It also had a program to re-define a character to make a little jumping man in an 8x16 grid. One of my first programs was to make a running man move across the screen based on the code in the reference manual.
Re:Commodore BASIC (Score:4, Interesting)
I learned BASIC on an Apple and then moved to the C16 then to a C128 with C64 embedded. I really enjoyed BASIC on the Commodore platform. I loved POKE and PEEK. The with my Super Snapshot card I could get into a pretty good machine language decompiler. From there I could create programs in the $c000 range, store them to a floppy, and sys them. I loved monitoring the raster ($d018 or somewhere close) and changing it's color when it's at various positions to create screenshots better than what the C64 normally allowed.
I never have got as deep with the x86 platform.
The thing I've found with most emulators is that this trickery just doesn't work right. A lot of it depended on the set Mhz rate of the hardware.
I find it odd as many fanboys of the C64 as there are, why not embed one onto a USB dongle. The other end with a RS232C cord?
Something like this http://www.vesalia.de/e_c64dtv%5B5732%5D.htm?slc=us [vesalia.de] ported for us programmer types.
Re:Commodore BASIC - which variant?? (Score:3, Interesting)
Being less talented than your average /.er, Commodore *64* basic reduced me to whimpers at that tender age. I pulled out all the stops and mortgaged my childhood in chores to upgrade to the Commodore 128, and that is basically the best value in an upgrade I'll ever see. Helped by the extra passage of years, on the 128 I made maze programs, a Dodge-The-Mall-Traffic Simulator as a joke, Ethnic dialects of Eliza including the Angry New Yorker, and a few quasi-utilities that were more basic concept exercises. Then I sold it to my neighbor for $100 of munchie cash, thus learning about Exiting the Market.
Re:TI Basic (Score:3, Interesting)
Here you are (Score:1, Interesting)
Here, a reimplementation of BASIC in C.
In about 1.5 KB, and it actually works a treat!
http://www.ioccc.org/1990/dds.c
Enjoy!