Pre-compiler
#1

I've been thinking about creating a pre-compiler for quite a while now.. I did create something similar here, but it's written in PHP and isn't flexible enough.

Design
I'm thinking Node.js would be great for this. In fact, I've already written libraries to run servers, compile scripts, and modify anything in an AMX file.

Are you good at JavaScript? Participate!

"Hooking" the compile process
I think the best way to deal with the preprocessor is let it do its thing, then step in.
  1. Compile with the -l flag (only preprocess)
  2. Do the pre-compilation magic
  3. Include the runtime script
  4. Compile the resulting script
  5. Open the AMX and modify debug information and the header for additional customization
Runtime
The compiler would include a plain Pawn script containing functions that would be used throughout the script.
These functions could help with memory allocation, string manipulation, managing data structures, and so on.

Plugins
This is where I think the compiler could grow in strength. Support loading JavaScript plugins that does, well, whatever you want to your code. Anyone can make them, and anyone can use them.

Ideas
  • OO!
  • Pointers!
  • Improved enums (fix issues, store info on keys). This would allow easily saving/loading data in enums without having to modify code every time the enum is changed.
  • Improved runtime introspection (allow people like Y_Less and I to make more cool stuff).
Edit: I've created an initial version now.

Source code
Here's the GitHub repository:
https://github.com/oscar-broman/Prawn
Reply


Messages In This Thread
Pre-compiler - by Slice - 26.02.2013, 11:32
Re: Pre-compiler - by mastermax7777 - 27.02.2013, 06:13
Re: Pre-compiler - by Slice - 27.02.2013, 06:38
Re: Pre-compiler - by zgintasz - 27.02.2013, 07:02
Re: Pre-compiler - by Sinner - 27.02.2013, 07:35
Re: Pre-compiler - by Slice - 27.02.2013, 07:43
Re: Pre-compiler - by Slice - 27.02.2013, 10:28
Re: Pre-compiler - by steki. - 27.02.2013, 10:43
Re: Pre-compiler - by Y_Less - 27.02.2013, 10:51
Re: Pre-compiler - by Misiur - 27.02.2013, 11:19
Re: Pre-compiler - by Gamer_Z - 27.02.2013, 11:55
Re: Pre-compiler - by RajatPawar - 27.02.2013, 12:06
Respuesta: Pre-compiler - by kirk - 27.02.2013, 12:20
Re: Pre-compiler - by Y_Less - 27.02.2013, 12:37
Re: Pre-compiler - by RajatPawar - 27.02.2013, 14:46
Re: Pre-compiler - by Y_Less - 27.02.2013, 15:10
Re: Pre-compiler - by Dan.. - 27.02.2013, 17:38
Re: Pre-compiler - by Slice - 27.02.2013, 18:25
Re: Pre-compiler - by Y_Less - 27.02.2013, 21:39
Re: Pre-compiler - by Dan.. - 28.02.2013, 08:47
Re: Pre-compiler - by steki. - 28.02.2013, 09:56
Re: Pre-compiler - by RajatPawar - 28.02.2013, 09:58
Re: Pre-compiler - by Y_Less - 28.02.2013, 10:06
Re: Pre-compiler - by RajatPawar - 28.02.2013, 10:19
Re: Pre-compiler - by Y_Less - 28.02.2013, 10:21
Re: Pre-compiler - by RajatPawar - 28.02.2013, 10:32
Re: Pre-compiler - by Y_Less - 28.02.2013, 10:36
Re: Pre-compiler - by RajatPawar - 28.02.2013, 10:40
Re: Pre-compiler - by Slice - 05.03.2013, 13:16
Re: Pre-compiler - by Y_Less - 05.03.2013, 13:22
Re: Pre-compiler - by Slice - 12.03.2013, 14:33
Re: Pre-compiler - by fiki574 - 12.03.2013, 15:17
Re: Pre-compiler - by zgintasz - 25.03.2013, 12:47
Re: Pre-compiler - by Slice - 25.03.2013, 12:59

Forum Jump:


Users browsing this thread: 1 Guest(s)