Custom PAWN precompiler
#1

Hi
I just thought about creating a custom precompiler for pawn that would make life a tiny bit easier for scripters. My original idea was to let the precompiler hash all strings that are marked with some sign (e.g. $"stringstring"). You would rename the default pawncc.exe to pawncc2.exe and install the custom precompiler as pawncc.exe. This would then replace all those strings with their hashed value in a temporary file and compile that file using pawncc2.exe.
This way you wouldnt need to use hash("stringstring") (for things like fast command text comparison), which would hash the string in runtime and so eats some time.
However this alone wouldnt pay out as an independent precompiler. I also thought about adding some optimization tweaks like chaning constant integers to constant floats in flaot calculations and all such small stuff.

There isnt a single line of code for this yet, I just wanted to ask if there would be anyone interested in this, or if someone has more ideas for this. So what do you think?
Reply
#2

Looks nice! Try it, in my opinion.
Reply
#3

Yep as said , try it !
Also don't forget there are some optimizations in relation to speed i don't know if samp-server.exe supports it but whatever... xD
Reply
#4

I'm working on a project similat to that. Well.. it's kinda finished, but I've got to write a documentation or something...

It's in PHP, though, and it doesn't optimize your code and stuff (it does, however, not slow anything down at all).
Reply
#5

I am a man that like to taste new things, Now I use notepad++ to script :P but if you do something nice and stylish I would use it for sure!
Reply
#6

Quote:
Originally Posted by iNorton
Посмотреть сообщение
I am a man that like to taste new things, Now I use notepad++ to script :P but if you do something nice and stylish I would use it for sure!
This has nothing to do with Notepad++, it's the pawncc.exe, the compiler :3
Reply
#7

Hehe, I already expected that Id not be the only one with such an idea. I did not really thought about what language Id use, either C or Java wrapped to an exe I think, just because Im a newb at c++
So you are creating some kind of online converter? Sounds nice, maybe Ill wait for you to release this before I decide wether Ill create this
Reply
#8

It's not an online converter, the script runs locally from a batch file or a bash script. Anyway, I'll see if I can get time to release it this weekend.
Reply
#9

Yeah , That would be Really Nice - I Am with this Idea


(Gosh i am Dreaming for a Pawno that Fixes the Errors)
Reply
#10

Quote:
Originally Posted by Breto
Посмотреть сообщение
(Gosh i am Dreaming for a Pawno that Fixes the Errors)
Or you just learn to fix them yourself which makes better code than a compiler would do if it had to guess what you're wanting to do.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)