Qbasicnews.com
December 12, 2017, 11:13:16 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2] 3 4 ... 27
  Print  
Author Topic: freeBASIC (a 32-bit QB-syntax compatible compiler) preview..  (Read 126181 times)
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #15 on: October 27, 2004, 04:59:49 PM »

The ideal would be to be able to download a standalone compiler.  And that would mean package free tools, like he's already done.  Relase that as a base, and also have an IDE project to go along with it.  I'm lazy, poor and untalented so I couldn't do it, but i'd be glad to document the runtime or something.

As for the name, hmm... you could always name it FreeBase (Free BAsic Sytax Evaluator), and have the satisfaction of knowing your compiler is a crack reference.  Or I guess you could use BASE instead of BASIC for anything really, to move away from all the other crappy "Letter/Word + BASIC" naming conventions.  QuickBase, FuBase, BarBase, etc.

If you wanted to move away from BASIC in general:
 it's really popular to name programming stuff after animals.
Lots of animals here:
http://www.oaklandzoo.org/atoz/atoz.html

If not an animal, maybe something mythical:
http://www.mythcreatures.50megs.com/

Personal fav from there is "Adaro" or "Pissed off Mermaid throwing Fish".

You could use a word generator.  Fantastic one here:
http://www.fantasist.net/wordgen.shtml

If you have a word, it shouldn't be too terribly hard to come up with an acronym for it, especially if it has a 'B'.  That's how everyone else comes upwith an acronym anyway.  That, or you could throw it on top of the convential "Basic".

But, circling back around to that:
If it's open source:  ShareBasic, PeerBasic, etc.  Or BeerBasic.  But if you made it yourself, there's always the ultimate:  VicBasic (Or VicBase! or Vic-on-a-Stick, VoaS for short!).
Logged
Plasma
Na_th_an
*****
Posts: 1770


WWW
« Reply #16 on: October 27, 2004, 05:20:49 PM »

wtf is wrong with "freeBASIC"?
Logged
Fling-master
I hold this place together
*****
Posts: 862



WWW
« Reply #17 on: October 27, 2004, 05:24:57 PM »

Call it UBC. Just like UGL but the "BC" of course stands for "Basic Compiler".

FreeBasic is fine by me at any rate. Smiley

Now... there have been a lot of promises of new QB-like 32-bit compilers over the years... finish this one! Tongue I mean that seriously... the demo's are really showing promise in my opinion.
Logged
Blitz
I hold this place together
*****
Posts: 853



WWW
« Reply #18 on: October 27, 2004, 06:01:35 PM »

As far as i've seen, it's pretty much as functional as qb. But much better.
Logged

oship me and i will give you lots of guurrls and beeea
v3cz0r
I hold this place together
*****
Posts: 924



WWW
« Reply #19 on: October 27, 2004, 06:43:39 PM »

Alright, thanks to anyone that replied, i hope you will be able to play yourselves with the real thing soon ;)

Let me try to answer some questions.. er


Quote from: "Nexinarus"
What assembler do you use, masm?


I started emitting code to MASM, but as it is only for Windows, not *really* free, and doesn't support any kind of high-level debugging definitions (nor NASM or FASM does), then i moved to GNU's binutils. GAS with intel syntax looks pretty much the same (inline ASM won't be too different than the usual), and it's the only assembler that allows high-level debugging, as it's the backend of GCC - GDB-Insight will be the debugger, it's completely visual, but a resource hog.. nothing is perfect.


Quote from: "Nexinarus"
What else is needed to compile itself? And also coding this in basic itself must be one big challenge, congrats on that.


Other than a bunch of rtlib routines not yet implemented, the compiler must support arrays on user type fields, as i used them in many modules. It needs DATA statements too, and it's not that simple to add, as it may seem to be.

Most difficult parts were implementing trees, hash tables and a DAG (not used yet) in QB w/o pointers, other than that, code is divided in 16 modules (the recursive-descent parser is sliced in 6 parts). There is a just a global struct shared between the modules, everything else is accessed using getters's and setter's.


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


Me neither ;), i started looking for an assembler when i gave up using MASM and when reading the not-that-great-but-enough-for-open-source GAS' manuals i found the .intel_syntax directive. Code looks very close to MASM, the weird parts are in the data allocation, but inline ASM won't use that so..

Quote from: "Sterling"
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.


Sure, i'll need help to implement the QB's GFX routines (SCREEN, PSET, LINE, etc), i was thinking about using SDL as it's portable.. but runtime can get really big, i remember seeing 200kb DLL's coming with apps using SDL, dunno.


Quote from: "Jofers"
... 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.


I checked the code generated by PureBASIC, blitz3d, RealBASIC, iBASIC, PowerBASIC and some others commercial alternatives, only PB can gen better code in some compound statements, but when the DAG (Direct-acyclic Graph) module start to be used, code will look great (sub-expressions eliminated, better register usage, etc). RT lib is being written very modularized, so i think EXE's sizes won't be too big, as LD will link just the used objs.


Quote from: "Blitz"
Btw, i had nothing to do with the compiler.


Nah, if it wasn't Blitz pointing me out the right ways to do a real compiler, FB would be just a toy now :). You could have scanned the few hundred of pages of the Dragon Book for me, but.. j/k ;)

The web host is being paid by him too so.. i'll put some pr0n stuff there soon to attract more ppl, you know..


Quote from: "Neo"
Maybe you can convert the FreeQB code to C++ before compiling, and compile it with a DX/OpenGL compatible C++ compiler (like VC++ 6.0)


The emit/back-end module is say 99% independent of the front-end, it could be changed to emit C code later, but that's not my plan, while asm code won't ever be so good as the one a C optimizing compiler can generate, it will good enough when comparing with any commercial BASIC compiler - and hey, you will be able to use inline ASM if want more speed ;).

Using DirectX directly is a matter of adding function pointers, and i plan to do that after the compiler compiles itself. I don't want to include any closed-source tools, maybe some "abandonawares" from M$, like the resource editor.

What is really needed (and that's the hardest part coz doing by hand can be very error prone) is converting the C headers from Win API's and from any lib like OpenGL, to FB's syntax (that's QB/VB-like).. i guess it would be easier to reuse the include files that the VB community already translated from C.. or the ones that come with PowerBASIC, but then you have the copyright crap.. an automated tool would be better.. h2bi or such.


Quote from: "Jofers"
The ideal would be to be able to download a standalone compiler. And that would mean package free tools, like he's already done.


Yeah, exactly, it will come only with free/open-source tools, all currently from GNU: the assembler (AS), linker (LD) and archiver (AR, that's only need when creating static libs). I need yet to write a front-end to the compiler (FBC), i'm atm using batch files to call FBC, AS and LD, in that order.



Now about the name, heh.. it was going to be called uniBASIC, but there's already one with that name (a commercial one used in mainframes), so i changed to freeBASIC, as it will be open-src and there's just a "freebasic" listed on google that's a defunct project from 1998 or so. I can't change the name now as everything has a "FB" internally and the web site is being done with that name in mind ;)



In next weeks i'll add all string, math and memory routines missing in the run-time library, then add arrays on user def fields and try to get the compiler to compile itself, the first release will come next.. probably before xmas ;)


Again, thanks for all the feedback.. and, hey, someone now make an text-mode QB-ish IDE ;).. anyway, compiler reports error messages compatible with M$/VC++'s format, so any IDE or text-editor will be just fine.


Byez...
Logged

barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #20 on: October 27, 2004, 08:41:26 PM »

whoah... this is SO awesome!!!  You have my full support v3cz0r!  It looks totally sweet.  Rock on!  I'll wait for the release with baited breath!  (I baited mine with cookies.)
Logged

Jumping Jahoolipers!
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #21 on: October 27, 2004, 11:52:29 PM »

... and it would really be so hard to click "search and replace" and then "replace all" in the source code?  Now you're just lazy Tongue
Logged
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #22 on: October 28, 2004, 01:20:41 AM »

Wow great job v1ctor! FreeBASIC will kick a** seems like you've got a lot of progress done in 2 months, can't wait i'll most definetly be using it, keep up the good work!
Logged

very F***ing song remains the same
To everyone who sucks-up for the fame
Out of strength you know we speak the truth
Every trend that dies is living proof

MasterMinds Software
Ravyne
New Member

Posts: 7


WWW
« Reply #23 on: October 28, 2004, 03:43:41 AM »

Really great work. Even though I've moved onto C++ mostly I'm glad to see that people are working to bring BASIC into this century. As a matter of fact I've been working on a BASIC myself lately, although I've thrown out the idea of QB compatibility and I'm targeting the .NET platform. Unlike VB I'm not aiming for Rapid Application Development, but a more general-purpose language. Think C++ but in friendly, BASIC form.

If you'd ever like to discuss language or compiler issues I'd be glad to chat.

Good luck!
Logged

avyne
NYN Interactive Entertainment
http://www.nyninteractive.com
wildcard
*.*
Administrator
__/--\__
*****
Posts: 2361



« Reply #24 on: October 28, 2004, 05:27:06 AM »

Quote from: "Jofers"
... and it would really be so hard to click "search and replace" and then "replace all" in the source code?  Now you're just lazy Tongue


C'mon whats more important? It being released or its name? I like the name and so do others, but above that we would like to actually get to use it. Now don't go asking him to waste his time replacing words  Tongue
Logged
KiZ
__/--\__
*****
Posts: 2879


WWW
« Reply #25 on: October 28, 2004, 06:10:10 AM »

Sounds awesome, man!

And heres my simple question... Will the compiled exes be faster than they are currently?
Logged
Nexinarus
Wandering Guru
***
Posts: 301



WWW
« Reply #26 on: October 28, 2004, 06:36:11 AM »

Remembering when UGL came out, i recall the name was questioned a fair bit. Infact I remember when people was questioning your name jofers, during those odd days. Also questioning my name. The names fine.

Anyways v1c im impressed with the code output for the math, very nice.
Logged
Blitz
I hold this place together
*****
Posts: 853



WWW
« Reply #27 on: October 28, 2004, 06:37:04 AM »

Of course, for starters it's uses flat mode, which gives access to more registers and 4 GB of memory directly. No segments that slows it down. Second, it has constant folding and and optimises expressions so that the same operation doesn't get performed more then once in a block. Expressions like
Code:
a = b + c
b = a - d
c = b + c
d = a - d


Will become
Code:
a = b + c
b = a - d
c = a
d = b
Logged

oship me and i will give you lots of guurrls and beeea
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #28 on: October 28, 2004, 08:29:01 AM »

Andre(v1ctor) my boy!!!

Okay, that's fractal zooming!!! And DJGPP aint that fast in zooming the mendel!!! Shocked

Fecking awesome!!!!

genius is an understatement. :*)

Hey, GNU can do Intel syntax?  So I could use intel syntax in mingw?
WOW!!!

And you decide to release this when I'm about to go on vacation?!!!  I hate you!!!! ;*)


Great job!!!
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #29 on: October 28, 2004, 09:45:26 AM »

True, Nex, but if anyone names a project after me I'll rip their head off and shove it down what's left of their throat.

The only reason I would change the name is the connotation in using it.  FreeBasic just sounds like a little homemade compiler someone made in qbasic.  And while, yeah, I guess it is, it could easier to fool the cheap bastard who comes across it with a cooler name.

But I don't really care that much, I didn't know it existed until yesterday,  after all Smiley.  In fact, I'm usually much more absent from this place, I was just getting some work done yesterday on qb45.
Logged
Pages: 1 [2] 3 4 ... 27
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!