FAQ  •  Register  •  Login

Extending the language

<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Mon Nov 07, 2011 9:56 pm

Extending the language

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?
<<

nitrofurano

Posts: 349

Joined: Thu Sep 29, 2011 12:44 pm

Location: Porto, Portugal

Post Tue Nov 08, 2011 1:47 pm

Re: Extending the language

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
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Wed Nov 09, 2011 10:43 pm

Re: Extending the language

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?
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Wed Nov 09, 2011 11:26 pm

Re: Extending the language

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.
<<

nitrofurano

Posts: 349

Joined: Thu Sep 29, 2011 12:44 pm

Location: Porto, Portugal

Post Thu Nov 10, 2011 10:10 am

Re: Extending the language

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
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Thu Nov 10, 2011 1:10 pm

Re: Extending the language

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
<<

nitrofurano

Posts: 349

Joined: Thu Sep 29, 2011 12:44 pm

Location: Porto, Portugal

Post Mon Mar 05, 2012 5:39 pm

Re: Extending the language

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 - http://www.boriel.com/wiki/en/index.php ... mstrad_CPC
as well, i kept updating http://www.boriel.com/wiki/en/index.php ... hitectures 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! :) )

Return to Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO