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.
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.
The dangers of knowledge trigger emotional distress in human beings.
When will somebody port Radar Rat Race to Windows or Linux?
One of our competitors trademarked the term "hypothesis". From now on, we will call them "boneheaded ideas".
10 FORA=1TO300
20 PRINT"YAY!"
30 NEXT
RUN
It turns out that this is just a disassembly of the interpreter translated into C. The file is so large because it has lots of really long computer-generated symbols.
It's a shame that this is not a reimplementation of BASIC in C.
dom
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?
I have to say, Commodore BASIC was one of the worst BASIC interpreters available in the "home computer" market. It's pretty clear the C64 was really a game console with a keyboard, so it could be (very successfully, and legitimately so) sold as a computer. If you actually wanted the C64 to do anything interesting, you had the choice of assembly, or BASIC that looked like assembly but ran like crap. As far as I can tell, the C64 BASIC didn't use any of the techniques used by other BASICs from the same era to not run like a total dog.
Don't get me wrong, the C64 was a great machine. It just wasn't a great machine for BASIC programming.
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.
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
;-)
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!
Dependency hell? =>
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.
This is my sig.
But the real question is....Why would anybody do this?? Port Commodore64 BASIC to a PC?
I used to have a Commodore64 and learned 6502 Assembler on it. When I got a PC (a 286) I felt nostalgic for the C64 and bought a cheap one. I used it about ten minutes and realized what a mistake it was. Fortunately I was able to sell it right away.
Never look back. There is is nothing that was written for Commodore 64 that isn't 1000 times better on modern PCs. Nothing. Don't give me any BS about the wonderful SID chip and its KOOL mickey-mouse MOD files. They suck, really. Don't tell me about that fantastic game that you used to play on the C64 and have never been able to recreate the excitement on a PC. It's because you were a kid discovering video-games, not the Commode64.
Are you going to tell me that you miss spending four minutes to load a 25K file from the excretable 1541 disk drive? Or spending 40 minutes to download a 25K file on a 300 baud modem from a long-distance BBS when you're paying the phone bill? Or the stupid PEEKs and POKEs. Do you miss typing in hundreds of numbers from Compute's Gazette because the program is written in super-fast 6502 1.2MHz machine code?
The only good thing about the C64 was the keyboard. And once you start talking to your 3GigaHertz PC and having your words appear on the screen as you speak, you don't miss the keyboard. Regardless of how good it is.
Commodore 64's rule!! But, really they suck. Never look back on trash.
obviously.
Hail Eris, full of mischief...
E pluribus sanguinem
I have an old book on how to build your own telescope from the 1980's that included how to hook up a C64 and use a joystick to control the telescope's movements all written in C64 Basic. I remember porting it to QBasic circa 1994/5 and using it for a telescope I had to account for planetary motion for photography. (Back before every telescope came with such features).
That would almost be fun...wow I really am a geek....*shudders* I'm going back to my cave now.
"The problem with socialism is eventually you run out of other people's money" - Thatcher.
Now my 25 year old C64 BASIC programs can run under Linux, OSX, or Windows.
If only my 1541 floppies didn't suffer from bit rot and I loaned most of my collection to friends who didn't return them and somehow lost it after they moved.
Remember, Slashdot does not have a -1 disagree moderation, and no, troll, flamebait, and overrated are not substitutes.
If you know the dir of the nerdcore rhyme, then holler!
Of course this is a useless project! Almost as useless as model airplanes and magic tricks and football and all of the other wonderfully useless things people do to amuse themselves. Don't care for it? Fine, but no need to insult it.
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.
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
I remember coding a nuissance program in 6510 assembler on my C-64 that sat in the background and when a key was pressed it had a tiny chance not to echo it to the screen or to echo it twice. After installing it on several classroom computers off the old 1541 floppy it drove some students batty, they thought they had sticky keys. This was before real viruses :)
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered. My life is my own.
SYS 64738
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.
Especially when you consider that Farbrausch were able to create a near-complete c64 emulator for Windows in under 64K a couple of years ago.
So what does that other 1.74M go to?
SIERRA TANGO FOXTROT UNIFORM