Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
freeBASIC (a 32-bit QB-syntax compatible compiler) preview..
Ok, i wasn't going to say anything about this project until it was near to be released, but heck.. i just want to share something ;)

freeBASIC is a 32-bit compiler i've being working on in the last 2 months. FB's syntax is the most compatible possible with QB/PDS/VBDOS. Currently it's only for Windows, but the runtime library is portable (C code compiled with GCC) and all tools (assembler, linker, maker, etc) are from GNU, what means it will be piece-of-cake to recompile for Linux (x86 only tho).

Here are some examples (.BAS), generated code (.ASM) and executables (.EXE) that the compiler can currently parse and create: (WinRAR is needed to extract).

A CPU with MMX support is needed to run the tests because the gfx lib used to update the screen (TinyPTC) was compiled to use MMX (also for Pentium Pro, but i guess VC++6 didn't gen any opcode incompatible with Pentiums MMX, not sure). Compiler can generate code compatible with 386's too, although the runtime library is currently being compiled for 686 CPUs, for max speed on modern boxes.

The tests include some gfx stuff and a linked-list done with pointers (oh yeah, it has pointers ;).

You can see in some examples it got support for unsigned data types too (and of course floating-point), including the BYTE type. There's support for var-len (up to 2GB) and fixed-len strings, user defined types (incl. unions), dynamic arrays (that can be passed to procs as in qb: "mysub myarray()"), etc, etc..

The GFX tests are using the TinyPTC library coz.. well, there's nothing easier around to use.. of course it's not the fasted alternative, using DX would give much better results and a QB-ish full screen ;), but the compiler still needs function pointers to access DX directly (damn COM interfaces).

freeBASIC will be released when it get to compile itself.. yes, that's right, the compiler was written 100% in QB (VBDOS to be exact, code is already 16k lines long). There are many runtime lib routines to implement, such as for files, console (including PRINT), some string functions and math. In some weeks i may release the version 0.01 for testing, we will see ;)

Nice work man. You seem to have a tight system going already so far. What assembler do you use, masm?

What else is needed to compile itself? And also coding this in basic itself must be one big challenge, congrats on that.
YOU ROCK! The syntax is everything I would want a 32 bit qb to be, ie not too different looking yet more capable than QB (pointer etc).

I didn't know GNU as could do intel syntax like that. For some reason I thought it was AT&T only.

I would be happy to help with the rest of the runtime library if it might speed things up. I'm pretty comfortable with C. I wouldn't mind being given the least fun parts to do, really - anything for this compiler.

You are going to make a history you know(not for the first time :lol: ) in qb world.
Wow, v1c... the code is really nice. I can't really give any judgements on speed, it's definately a step up from old man QB. It sure as hell kicks the crap out of libertybasic, it's simple and the executables are small, too.

Have I ever said "you the man" to you before? Because I've met the current reigning "the" man, and all he did was take 13 shots of whiskey without passing out, so I think you have some edge as the new "the man".

The only complaint I have is: It definately, definately needs a better name. I'll get back to you on that.
Excellent work, man. This is good news.

But, as Jofers said... find a better name Tongue
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
Great work, can't wait to see more.

Personally I like the name.
awsomaaaaaaa :o :o :o
ammit potato!
*gasp* :o


Can't wait for it to be released Big Grin

Forum Jump:

Users browsing this thread: 1 Guest(s)