adding a precompiler

Everything else that doesn't fall into one of the other PB categories.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

adding a precompiler

Post by blueznl »

just another crazy idea, and i don't know how feasible this is, but...

how could one implement a pre-compiler?

so, currently:

editor saves --> compiler compiles (simplified :-))

but, if there was something like...

editor saves --> precompiler replaces keywords by complete procedures / purebasic statements whatever --> compiler

then... any other basic command could be implemented by a user... it would need some sort of descripitive language to accomplish this, but i haven't seen this in any other language yet (logo, anyone? :-))

it's NOT just a procedure / function replacement, it could go way beyound that...

ofcourse, errors would have to be reported THROUGH the precompiler as well, otherwise the line numbers would be off

any takers / comments?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

I heard rumours that macros are to be implemented in PB soon.
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Re: adding a precompiler

Post by tinman »

blueznl wrote:any takers / comments?
I think the idea was mentioned a long time ago, and it seemed like a good idea back then. I considered writing one myself, but wouldn't have the time (or inclination or skills) and someone else was considering doing the same.

Things that were mentioned were:
* More usable include commands
* Macros (already planned for PB v4)
* Uncalled function stripping (does PB do this now? I know Fred was considering it)
* Enhanced compiler conditionals (CompilerIfDef, etc as discussed recently)

Don't know what happened in that area. But the lack of these things makes certain things a right pain.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: adding a precompiler

Post by GPI »

Code: Select all

* Uncalled function stripping (does PB do this now? I know Fred was considering it)
Nope. But japbe-Plugin-Cutter can do this...
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

hmmm... what the world really :-) needs is a dual window editor, where in the left window you see your own code, while real time in the right window the same code in another language is presented...

type c++ left, and purebasic shows up on the right side

type gfbabasic on the left, and purebasic shows up on the right side...

interesting project...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Well, definately. Now that Im a proud owner of PB :) :) :), Im working on a personalized VB to PB converter. Personalized, as in, for one project Im working on. That way I can write my code in VB, run it through the converter, and compile it in PB. Donno how far I can get on this..

Brings up another thing. It would be interesting creating a compiler in PB, or even a os kernal...
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

man, way too many projects that i'm working on, but it just might be interesting, a 'filthy' editor that translates on the fly commands into pure... damn, it would even turn purebasic into puregfa :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
TronDoc
Enthusiast
Enthusiast
Posts: 310
Joined: Wed Apr 30, 2003 3:50 am
Location: 3DoorsDown

Post by TronDoc »

blueznl wrote:hmmm... what the world really :-) needs is a dual window editor, where...
in the left I type the idea for my program and in the right the code is generated 8O :lol: Joe
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

don't tempt me! :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply