Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I find it amazing just how hard Commodore crippled the integer type in their BASIC interpreter. Not only does it take 5(!!) bytes to store a 16 bit value, but it is often slower than the floating point version of common operations.


Commodore's software story was indeed a mess, going all the way back to the PET. The BASIC in question was essentially a development snapshot of Microsoft BASIC on the 6502. It's the same code base that would go on to become Applesoft about a year later. But where Apple was able to drag MS along via comparison to the (less featureful but FAR more elegant) Integer BASIC interpreter, Commodore just took what they got and shipped it. Then patched it as needed as they kept shipping new hardware.

You'd think this would have hurt them more than it did. But in fact the idea of an "Operating System" had limited real utility in devices this small. There just wasn't enough space to do much useful for the user, and all "real" apps and games ended up rolling their own versions of everything anyway.

The C64's primary interface to the software developer was a hardware interface. And as it happened that mostly worked just great (disk I/O excepted, of course).


Microsoft /did/ go back, once, for an updated version of BASIC-65.

https://www.pagetable.com/?p=46


Do you mean Commodore went back?


Oops, yes!


I wouldn't really put the blame for this on Commodore. The integer code for BASIC-65 is common across all the platforms that licensed it from Microsoft.

You might be interested in checking this out: https://github.com/mist64/msbasic


The standard length of 5 bytes has some advantages when it comes to looking up variables. But, I agree, integer is really more like a clamped float in Commodore BASIC. (However, integer array values are stored in just 2 bytes, each, hinting at it's really about traversal time.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: