Author Topic: butterball - A toy Blitz BASIC 2D compiler/interpreter!  (Read 3834 times)

0 Members and 1 Guest are viewing this topic.

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Hey guys! A couple weeks ago I was thinking about projects I was doing when I was younger, and about all the super fun stuff I was doing in Blitz BASIC ~10 years ago! Making demos and sharing them on various forums (including this one) was literally my favorite thing, and Blitz made it all possible! (not to mention the awesome community ofc!!!)

Anyways, I lost most of my files when I left a hard drive on an airplane some years ago (doh!). But I dug around a bit and found this post, which still has the source to my old 3D Overload demo. So I downloaded it and started reading; too much fun! I mean, the code is... "unique" at this point, but I'm still super proud of it and what it meant to me at the time.

Needless to say, I _had_ to get it running. Problem is, I'm on OS X most of the time these days, and didn't feel like setting up a virtual machine and trying to find a compiler. But then I had another fun idea - why don't I just make a compiler/interpreter and run the code that way? Then I get it running on native OS X, and a super fun project to build along the way!

So, fast forward a couple weeks, and I've finally started to get actual code running! I don't have 3D Overload going yet, but after some more digging on this forum and the archives of the old DBF board I found some other effects I made from around that time, so I've been testing with those simpler ones first. So far, I've been able to get my old anti-aliased vector bobs effect running (thanks Shocky for posting that way back when, otherwise I probably wouldn't've ever found it again!), as well as an old plasma.

I call the project "butterball", and you can find it all on the github repo! Unfortunately it's source-only, but if you already have/download the rust compiler (it's written in rust) then you should have no problems getting it to build.

Also, since this is just a toy and not really a serious compiler, it's currently _EXTREMELY_ slow. I find it super ironic that I wanted to move away from Blitz back in the day so badly because it wasn't fast enough, and a decade later I come along and make it even slower XD I have some ideas for how I can improve it ofc and I'll continue some work on it, but I'll still probably continue to interpret the code rather than compiling to native so I don't think the speed will ever be blazing, but I think it can at least recreate the speed this code ran on the machine I wrote it on!

Also, if you try it on some of your own code, it's very likely it won't work. The parser (at least) has been pretty specialized based on the code I'm using to test; I don't plan on being very rigorous about it beyond that :)

Anyways, just had to share this thing; figured you guys would appreciate it :) And finally, some screenshots!

http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Hello and  :hi: ferris,

Blitz 2D(or BlitzPlus) are really good back in year 2000 or so.  Looking your source code vector bob with ligh effect and run well.  Shockwave Blue Vector Bob run 16FPS on my surface 3.

Cool Screenshot :)




Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
It seems to be a nice coding exercise Thygrion... oops I mean Ferris :) and for the good memories of course!  :goodpost:
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1217
  • Karma: 230
    • View Profile
    • Homepage
Cool project ferris, very rewarding once it runs!  :clap:
Nice screens
www.kirl.nl
Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Thanks guys!

Since the original post I've putzed at it a bit more; got it to run around 5x faster than I originally had it (still with interpreting, not compiling all the way to native code). While this sounds cool, an improvement from 1FPS to 5FPS still isn't actually that motivating haha. At some point I might try to strap LLVM to it and see if I can "JIT" it that way (running in-process keeps me from having to deal with cross-platform dynamic loading issues etc), but for now I guess it'll be on hold. Or maybe I'll fill in some more of the API, just to kill the time :D

Anyways, glad you guys thought this was cool, it's been super fun for me as well :)
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won: