Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Woo Hoo! Go C++ Go!
#21
Well, it depends on which languages you combine. I am pretty sure that most procedural languages could be combined in a single compiler with a XML-alike definition script (C, Pascal, QB, ...), but with OO programming things get more difficult. C++ allows non-OO programming, which would make Java's VM specification collapse. VB is strange stuff as well as Object Pascal or Delphi...

Nek's project was pretty good news, but I think he's gonna drop it.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#22
well, I didnt see Nek's project going far. I mean, I really hate to say that because who know, it might have done well, but it just wasnt structured enough. He was writing a standard library before he had the core components of the compiler done, which was the main flaw.

As for making a lanuguage definitions file, it wouldnt be hard to work around. Just make a switch somewhere.

Objects = on.
Procedural = on.

or whatever. I dont know enough. They actually have a course here at Georgia Tech on writing compilers and interpreting code. I'd like to take it, but there are a few things I'd have a problem with:

a) It's ranked the seventh hardest course in the world.
b) You have to be a code monkey (CS major) to take it.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#23
I recently passed the compilers subject at college. It is the hardest subject in the whole career, and I can aknowledge that. A compiler is such a complex program. The one we did was very simple 'cause didn't optimize and produced a portable asm-like code in C, but still it was a huge project with thousands of lines of code in several programs using different preprocessors and lots of theoric knowledge (three previous subjects, THREE!) about authomats and parsers.

It is really hard Tongue
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#24
What kind of language did you write a compiler for?
Reply
#25
It had ressemblance to Eiffel, a very cool OO language. We called it "Pseudo-Eiffel". It was, of course, a little bit ripped off version of Pseudo-Eiffel, without inheritance nor polymorphism. And it was a hell. Imagine it with inheritance and polymorphism... AW!
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#26
Quote:To all, What I meant by saying DOS is closer to Linux is that both have command prompts. Though Linux also has a GUI in which case DOS too has a GUI(Win 3.x).

Well, technically Linux doesn't have a command prompt because Linux is just a kernel. Most Linux operating system distributions however ship with bash as the default shell. Windows XP also has a command prompt and you can even boot to it without starting the GUI, you can write console apps for Windows aswell.

Quote:The one we did was very simple 'cause didn't optimize and produced a portable asm-like code in C, but still it was a huge project with thousands of lines of code in several programs using different preprocessors and lots of theoric knowledge (three previous subjects, THREE!) about authomats and parsers.

Ive done a PL/0 (similar to pascal) compiler which compiled to a theoritical assembly language and then ran on a virtual machine. For my third year paper in programming languages I did a Java recursive decent parser. Most of the work was in converting the grammar from non LL-k down to mostly LL-1 with some LL-2 sections in it. I haven't done an OO one yet, but procedural compilers are hard enough ;-).
esus saves.... Passes to Moses, shoots, he scores!
Reply
#27
Sounds cool Big Grin
I'm not into Eiffel, but I'm making my own oop language. I'll probably take compiler creation when I go to the university Smile
I had no idea it was -that- hard to create a compiler though... I was kinda hoping that I could create some kind of compiler for my language (called Yail), but it seems kinda hopeless if it's that hard Sad
Reply
#28
C'mon, don't let us discourage you! If you really want to do it, go for that. If you like it, you'll enjoy it. Writting a compiler needs tons of theory, but when you put yourself to code you can bet it is a great coding experience!

LooseCaboose: Interesting. Our compiler used a LR(1) authomata. We use FLEX and BISON for the first time, and then we use a tree to store the program, which we define using an abstract syntax definition file that produces a C library for handling the tree through a custom application written by a teacher. Then the tree is parsed to check for semantic errors using special commands mixed with C that are pre-processed using an app called PM. The resulting code, generated also using the PM preprocessor, is "assembly code" for the C Virtual Machine.

This year we studied how to parse an XML document using the same utilities, but I think that next year they are gonna begin using Java utilities to create LL authomatas.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#29
I have written a compiler for a scripting language once, which compiled a script to bytecode. It was very simple though, and the source is so messy that I can't understand it anymore Tongue
Other than that, I have created a bunch of scripting languages (even though only 3 or 4 had finished interpreters), so I hope that'll help.
I do not plan on using bison nor flex because I already saw what they have to offer, and I can easily write a parser + lextor or what you people call it hehe (damn, I lack a programming related buzzword book).
However, my expirience with x86 asm is as little as it can be (I focused too much on the z80 crap), so it might be a little too much to do for now.
I was planning on making a Yail -> c++ translator, but I'm not sure the way Yail includes modules and libraries can be done in c++ code, so...

We'll see Smile
Maybe I should make an interpreter for it as the fist step?
Reply
#30
Well, that FLEX/BISON stuff was to make the tree construction easier. LR(1) automatas are great for this.

FLEX is great for parsing, and BISON lets you organize your stuff quite easily. Once you begin studying about compilers, you'll realize that you need a grammar and some way to handle it, then BISOM/YACC and other newer utilities come to scene.

Anyhow, for scripting and simple parsers I prefer to raw-code'em. I recently wrote a script parser for Clara's new game and I did it in a few QB lines Wink and it features variables, conditional branching and some nice stuff as script chaining.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)