SA-MP Forums Archive
Custom PAWN precompiler - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Custom PAWN precompiler (/showthread.php?tid=296279)



Custom PAWN precompiler - Mauzen - 10.11.2011

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?


Re: Custom PAWN precompiler - FireCat - 10.11.2011

Looks nice! Try it, in my opinion.


Re: Custom PAWN precompiler - SlashPT - 10.11.2011

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


Re: Custom PAWN precompiler - Slice - 10.11.2011

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).


Re: Custom PAWN precompiler - iNorton - 10.11.2011

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!


Re: Custom PAWN precompiler - SlashPT - 10.11.2011

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


Re: Custom PAWN precompiler - Mauzen - 10.11.2011

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


Re: Custom PAWN precompiler - Slice - 10.11.2011

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.


Re: Custom PAWN precompiler - -CaRRoT - 10.11.2011

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


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


Re: Custom PAWN precompiler - Hiddos - 10.11.2011

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.