SA-MP Forums Archive
[Tool/Web/Other] The Pawn Community Compiler Project - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Tools and Files (https://sampforum.blast.hk/forumdisplay.php?fid=82)
+---- Thread: [Tool/Web/Other] The Pawn Community Compiler Project (/showthread.php?tid=659284)



The Pawn Community Compiler Project - [HLF]Southclaw - 29.09.2018

Pawn Community Compiler



What

This is a modified version of the Pawn 3.2.3664 compiler with many bug fixes and enhancements.

This project was originally started by Zeex but on 2017-12-31, the project was taken over by some members of the SA:MP community. Zeex still contributes to the project, along with the Compiler Team.

The original readme is available here

Why

This project exists to:
If you find problem, you can open an issue and contributors can work on a fix. This isn’t true with the original compiler that comes with the SA:MP server distribution.

There are also new features that enhance the development experience, such as telling you which tags are involved in a “tag mismatch” or showing you where that pesky “symbol is never used” is actually declared.

There are plenty of features and fixes that are documented, see below for links:
How to Use

Binary packages can be downloaded from Releases, see the below sections for platform-specific installation instructions.

Note: You will probably get warnings/errors/fatals when you first build with this compiler — you need to add the -Z flag to your build configuration or add #pragma compat. See this page for more information.

You can also get the latest development binaries for Windows on AppVeyor. This archive is built automatically on every Git commit and can be pretty unstable, so use at your own risk.

Windows

If you just use an editor configured to run pawncc such as Pawno, Sublime Text or VS Code you can simply delete your existing pawncc.exe and replace it with the new one.

Download the ZIP archive and extract pawnc.dll, pawncc.exe, pawndisasmsm.exe to your original pawncc directory. If you use Pawno, this will be in the pawno/ folder that’s inside your server directory.

openSUSE/SLES

There is an installation package available for openSUSE/SLES users so that you can easily install the compiler on your distribution. Please follow these steps:
  1. Go to https://build.opensuse.org/package/s...hnitzer/pawncc
  2. On the right side, select your distribution (only if it’s not disabled!)
  3. Click “Go to download repository”
  4. Copy the link and enter in sudo mode in your shell:
    zypper ar $COPIED_LINK home:mschnitzer
  5. Again as root, type: zypper ref
  6. Install the package with zypper in pawncc
  7. Run pawncc in your shell to test if it’s working
With sampctl

If you are a sampctl user, you are already using this compiler!

Build From Source

If you are interested in contributing or just using a specific version, check out this page for instructions for compiling for your platform.

Background

The project was originally started as a set of patches aimed to create a compiler that would be compatible with the compiler used in SA-MP (San Andreas Multiplayer).

SA-MP uses a modified version of Pawn 3.2.3664 [1] with Windows-only executables, and the developers said that they lost the source code for it which means it can’t be ported to other platforms (e.g. Linux) and newly discovered bugs can’t be fixed. So the main goal of the project is to re-create changes that were previously made by the devs as well as fix all known compiler bugs.

[1] It’s worth noting that the version of the AMX embedded into the SA-MP server seems to be based on an older release of Pawn.


Re: The Pawn Community Compiler Project - SyS - 29.09.2018

Ahh really love this


Re: The Pawn Community Compiler Project - Graber - 29.09.2018

your code will compile faster with this, use it!


Re: The Pawn Community Compiler Project - coool - 29.09.2018

WOW.


Re: The Pawn Community Compiler Project - FinStar - 29.09.2018

nice, good luck


Re: The Pawn Community Compiler Project - Undef1ned - 29.09.2018

Good


Re: The Pawn Community Compiler Project - CaptainBoi - 29.09.2018

Good Job


Re: The Pawn Community Compiler Project - Freaksken - 29.09.2018

Would be great if this would replace the old compiler in the next server package. Just switching from the old compiler to this one improved the compile time on one of my test modes from 7.2s to 1.9s!


Re: The Pawn Community Compiler Project - solstice_ - 29.09.2018

Neat!


Re: The Pawn Community Compiler Project - Variable™ - 29.09.2018

Great work!


Re: The Pawn Community Compiler Project - cuddlee - 30.09.2018

10/10 would recommend to a friend


Re: The Pawn Community Compiler Project - aymel - 30.09.2018

ah yes open source *rubs hands*


Re: The Pawn Community Compiler Project - iLearner - 30.09.2018

Yep recommended.


Re: The Pawn Community Compiler Project - wallee - 05.10.2018

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
SA-MP uses a modified version of Pawn 3.2.3664 [1] with Windows-only executables, and the developers said that they lost the source code for it which means it can’t be ported to other platforms (e.g. Linux) and newly discovered bugs can’t be fixed. So the main goal of the project is to re-create changes that were previously made by the devs as well as fix all known compiler bugs.

[1] It’s worth noting that the version of the AMX embedded into the SA-MP server seems to be based on an older release of Pawn.
if kalcor lost the source code to it and then you guys recreated it from scratch how do you know this matches all the functionality of the old one?

i am using this for about a year and haven't encountered any issues but i'm just curious


Re: The Pawn Community Compiler Project - Y_Less - 05.10.2018

Quote:
Originally Posted by wallee
Посмотреть сообщение
if kalcor lost the source code to it and then you guys recreated it from scratch how do you know this matches all the functionality of the old one?

i am using this for about a year and haven’t encountered any issues but i’m just curious
Kalcor didn’t do the original modifications, I did. Even if that weren’t the case, it is very easy to confirm that the changes match by taking code that would only compile on the old one and compiling it on the new one.


Re: The Pawn Community Compiler Project - NoahF - 13.10.2018

Simply fantastic. Great work, thank you!


Re: The Pawn Community Compiler Project - Calisthenics - 14.10.2018

Is this a normal behavior of const-correctness? The compiler complains (as it should) about 1D array but not for 2D, 3D or 4D arrays
pawn Код:
#include <a_samp>

main()
{
    new arr[10];

    func(arr);

    printf("value: %d", arr[0]);
}

func(const arr[])
{
    arr[0] = 1; // error 022: must be lvalue (non-constant)
}
pawn Код:
#include <a_samp>

main()
{
    new arr[10][10];

    func(arr);

    printf("value: %d", arr[0][0]); // prints "value: 1"
}

func(const arr[][])
{
    arr[0][0] = 1;
}
No warnings. It modifies the value even though it is meant to be a constant array.


Re: The Pawn Community Compiler Project - Y_Less - 14.10.2018

No, that's not correct. Could you open an issue on github please?