Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming Amiga OS X Operating Systems IT Technology

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.
This discussion has been archived. No new comments can be posted.

Scripting In Commodore BASIC For Windows & Linux

Comments Filter:
  • by GrpA ( 691294 ) on Tuesday November 04, 2008 @05:50PM (#25633295)

    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).

  • Re:TI Basic (Score:4, Informative)

    by pilgrim23 ( 716938 ) on Tuesday November 04, 2008 @05:51PM (#25633303)

    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

  • Re:Added layers (Score:3, Informative)

    by LWATCDR ( 28044 ) on Tuesday November 04, 2008 @05:52PM (#25633331) Homepage Journal

    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.

  • by aardwolf64 ( 160070 ) on Tuesday November 04, 2008 @05:54PM (#25633355) Homepage

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

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

  • Re:TI Basic (Score:5, Informative)

    by mfh ( 56 ) on Tuesday November 04, 2008 @05:59PM (#25633425) Homepage Journal

    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.

  • Re:Commodore BASIC (Score:5, Informative)

    by hpa ( 7948 ) on Tuesday November 04, 2008 @06:40PM (#25633971) Homepage

    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 [abc80.org] 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.)

  • Re:READY. (Score:4, Informative)

    by Blakey Rat ( 99501 ) on Tuesday November 04, 2008 @06:55PM (#25634181)

    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

  • by Anonymous Coward on Tuesday November 04, 2008 @07:08PM (#25634311)

    [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.

  • Re:Commodore BASIC (Score:5, Informative)

    by BitterOak ( 537666 ) on Tuesday November 04, 2008 @08:04PM (#25634875)

    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.

  • by lastchance_000 ( 847415 ) on Tuesday November 04, 2008 @08:05PM (#25634883)

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

  • by eharvill ( 991859 ) on Tuesday November 04, 2008 @08:17PM (#25635021)

    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.

  • Re:Commodore BASIC (Score:3, Informative)

    by multipartmixed ( 163409 ) on Tuesday November 04, 2008 @08:57PM (#25635431) Homepage

    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?)

  • Re:TI Basic (Score:5, Informative)

    by khellendros1984 ( 792761 ) on Tuesday November 04, 2008 @09:21PM (#25635625) Journal
    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.
  • by Anonymous Coward on Wednesday November 05, 2008 @06:58AM (#25638331)

    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.

Lots of folks confuse bad management with destiny. -- Frank Hubbard

Working...