4 ms·
BASIC isn't that ancient and should be familiar to anyone who has experience with C. Scanning the code here I don't think there's a lot of insight to be gleane
by tdicola 13y ago
BASIC isn't that ancient and should be familiar to anyone who has experience with C. Scanning the code here I don't think there's a lot of insight to be gleaned by studying it in depth. There really aren't any comments and program flow jumps around with GOTO frequently (there are no functions to call) so it's hard to tell what's going on without studying each line. Variable names are very short (1 to 2 characters) and don't tell you a lot about what's going on. If you really want to understand what the code is doing, you're probably going to need to spend a few hours going through it line by line and annotating in the margins where each 'function' is and what each variable means. Once you've done that it's probably best to just rewrite it in C using functions, etc.
- CamperBob2 13y agoI'd be tempted to just write a quick and dirty interpreter for the BASIC dialect in question. I could almost certainly do that more quickly than I could port that code to C.
- aaronem 13y agoI'm really hoping there's at least one submission which consists of a BBC BASIC interpreter written in C and compiled via asm.js into Javascript, thus satisfying the contest's requirements regarding platforms, and which executes the original BASIC code. (What I'd really like to see is a PDP-11 emulator written in C and compiled via asm.js, &c., &c., but I doubt anyone seriously pursuing the contest will be quite that insane.)