Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending the language
#1
How hard would it be to make the language modular enough that it could be extended with new keywords?

E.g. if I wanted 64 column printing to work with MICROPRINT AT 18,43;INVERSE 1; "TEXT"

I could publish a module that would add this functionality?
Reply
#2
britlion Wrote:How hard would it be to make the language modular enough that it could be extended with new keywords?

E.g. if I wanted 64 column printing to work with MICROPRINT AT 18,43;INVERSE 1; "TEXT"

I could publish a module that would add this functionality?

imho, the problem of definition of 'micro' sounds too ambiguous and subjective - it can be anything
Reply
#3
nitrofurano Wrote:imho, the problem of definition of 'micro' sounds too ambiguous and subjective - it can be anything


....

I'm not sure what that has to do with the question?
Reply
#4
Hmmm. It seems my answer got lost... :?:

Currently it's almost impossible to extend the language that way, but it might be in the future. By enforcing FREEBASIC compatibility I lost VBScript compatibility (somewhat). In VB you can define subs and call them with IDENTIFIER PARAM1, PARAM2 ... (with no parenthesis).

This way you can declare a subrutine like:
Code:
SUB MICROPAINT(Param1, param2...)
...
END SUB
And later call it with

Code:
MICROPAINT Param1, Param2... : REM No parenthesis needed

But other than cosmetic syntax, it's exactly the same you have already. In fact this is a classic (static) compiler, like C, BASIC, C++, etc...
So the compiler is not ready for this. I'm not sure whether this will be really useful. The power of C/C++ IMHO resides in their library. C cannot be extended without changing the compiler... though this seems to be changing nowadays.
Reply
#5
my main concern is, by complexity, the compiler losing its core flexibility for being a fork base to other machines else zx-spectrum, like c64, msx, samcoupé, atari400/800, zx81, apple2, coco2, 8bit game consoles, stuff like Fuzebox (even these machines not being really 8bit machines, but it lacks good development tools), etc., as planned from Boriel - most of the msx coders (active in the retro scene) i told about Boriel's zxbasic-compiler got amazed about how great is it, and all coded in python, and all curious about how soon a fork of it will appear focusing other 8bit machines as well
Reply
#6
I also agree with this. In fact, 2.x branch is headed towards a multi-arch compiler (starting with z80 based micros, like MSX or Amstrad). Later architectures will be even virtual machines or nowadays PCs
Reply
#7
boriel Wrote:I also agree with this. In fact, 2.x branch is headed towards a multi-arch compiler (starting with z80 based micros, like MSX or Amstrad). Later architectures will be even virtual machines or nowadays PCs

btw, i added some links about Amstrad on the wiki i think can be helpful - <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Amstrad_CPC">http://www.boriel.com/wiki/en/index.php ... mstrad_CPC</a><!-- m -->
as well, i kept updating <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Other_architectures">http://www.boriel.com/wiki/en/index.php ... hitectures</a><!-- m --> as far as i could (added even some arcade machines there, for surprising misfit-mame users, and because i think these machines are too interesting to be forgotten! Smile )
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)