Slashdot Mirror


Scripting In Commodore BASIC For Windows & Linux

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.

14 of 213 comments (clear)

  1. There's also Freebasic. by GrpA · · Score: 5, Informative

    I guess basic is basic unless it's on a machine you're familiar with... I find Freebasic ( www.freebasic.net ) useful, probably because I came from the same era and did all my programming back then too, although I used a Spectrum and I'd never want to have to use that sort of keyboard again.

    Freebasic is a fairly recent compiler that makes pretty neat code and has all the common C calls available to it too as well as being able to process native Qbasic programs (if you migrated from the C64 type basic to the PC later) without many of the limitations and nearly complete compatability.

    It also allows cross-scripting between Mac, PC and Linux with the same program which I find useful too.

    www.freebasic.net

    GrpA.

    ps. Basic may not be dead, but you still get funny looks when people see you programming in it. I think some consider it even more ancient and antiquated than cobol (which it's not).

    --
    Enjoy science fiction? "Turing Evolved" - AI, Mecha, Androids and rail-gun battles. What more could you want?
  2. Re:TI Basic by pilgrim23 · · Score: 3, Informative

    plugh! or was it xyzzy? :)
    there are several Apple II emulators that allow programming in Apple Basic or even Merlin Assembler (65816) for both Mac and Windows. Sweet16 is the best of OS X (a port of Bernie ][ the Rescue from BeOS; originally on Mac Classic), XGS, KEGS and many others are also out there...

    CALL -151

    --
    - Minutus cantorum, minutus balorum, minutus carborata descendum pantorum.
  3. Re:Added layers by LWATCDR · · Score: 2, Informative

    Actually I would guess that it could be the multiplatform code that takes up so much space.
    I have to hope that they don't support Poke and Peek.
    C64 basic doesn't support any of the cool features like Sprites and sound.

    --
    See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
  4. Re:The important quesiton is... by aardwolf64 · · Score: 2, Informative

    http://www.zzap64.co.uk/c64/c64emulators.html

    You're on your own for the actual game, but I promise it's out there. It's only 6k zipped.

  5. Re:TI Basic by mfh · · Score: 5, Informative

    Was that a stock 99-4A or did you have the extended memory cartridge?

    I had the 10 ton silver expansion box! 32k baby!!! It was the BEST! :) With the Speech Synthesizer to boot! Doc Watson makes me cry when I think about how much that thing cost me... right out of pocket too from my paper route!!

    This particular code made use of CALL SPRITE, but also had the most advanced calls available. Man that brings back memories...

    CALL COLOR, CALL CHAR, CALL SPRITE, CALL PATTERN, CALL MAGNIFY, CALL MOTION, CALL POSITION, CALL LOCATE, CALL DISTANCE, CALL COINC, and CALL DELSPRITE.

    The cartridge was Extended Basic, which was totally elite at the time. :P

    We were all designing color output, while the poor VIC-20 guys were still monochrome.

    I still remember the text adventure, where if you type look up, a piano falls on your head. I think it was called Asylum or something? Man that is going way back to the summer of 1983, if memory serves.

    --
    The dangers of knowledge trigger emotional distress in human beings.
  6. Re:Commodore BASIC by hpa · · Score: 5, Informative

    A few things that made Commodore BASIC slow compared to some of the BASICs of the time:

    1. A lot of parsing was done at runtime, rather than at entry time or program startup time. This meant that a lot of work got done over and over rather than once per execution, and also encouraged practices that made programs hard to read, like omitting comments and whitespace.
    2. No support for integer-only arithmetic.
    3. Very few high-level constructs. This didn't just turn programs into a mess of POKE statements, but frequently meant that a lot of them were needed -- all of which involved two floating-point to integer conversions to set a single byte.

    Most BASICs at the time would at least tokenize at entry time, and many even converted programs to P-code for execution. It was still much slower than true assembly, but it wasn't anywhere near as bad as the CBM basic. Similarly, most (but again, not all) BASICs of the time supported integer-only arithmetic at least as an option.

    I have to admit to being a bit spoiled at the time, since I first learned to program on the Swedish ABC80 computer, which had a very fast BASIC interpreter. Its follower, ABC800, even had a decent collection of high-level programming constructs in its BASIC. Too bad neither had acceptable graphics, nor a reasonable price point for home use (they ended up being sold mostly into schools and small offices.)

  7. Re:READY. by Blakey+Rat · · Score: 3, Informative

    Semi-colon, buddy, tells the C-64 to not append a newline after the string. Feh, NEWB!

    You could rewrite that as:

    10 PRINT "YAY!";
    20 GOTO 20

  8. Re:But the real question is.... by Anonymous Coward · · Score: 1, Informative

    [quote]Don't give me any BS about the wonderful SID chip and its KOOL mickey-mouse MOD files. They suck, really. [/quote]

    That's not fair. Many people like the sound of the SID chip, and there's a lot of interesting music that was written for it.
    Writing music for such a chip can also be fun, because you're driven to be creative while working under strict limitations.

    Some people like bluegrass, some people like rock, etc. Who am I to tell them that bluegrass/rock/etc "sucks"? So you can't say that SID music sucks just because you don't like it.

  9. Re:Commodore BASIC by BitterOak · · Score: 4, Informative

    No support for integer-only arithmetic.

    Actually, that isn't true. You could specify integer variables by suffixing them with a percent sign (eg. i%=1). But most people were lazy and omitted the percent sign, so their programs ended up doing a lot of floating point math unnecessarily.

    --
    If I can be modded down for being a troll, can I be modded up for being an orc, or a balrog?
  10. Re:But the real question is.... by lastchance_000 · · Score: 2, Informative

    The attraction of the home computer scene of the early 80's wasn't productivity, it was the sheer fucking joy of exploration.

  11. Re:But the real question is.... by eharvill · · Score: 2, Informative

    Yes, the Mobygames lists DOS version, but the CGA glory isn't exactly the best release.

    Grab a c64 emulator and play the full color version, as shown from the game box screen shots.

    --
    At night I drink myself to sleep and pretend I don't care that you're not here with me
  12. Re:Commodore BASIC by multipartmixed · · Score: 2, Informative

    Additionally, Commodore BASIC _did_ tokenize input at data entry time.

    That's how the "shortcut" keywords worked -- PRINT's shortcut was P-shift-R (graphical underscore-like character), and not uncoincidentally, that was also the token for the PRINT statement.

    I'm not sure the grandparent is, in fact, talking about CBM BASIC 2.0. :)

    (which, don't get me wrong, sucked -- but it's not like AppleSoft BASIC was any better. Or Timex-Sinclair BASIC. Let's see. What BASIC is he referring to that has data structures and existed on home computers in 1982?)

    --

    Do daemons dream of electric sleep()?
  13. Re:TI Basic by khellendros1984 · · Score: 4, Informative

    If you wanted a serious answer, it's most likely related to the ties to the graphics and sound libraries, storing sounds as waveforms rather than parameters to tone-generation hardware, and probably packaging overhead.....those are just guesses. I'm no iPod software expert.

    --
    It is pitch black. You are likely to be eaten by a grue.
  14. Get the source of the Brandy interpreter by Anonymous Coward · · Score: 1, Informative

    Get the source of the Brandy interpreter (= BBC BASIC V) at:

    http://www.bbcbasic.co.uk/bbcbasic.html

    This is hands down the best BASIC implementation, ever.