+Gemintronic Posted June 13, 2012 Share Posted June 13, 2012 (edited) This is a half-baked, not fully formed idea. Thought I'd talk my way through some of it and get some feedback. Basically, I want to create a programming language/meta compiler that can fit in byte sized DATA statements. Such that a "compiled" program might look like this: DATA 34, 0, 35, 255, 2, 17, .. The runtime would be in BASIC. Literally BASIC source template with the "program" stuffed in DATA statements appended to the end. I'd code the runtime in every BASIC I know exists for consoles such as DragonBASIC (GBA), BatariBASIC (2600), BasiEgaXorz (Genesis) so as long as they support DATA statements. The syntax would be brutally simple. Meaning, only TWO bytes per line: COMMAND PARAMETER. So, you could have a statement like: GOTO LABEL_START A cheat for manipulating things would be to use a command called SET to declare which variable or object to subject subsequent operations on. For instance: SET PLAYERSCORE ADD 15 The IDE would also be pretty simple given the COMMAND PARAMETER format. I could see actually having a console port that strictly used a joystick. The PC version could have drag-and-drop simplicity. The benefit would be the same code could be output to any supported BASIC compiler. The downside is the skimpy 2 byte per line restriction. Also, program features may be limited to the lowest common denominator (bB/2600) Er, also, using only numerical values between 0 and 255 may be constricting too. What say yall? Edited June 13, 2012 by theloon Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted June 13, 2012 Share Posted June 13, 2012 Have a read up about p-code interpreters and you might rethink the idea . Quote Link to comment Share on other sites More sharing options...
Rybags Posted June 14, 2012 Share Posted June 14, 2012 Have a read about Apple's "Sweet 16" routines. It's a kind of extension to 6502 which works as a sort of interpretor but is aimed at giving 16-bit extensions to stuff like integer maths. Doing it in Basic - I used to do it a little bit. For common tasks in Basic it can make them more memory efficient. For cross-platform compatability, sure, it can help. But only so far. The end result will generally be something even slower than Basic and you might be hampered more than helped if you limit capabilities based on the lowest platform you plan to support it on. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 14, 2012 Author Share Posted June 14, 2012 I knew I was reinventing the wheel. Thanks for the info guys! Er, not being sarcastic I'll study the Sweet 16 and p-code to see how to do such things. One motivation that I forgot is that a potential feature for future versions of Batari BASIC was use of the extra storage space on Harmony/Melody boards for graphics and playfields. This is actually a pretty big constraint as what I usually need most is more room for code. If Batari decides to support this feature AND reading playfield pixels I could encode instructions as playfield pixels. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted August 2, 2012 Author Share Posted August 2, 2012 I knew I wasn't a beautiful and unique snowflake. Apparently someone else had a similar idea: http://www.vintage-computer.com/vcforum/showthread.php?23141-8BASIC-I-finally-wrote-a-Basic-interpreter-to-my-Z80-AM95-8-bit-NANO-COMPUTER Apparently, limiting the amount of parsing you do is called "fixed format" Quote Link to comment Share on other sites More sharing options...
haroldoop Posted August 27, 2012 Share Posted August 27, 2012 Well, you could maybe take a look at the Mouse Programming Language: http://en.wikipedia.org/wiki/Mouse_%28programming_language%29 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.