5 ms·
This is amazing! Having no knowledge of Basic, a.) what makes the rewrite "impossible"? b.) how do coding agents perform on the codebase? It might make for a ne
by pillefitz 8mo ago
This is amazing! Having no knowledge of Basic, a.) what makes the rewrite "impossible"? b.) how do coding agents perform on the codebase? It might make for a neat benchmark similar to ARC
- thomassmith65 8mo agoI gather the version of Basic is not Object-Oriented. So the program most likely is flat: a bunch of global variables (and possibly memory addresses), and instructions ordered by line number, rather than functions or methods.
- flomo 8mo agoApparently PowerBasic was the successor to Borland TurboBasic and complied to a native executable. So this wasn't an interpreted 'line number' Basic like our kiddie computers. It also probably had the Borland Windows GUI stuff. (However it wouldn't surprise me if older 'line number' programs still mostly worked. iirc VB6 also supported this.)
- benstopics 8mo agoNo line numbers but you can use numbers as goto labels. It uses Dynamic Dialog Tools which is a Win32 wrapper which most of my "job" is gutting out those calls, implementing Single Responsibility in functions and plugging in Electron UI. And trying not to break EVERYTHING...
- flomo 8mo agoThanks for clarifying. Super smart approach to adopting legacy code to a modern interface. Maybe I missed it, but are you still using the Powerbasic compiler or have you worked around that somehow?
- benstopics 8mo agoStill using PB compiler. Tried to reach out to the company that bought the right to it and killed it because I wanted to extract the parser from it and make it target LLVM to be cross platform, but after a year of trying to contact them I gave up. I will have to build my own compiler at some point with Claude Code which won't be too difficult as WSR only uses a subset of PowerBasic so. When I first tried to build a compiler two years ago I didn't understand all the gotchas in PowerBasic as I do now. But right now I'm just focused on testing the game, fixing bugs, and getting it to Early Access so many I can get up to minimum wage in sales with the time I have invested in the project!
- benstopics 8mo agoFunctions yes, and actually PowerBasic does have OOP. Michael didn't use it but it's there. No line numbers except for goto labels, but gosub is the challenge for transpilation.
- lelanthran 8mo agoThe BASIC from that time was pretty limited, IIRC. No real functions, only `gosub` and `goto` so everything is a global variable. I think even assembler for x86 is easier to unravel.
- benstopics 8mo agoPowerBasic does have functions. Go there is thousands of goto and gosub which would need to be unraveled which there isn't really a 1:1 for gosub at least in say C++. Or EXIT IF... The bane of my existence...
- benstopics 8mo agoa) At the time it was impossible for me. I think I could actually do it now. But now that I can read the BASIC... what would be the point? If I wanted it cross platform, I will build a virtual machine. b) Claude Code has performed exceptionally well. I haven't tried the most recent Codex update. But I don't see the point in spending thousands of dollars on tokens to rewrite it when it works perfectly fine. It would be much cheaper to have Claude Agent build the virtual machine. That's just my opinion. If it ain't broke don't fix it I guess. I do want to bring it to mobile though, whether that's a phone app or responsive website.
- thomassmith65 8mo agoCan the original code simulate the stock market as it operates today? The main reason I would want to convert the engine to a modern language is to make it easy enough to understand that I could add features.
- benstopics 8mo agoI think it will definitely need refactored in order to do an overhaul like that. But the best way I can answer your question. WSR does not claim to simulate real markets. It probably leans too much into fundamentals for our time, at least for the blue chip stocks in the game. What is actually is is a M&A and tax evasion simulator on top of a financial market sandbox to create tax implications to be avoided.
- thomassmith65 8mo agoI see. So no 'meme stock' and no 'Wacky POTUS' modules!
- benstopics 8mo agoMaybe as DLC!