Join us on Discord!
You can help CodeWalrus stay online by donating here.

BuinoBasic - Basic Compiler and VM for the Gamebuino

Started by DarkestEx, May 25, 2015, 09:17:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DarkestEx

This is my latest and almost my largest project so far. A Basic compiler and VM for the Gamebuino platform.
You can find more information on GitHub (VM, Compiler), on my blog and my project page.


What is BuinoBasic?
BuinoBasic consists of two main parts, which are the BuinoBasic compiler (or short bcc) and the BuinoBasic VM (bvm). The compiler takes your Basic source code and translates it into a memory structure, that your computer can understand. These structures are then compiled into binary tokens and then saved to a file. You then put the file onto your Gamebuino's SD card. Now the VM comes into play. It's job is to execute the binary tokens and perform the operations assigned to them. So you flash the VM's compiled hex file onto the Gamebuino like any other game using the loader. Now you can select a file you want to run. After selecting your file, the VM will validate and start executing it.


What features does BuinoBasic bring?
BuinoBasic allows you to use a subset of (Q/GL)Basic for the syntax of your game's source code. Basic is one of the easiest and in this dialekt a very powerful language, supporting functions, 8-64 bit integers, strings and even arrays. It has flow control blocks, I/O, sound, graphics, file management functions. But that is not the end. Using BuiniBasic, you don't have to reflash your Gamebuino to load a new game, making it faster to play or to debug a new game. Just drop it onto the SD and start it in the VM. This will also save you flash-cycles making your Gamebuino's main MPU's memory last longer. There will even be a small compiler on the Gamebuino itself, which allows you to experiment with a limited Basic subset on the fly! But as everything, BuinoBasic also has its drawbacks. It is a some slower than plain C++ and a lot slower than optimized assembly. Also does BuinoBasic not allow you to include any kind of unmanaged code, so any hardware feature must be implemented as a function or it won't work, but you can still request a new feature to be added.


How can I help with Development?
Help is always welcome! Below you will find a list of tasks with which you can contribute:


  • If you are good at C, I'd be happy to welcome you in our VM team. Together we can make it happen a lot faster!
  • If you're good with C# you can help with the compiler and make it more awesome than ever expected. :)
  • If you are good with Basic, you could set some Demo programs up or help with the syntax.
  • If you are good at HTML and CSS, we'd love to see what new design, you make for our page.
  • If you feel like writing, and know a little Basic you could help writing the Basic documentation and provide some graphics.
  • If you are not able to help with the above, you can still beta test on an actual device or emulator.
And don't forget to spread Gamebuino and BuinoBasic to the world!
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Snektron

Awesome :D

also you copied this from your site, didn't you? :P
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


DarkestEx

  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

Ooh nice, I didn't know this was for the Gamebuino. Many people use BASIC-like languages because they tend to be so user-friendly, so this might cater to a larger audience for Gamebuino programmers. :) That is a big undertaking to start a brand new language from scratch, though, so I wish you good luck >.<.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

CKH4

I can work on HTML / CSS. What kind of site do you need? Flat theme? Quotes for code? Preferred color scheme? Will JavaScript be involved? (I'm a js invalid)

I may be able to help with the basic part of it. I'm pretty experienced in ti basic so maybe if you need sample programs I could make some. Also what will the sytax look like? Will there be necessary indentation?
  • Calculators owned: TI-83+, TI-84+


Snektron

Also what's the level of the bytecode? If it's low enough i might be able to make a z80 port :)
(is there maybe some kind of documentation on the instruction set?)
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


DarkestEx

Quote from: CKH4 on May 26, 2015, 12:08:58 AM
I can work on HTML / CSS. What kind of site do you need? Flat theme? Quotes for code? Preferred color scheme? Will JavaScript be involved? (I'm a js invalid)

I may be able to help with the basic part of it. I'm pretty experienced in ti basic so maybe if you need sample programs I could make some. Also what will the sytax look like? Will there be necessary indentation?

That sounds great [emoji1]
I could really need a nice project site with user uploads, API reference, download page, ... You know. I am going to write the PHP, but I'd be awesome if you do the design and layout. I like to have a flat l, but colorful theme. No JS involved as I dislike it. Feel free to check the samples folder to get used to the language a bit better. It is influenced by qbasic and glbasic. You can set as many whitespace as you want. Minimum between command and arguments is one though. Tabs and spaces are equivalent. Variables need to be defined with dim, variable name length is unlimited, maximum variable size needs to be specified. No dollar sign for strings allowed. Numbers are allowed after the 2nd character of a variable name. Functions are allowed. Use call functionname arg1; arg2; ... To call them.
Quote from: DJ Omnimaga on May 25, 2015, 11:52:19 PM
Ooh nice, I didn't know this was for the Gamebuino. Many people use BASIC-like languages because they tend to be so user-friendly, so this might cater to a larger audience for Gamebuino programmers. :) That is a big undertaking to start a brand new language from scratch, though, so I wish you good luck >.<.
Yeah, I exactly thought so [emoji1]
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Unicorn

Coolio! [emoji14] I like seeing a BASIC for every platform. (Maybe because that is the only thing I understand so far) :P
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

CKH4

So darkest I think I got the android navigation down using pure CSS (if it looks funny its because I'm using the preprocessor stylus). It'll hopefully work in all mobile browsers but I've only tested in chrome. I'll work on checking other browsers but it should work on all chromium based ones.

Edit. So after some testing I've determined that pretty much the only  browser that doesn't support the pointer media query is Firefox. Oh how I struggle with Firefox compatibility.

Edit2. Here's the link if you want to test it:
http://s.codepen.io/CKH4/debug/BNQEyZ
  • Calculators owned: TI-83+, TI-84+


DarkestEx

Quote from: CKH4 on May 28, 2015, 11:28:04 AM
So darkest I think I got the android navigation down using pure CSS (if it looks funny its because I'm using the preprocessor stylus). It'll hopefully work in all mobile browsers but I've only tested in chrome. I'll work on checking other browsers but it should work on all chromium based ones.
Android navigation?

Great that you are working on it, thank you! :)
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

CKH4

You can test it but the site navigation is what I meant. Hopefully its colorful enough but you can experiment with the colors.
Full screen link:
http://s.codepen.io/CKH4/debug/BNQEyZ
Editor link:
http://s.codepen.io/CKH4/pen/BNQEyZ
  • Calculators owned: TI-83+, TI-84+


Dream of Omnimaga

In desktop mode at least, the blue thing that expand is kinda slow it seems and the navigation options shows up in gray before the blue thing finished expanding. I thought it was kinda weird.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

CKH4

Oh yeah I forgot to post that I broke it and I'll have to redo all of it but no biggie because it'll take like half an hour.
  • Calculators owned: TI-83+, TI-84+


CKH4

Since I can't reach you in irc I'll try the actual topic.

I've found some time to work on the site but I'm a little annoyed because I have limited internet connection, only on my phone and I can tether to my computer too but I have to be careful about data usage. I've decided to rewrite the side menu so that hopefully it'll work on ff mobile. It's currently very broken so if I can fix it that'll be good. Also hopefully I'll be able to limit the use of media queries with the vw, vh, vmin and vmax length units.

Edit. Here's the rewrite in case you're interested.
http://s.codepen.io/CKH4/debug/aOqMXM?
  • Calculators owned: TI-83+, TI-84+


Powered by EzPortal