basic cross-compilers like Boriel's ZX-Basic Compiler

Anything QL Software or Programming Related.
Post Reply
User avatar
nitrofurano
Chuggy Microdrive
Posts: 53
Joined: Sat Nov 16, 2013 10:48 am

basic cross-compilers like Boriel's ZX-Basic Compiler

Post by nitrofurano »

hi everyone!

Since few years ago i started to use Boriel's ZX-Basic Compiler ( http://www.boriel.com/wiki/en/index.php/ZXBasic ) for creating stuff for ZX-Spectrum, and sent some games to CSSCGC competition in these years. The fact is i found Boriel's ZX-Basic Compiler also useful for compiling for other z80 machines, creating some libraries targeting them.

My question is, since Boriel's ZX-Basic Compiler seems to me so easy and efficient to use, and flexible enough to target a wider group of machines, how possible/easy would be creating a cross-compiler like Boriel's ZX-Basic Compiler targeting QL and all other 68k machines, specially when having it based actually on Boriel's ZX-Basic Compiler?

The whole code of this cross compiler is in Python, and it converts basic to assembly, and compiles the assembly, so i imagine that replacing the z80 part of that into 68k would be enough for having something minimally usable?

Please let me know if there are people here skilled enough to help there, or if there are similar cross-compiling tools, what can be done, etc. - thanks! :)


swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: basic cross-compilers like Boriel's ZX-Basic Compiler

Post by swensont »

I've been looking at the ZX-Basic Compiler, hoping that it would work for the ZX81. Both the ZX81 and Spectrum need cross compilers, since the development environment is a bit limited. It is much easier to edit code under on OS like Linux or Windows and then cross compile. Neither the ZX81 or the Spectrum support a file system, making it not so easy to keep track of your source files.

With the QL, there really is no such limit. When I'm writing some QL code, its fairly easy to use a text editor under a QL emulator. It has full file system support, so it really is not a problem to program in it's native environment.

Given that, I don't see a need to have a cross compiler. Plus, I find SuperBASIC to be about the best version of BASIC going.

Tim Swenson


User avatar
nitrofurano
Chuggy Microdrive
Posts: 53
Joined: Sat Nov 16, 2013 10:48 am

Re: basic cross-compilers like Boriel's ZX-Basic Compiler

Post by nitrofurano »

swensont wrote:I've been looking at the ZX-Basic Compiler, hoping that it would work for the ZX81. Both the ZX81 and Spectrum need cross compilers, since the development environment is a bit limited. It is much easier to edit code under on OS like Linux or Windows and then cross compile. Neither the ZX81 or the Spectrum support a file system, making it not so easy to keep track of your source files.

With the QL, there really is no such limit. When I'm writing some QL code, its fairly easy to use a text editor under a QL emulator. It has full file system support, so it really is not a problem to program in it's native environment.

Given that, I don't see a need to have a cross compiler. Plus, I find SuperBASIC to be about the best version of BASIC going.

Tim Swenson
probably it depends on the development methods - the goal of cross-compiler (as i do on Boriel's ZX-Basic Compiler) is to have a script (or a script call from an ide), that compiles, loads the emulator with the image, and the compiled result is running in few seconds, without any need of dragging binary files into imagedisks, editing inside an emulator (like using copy/paste features and alike), etc. - when we are editing and debugging code several times per hour, doing it in seconds and automatically can save precious time and development mood.


swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: basic cross-compilers like Boriel's ZX-Basic Compiler

Post by swensont »

I thought the goal of a cross compiler was to do the compilation process on a system other than the target system and not the automation of the compilation process. I've not looked closely at the syntax of Boriel's ZX-Basic, but I'm a dyed-in-the-wool SuperBASIC fan and find it better than other forms of BASIC.

For the QL, it has a good enough environment that a cross compiler is not needed. There are a number of tools that can form an IDE for either SuperBASIC or C. MircroEmacs has sytax highlighting, and compilers or other tools can be exected from within MicroEmacs, making it like an IDE.

After years of doing work on the QL, then leaving it for a while, I'm surprise how easily my fingers can type QDOS commands.

Tim Swenson


User avatar
nitrofurano
Chuggy Microdrive
Posts: 53
Joined: Sat Nov 16, 2013 10:48 am

Re: basic cross-compilers like Boriel's ZX-Basic Compiler

Post by nitrofurano »

swensont wrote:I thought the goal of a cross compiler was to do the compilation process on a system other than the target system and not the automation of the compilation process.
as well - since the cross compilation process, in this case, is from a root platform to an emulated platform, this would speed up and simplify the whole process

I've not looked closely at the syntax of Boriel's ZX-Basic, but I'm a dyed-in-the-wool SuperBASIC fan and find it better than other forms of BASIC.

For the QL, it has a good enough environment that a cross compiler is not needed. There are a number of tools that can form an IDE for either SuperBASIC or C. MircroEmacs has sytax highlighting, and compilers or other tools can be exected from within MicroEmacs, making it like an IDE.

After years of doing work on the QL, then leaving it for a while, I'm surprise how easily my fingers can type QDOS commands.

Tim Swenson
about this, i'm curious about 2 things, at least:
1. how the sources in SuperBASIC and their compiled binaries looks like. (and ready examples that can show most of all of the features available)
2. if is there any tutorial for newbies.


Post Reply