SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 19/08/2013, 04:51 PM   #1
Fabsch
Little Clucker
 
Join Date: May 2009
Posts: 20
Reputation: 7
Post (Partly) reconstructed PAWN compiler

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
Fabsch is offline   Reply With Quote
Old 19/08/2013, 08:36 PM   #2
celice
Little Clucker
 
Join Date: Mar 2013
Location: Latvia
Posts: 2
Reputation: -3
Default Re: (Partly) reconstructed PAWN compiler

Nice Job !
celice is offline   Reply With Quote
Old 19/08/2013, 10:01 PM   #3
czerwony03
Big Clucker
 
czerwony03's Avatar
 
Join Date: Nov 2012
Location: Poland
Posts: 121
Reputation: 10
Default Re: (Partly) reconstructed PAWN compiler

Awesome !!
__________________

Did I help You? Leave Rep+ ()! Thx!
czerwony03 is offline   Reply With Quote
Old 20/08/2013, 10:47 PM   #4
HyDrAtIc
High-roller
 
Join Date: Jan 2012
Posts: 1,191
Reputation: 233
Default Re: (Partly) reconstructed PAWN compiler

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

You can use imgur.com, its pretty useful.
HyDrAtIc is offline   Reply With Quote
Old 07/09/2013, 06:11 PM   #5
Cell_
Big Clucker
 
Join Date: May 2012
Posts: 118
Reputation: 29
Default Re: (Partly) reconstructed PAWN compiler

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?
Cell_ is offline   Reply With Quote
Old 15/09/2013, 02:55 PM   #6
QuaTTrO
Gangsta
 
QuaTTrO's Avatar
 
Join Date: Aug 2009
Posts: 525
Reputation: 75
Default Re: (Partly) reconstructed PAWN compiler

Wow thats incredible! Thanks for making this.
QuaTTrO is offline   Reply With Quote
Old 21/09/2013, 07:45 AM   #7
leong124
High-roller
 
leong124's Avatar
 
Join Date: Jun 2008
Location: Hong Kong, China
Posts: 1,496
Reputation: 134
Default Re: (Partly) reconstructed PAWN compiler

You may seek help from Zeex, he developed a compiler patch before to fix some bugs and I'm now using it.
__________________
[KDT_MS]hk_shade

Sorry for my bad English and my weakness in expressing myself.
leong124 is offline   Reply With Quote
Old 21/09/2013, 07:55 AM   #8
IstuntmanI
High-roller
 
IstuntmanI's Avatar
 
Join Date: Mar 2009
Location: Romania
Posts: 1,832
Reputation: 375
Default Re: (Partly) reconstructed PAWN compiler



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. :\
__________________


IstuntmanI is offline   Reply With Quote
Old 21/09/2013, 09:12 AM   #9
leong124
High-roller
 
leong124's Avatar
 
Join Date: Jun 2008
Location: Hong Kong, China
Posts: 1,496
Reputation: 134
Default Re: (Partly) reconstructed PAWN compiler

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.
__________________
[KDT_MS]hk_shade

Sorry for my bad English and my weakness in expressing myself.
leong124 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PAWN Compiler Error Unable to execute Compiler.. Geeboi_Mehdi General 13 07/11/2015 04:26 PM
Please help ( PAWN Compiler "Error Unable to execute Compiler...") morocco Scripting Help 4 05/02/2013 03:34 PM
Pawn Compiler Help leongrdic Scripting Help 7 16/07/2012 04:23 PM
[Help With Pawn] Pawn and compiler is not working..... D_Less Client Support 3 09/03/2012 04:49 AM
[DUV] Pawn Compiler sergio_killer PortuguÍs/Portuguese 8 27/05/2010 01:22 PM


All times are GMT. The time now is 06:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.