Post by shadow008 on Jul 8, 2010 19:12:53 GMT -5
A while back, a famous man by the name of DJLinux once said:
*) For a new IDE i prefer GTK or QT for Linux and Windows.
If you like, you can learn many things from it.
How to make an lexer
How to make an parser
How to parse complex expressions (if abs(cos(i/3+4*4))< len("hello") then ...)
How to make an preprocessor (#include, #define, ...)
How to write out assembler (move eax,123 ...)
How to link with linux and windows (*.dll's *.so, ..)
...
Joshy
So yeah. Basically start from scratch and (possibly) make this language go native.
OR
Write a b4gl to *insert language that has a compiler already written here* converter.
Which would take longer?.... Depends on what kind of problems you run in on each side.
Since B4gl is mostly C++ (or C?(never actually seen source code )) the smart choice would be to write a converter to C++(or C). Start simple and work up from there. IT COULD BE WRITTEN IN BASIC4GL!!!. Just convert in code and write to a file. Think about it, for the simple lines that require little parsing, a converter wouldnt be that bad. Such as converting:
to
wouldnt be that hard. Parsing equations such as one mentioned by DJLinux above, wouldnt actually require real parsing at all, just modification as to how the equation ends up being. Such that
would just end up being something like:
no actual parsing required!
Do you understand what im getting at?... You do? Good! Now then, for the other side of writing a translator(the one that gives people nightmares):
-THE SPRITE ENGINE!!!!... NOT C++ functions....
-The text itself - just a giant sprite sheet of letters... would have to -be written to accommodate that fact
-Plugin functions....@_@
-The OpenGL window itself would be somehow stuffed inside :`(
-The HUNDREDS of OpenGL functions....(just open"functions and constants list" and commence crying)
-Other major problems that i can think of right now....
You also understand where im getting at here too, right?
A translator could be easier.
A compiler would be better.
Im kinda brain dead right now so im gonna cut to the chase. Would anyone be willing to tell everyone else "It cant be done" and kill all hopes and dreams of B4GL ever getting the glory it deserves(...well, would u?) Or should something like this be posted on source forge and just get the dirty work done and over with?
Cmon, i wanna hear everybody's criticism.
... WE TOGETHER can replace the virtual machine with an new real compiler.
*) For a new IDE i prefer GTK or QT for Linux and Windows.
If you like, you can learn many things from it.
How to make an lexer
How to make an parser
How to parse complex expressions (if abs(cos(i/3+4*4))< len("hello") then ...)
How to make an preprocessor (#include, #define, ...)
How to write out assembler (move eax,123 ...)
How to link with linux and windows (*.dll's *.so, ..)
...
Joshy
So yeah. Basically start from scratch and (possibly) make this language go native.
OR
Write a b4gl to *insert language that has a compiler already written here* converter.
Which would take longer?.... Depends on what kind of problems you run in on each side.
Since B4gl is mostly C++ (or C?(never actually seen source code )) the smart choice would be to write a converter to C++(or C). Start simple and work up from there. IT COULD BE WRITTEN IN BASIC4GL!!!. Just convert in code and write to a file. Think about it, for the simple lines that require little parsing, a converter wouldnt be that bad. Such as converting:
glswapbuffers()
to
glSwapBuffers(param);
wouldnt be that hard. Parsing equations such as one mentioned by DJLinux above, wouldnt actually require real parsing at all, just modification as to how the equation ends up being. Such that
if j*5+(sin(m*j))+x > a*b then...
would just end up being something like:
if(j*5+(sin(m*j))+x > a*b){...
no actual parsing required!
Do you understand what im getting at?... You do? Good! Now then, for the other side of writing a translator(the one that gives people nightmares):
-THE SPRITE ENGINE!!!!... NOT C++ functions....
-The text itself - just a giant sprite sheet of letters... would have to -be written to accommodate that fact
-Plugin functions....@_@
-The OpenGL window itself would be somehow stuffed inside :`(
-The HUNDREDS of OpenGL functions....(just open"functions and constants list" and commence crying)
-Other major problems that i can think of right now....
You also understand where im getting at here too, right?
A translator could be easier.
A compiler would be better.
Im kinda brain dead right now so im gonna cut to the chase. Would anyone be willing to tell everyone else "It cant be done" and kill all hopes and dreams of B4GL ever getting the glory it deserves(...well, would u?) Or should something like this be posted on source forge and just get the dirty work done and over with?
Cmon, i wanna hear everybody's criticism.