[Tool/Web/Other] (Partly) reconstructed PAWN compiler
#1

Hi,

about almost a year ago I started trying to reconstruct the modifications by SAMP made to the PAWN compiler. That actually started when I thought that the compiler was quite slow and I tried to find out why, which in fact I did, at least partially (there was a bug in the staging buffer which caused the buffer to be reallocated everytime something was written to it and slowed compilation time down by around 20% (from 9 seconds down to 11-13 in a script I tested, especially had a huge impact on scripts with large global variables)).

So I started with the same version used by SAMP (3.2.3664) and started with fixing that bug and adding (constant) string concatenation (which was used by the script I tested). Later I also changed some other things like strings starting with a # or string indexing ("teststring"[2]) and some other things. However I have to admit that I'm not really familiar with compilers at all, I just tried to understand the PAWN compiler and made the changes where I thought they would be the easiest (so especially the string stuff may look like a quite bad workaround).
Also it's not yet tested that good and not everything that works in the SAMP compiler does work yet (e.g. some preprocessor definitions as they are used in YSI, which seems to be caused by the Ј characters, I didn't look into that any further yet), however many scripts I tried to compile did compile (as long as they don't use YSI).

So this is just a beginning/work-in-progress, that I started and released to probably also get someone who already knows the compiler better to help as well Though the compiler should be already usable for many scripts and cases.
I think it would be good to have the (or a similar) source of the compiler back, because there are a few bugs in the current compiler that could be fixed and also, it could finally be compiled for Linux as well

I created a project on GitHub for this (though I think I made some changes to a header file regarding an issue compiling the compiler on x64 Linux (which caused CELL_MAX to be zero) that aren't in the repo yet):
https://github.com/Fabsch/pawnccsamp
Reply
#2

Nice Job !
Reply
#3

Awesome !!
Reply
#4

Nice work, hope you could add some screenshots, videos.

You can use imgur.com, its pretty useful.
Reply
#5

Quote:
Originally Posted by HyDrAtIc
View Post
Nice work, hope you could add some screenshots, videos.

You can use imgur.com, its pretty useful.
Videos and screenshots of what?
Reply
#6

Wow thats incredible! Thanks for making this.
Reply
#7

You may seek help from Zeex, he developed a compiler patch before to fix some bugs and I'm now using it.
Reply
#8



I think if someone will work on it, and it will be made like the current compiler (but with bug-fixes and other features), it should be made the official pawn compiler, the current one is full of bugs. :\
Reply
#9

Quote:
Originally Posted by IstuntmanI
View Post


I think if someone will work on it, and it will be made like the current compiler (but with bug-fixes and other features), it should be made the official pawn compiler, the current one is full of bugs. :\
Actually the current one is modified for SA-MP already, but it's done long long time ago. The Kalcor is unwilling to change the compiler due to stability and compatibility issues(IIRC he said in a request post of updating PAWN compiler that all server owners may need to update/rewrite their scripts in order to use a new compiler).

Still, I'm satisfied with Zeex's compiler with 512 character per line bug fixed. That's enough for me.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)