CodeWalrus

Development => Consoles => Topic started by: DarkestEx on May 25, 2015, 09:17:24 PM

Title: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: DarkestEx on May 25, 2015, 09:17:24 PM
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 (http://github.com/muessigb/BuinoBasic), Compiler (http://github.com/muessigb/BuinoBasicCompiler)), on my blog (http://blog.muessigb.net/) and my project page (http://buinobasic.muessigb.net).


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:

And don't forget to spread Gamebuino and BuinoBasic to the world!
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: Snektron on May 25, 2015, 09:18:30 PM
Awesome :D

also you copied this from your site, didn't you? :P
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: DarkestEx on May 25, 2015, 10:44:12 PM
Quote from: Cumred_Snektron on May 25, 2015, 09:18:30 PMAwesome :D
Thanks :)

Quote from: Cumred_Snektron on May 25, 2015, 09:18:30 PMalso you copied this from your site, didn't you? :P
Write once, paste many :P
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: Dream of 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 >.<.
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: 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?
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: Snektron on May 26, 2015, 12:54:36 PM
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?)
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: DarkestEx on May 27, 2015, 04:43:11 PM
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]
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: Unicorn on May 28, 2015, 03:16:09 AM
Coolio! [emoji14] I like seeing a BASIC for every platform. (Maybe because that is the only thing I understand so far) :P
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: 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.

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
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: DarkestEx on May 28, 2015, 11:58:46 AM
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! :)
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: CKH4 on May 28, 2015, 12:02:31 PM
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
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: Dream of Omnimaga on May 28, 2015, 06:38:17 PM
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.
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: CKH4 on May 28, 2015, 06:46:53 PM
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.
Title: Re: BuinoBasic - Basic Compiler and VM for the Gamebuino
Post by: CKH4 on July 03, 2015, 04:06:09 PM
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?