Page 1 of 1

Purebasic Compiling Itself?

Posted: Wed May 19, 2004 11:31 pm
by johndehope3
Could you write a compiler for the Purebasic language using Purebasic? In other words, can Purebasic compile itself? If not, what feature is missing from Purebasic that would prevent such a project?

Posted: Wed May 19, 2004 11:48 pm
by fweil
Not sure to understand you well, but PureBasic is a language which has a level good enough to imagine to create something able to parse a source code and compile it by programer's directives.

By the way I guess that nobody will try to spend 4-5.000 hours to make an alternative compiler having the same level of results.

Writing some quick code that can generate FASM patterns from a PureBasic's source code would be rather easy, but don't expect to cover the whole language's features like this.

This is a myth in most people mind that a good language is one able to define itself. This is something true somewhere but do most people philosophy ? I don't think so, most people make work, cooking etc ...

Well, saying that PureBasic would be able to compile itself is not wrong, but the work to do would be huge. I suppose Fred and he's team have PureBasic tools to enhance PureBasic, but they also might have other tools to aggregate for the global work they do when delivering a build.

What is a language that compiles itself ? One able to compile a source from an executable generated with the language itself ? Or is it something else ?

In first case, just you can do what I posted on the forum some weeks before : make a program that proposes an editor gadget in which the user can type a PureBasic code, and give a button which starts pbcompiler ... it works like that.

But this is just another way to propose an editor to enter code and access to the compiler which is part of the package you get when purchasing PureBasic.

Rgrds

Posted: Thu May 20, 2004 1:27 am
by Karbon
I'd say you might be able to do that if you wanted to..

Most C compilers are written in C... *shrug*

Posted: Fri May 21, 2004 4:48 am
by techjunkie
Karbon wrote:I'd say you might be able to do that if you wanted to..

Most C compilers are written in C... *shrug*
Yeah - as some Unix / workstation hardware vendor suggest...

First compile GCC with CC (or another included C compiler), then compile GCC with GCC... :lol: