Pawn 3.3.4097 Ranking & Summary
Pawn 3.3.4097 description
Pawn 3.3.4097 is a simple, typeless, 32-bit extension language with a C-like syntax. A pawn "source" program is compiled to a binary file for optimal execution speed.
The pawn compiler outputs P-code (or bytecode) that subsequently runs on an abstract machine. Execution speed, stability, simplicity and a small footprint were essential design criteria for both the language and the abstract machine.
Features include a small footprint, inherent support for automatons or "state machines", quick execution of the P-code and a good interface to "native" functions. These features make Pawn a good scripting language for games, multimedia applications and embedded software (for which scripting is needed). Optimized P-code ("bytecode") interpreter in assembler (Windows & Linux); there is even a JIT for Windows and Linux. Full source code is included. Pawn was formerly called the "Small" language.
- Language features
- Pawn is a deterministic language: it will run at the same speed every launch --there is no garbage collector that kicks in. The compiler can estimate the memory footprint for the script (unless the script contains a recursive procedure), and that memory footprint is fixed and stable as well.
- The pawn language is derived from C, and in some ways I have tried to "fix" syntaxes of what I see as counter-intuitive or error-prone in the C language. The cases in a "switch" statement are not fall through, for example.
- Pawn supports pass-by-value (like C) and pass-by-reference for function arguments.
- Pawn supports default function arguments, for arrays and simple variables. The arguments with a default value do not have to be at the end of the argument list.
- Pawn supports named parameters together with the conventional positional parameters.
- Pawn supports states and automatons (state machines) directly in the language, including state-local variables. Doing this in the compiler allows for flexibility and optimal performance, as well as having the compiler verify the constraints of the automaton.
- Pawn has no "struct"s, but it extends arrays so that it can mimic light-weight structures with arrays; as an example of those extensions, pawn supports array assignment and array indices can be "tag checked".
- Array sizes are deterministic, but array declaration is flexible. All dimensions in a multi-dimensional table may be variable size, for example.
- Pawn supports symbolic constants, conditional compilation and assertions, as well as text substitution via a kind of "pre-processor". The advantage of unifying the pre-processor with the compiler is that the "#if" knows about "enum"s (which is not the case in standard C: "#if" is a pre-processor command, "enum" is a C construct).
- If you want to say that something costs 3 Euro, you might write "printf("price 2003 ");" in C (where octal 200 is decimal 128, which is the position in the updated ANSI character set that the Euro symbol resides in). This works for 8-bit characters, but what about 16-bit/32-bit Unicode/UCS-4 characters? In pawn, the numeric character code is optionally explicitly terminated with a semicolon, just to avoid this problem. So in pawn, you would write: "printf("price 128;3 ");" (in pawn, numeric character codes are in decimal, rather than octal). This is just one example of those little and minor annoyances that exist in C/C++ and that pawn addresses.
- With packed and unpacked strings, pawn is able to bridge ASCII and Unicode subsystems. The compiler accepts source files in 8-bit ASCII and UTF-8. When running in ASCII mode, the compiler can translate extended ASCII characters to Unicode, based on codepage tables --this even works for MBCS codepages.
- Like in C++, variable declarations may occur at any position where a statement is valid, as well as in the first expression of a "for" statement. pawn supports block local static variables, as well as the common local and global variables.
- The integer division and modulus operators ("/" and "%") are well defined for negative operands, unlike C (ISO C89) and C++. The ISO C99 standard (finally) defines "truncated division" as standard; Java also uses truncated division. pawn uses "floored division", as defined by Donald Knuth and as is also used by Haskell and Python.
- Toolkit features
- Pawn comes with an implementation of an abstract machine in portable C. The abstract machine is a set of C functions that you can easily link to an application or function library. By compiling the source code to P-code for an abstract machine (or "virtual machine"), pawn is much faster than pure interpreters.
- Pawn is certainly among the fastest of the scripting languages, especially when using an abstract machine in hand-crafted optimized assembler or a JIT. These optimized abstract machines are not very portable, but versions for Windows, Linux (running on x86 architecture) and ARM7 processors exist.
- The abstract machine for pawn lends itself well for embedding: the abstract machine has low overhead and multiple abstract machines may run concurrently in a process; the interface to native functions (in C/C++) is flexible and also has low overhead; no components other than a few functions from the standard C library are required to build the abstract machine. The abstract machine does not require dynamic memory allocation (or grabage collection) or file I/O. The abstract machine itself is ROM-able and it requires very little RAM.
- For memory-constrained devices, pawn scripts can run directly from ROM. Alternatively, pawn has compiler support for "code overlays" where chunks of code are read from a storage (for example a SD/MMC card, or Flash ROM) on an as-needed basis.
- For a little language, the pawn compiler has a pretty good error system. I dare to compare it with commercial level C/C++ compilers with all warnings enabled.
- Although the debugger for the pawn abstract machine is primitive, it is an order of magnitude better than the "printf" style of debugging that is so common for little languages.
- For a little language, I would also say that pawn is nicely documented. Many people learn by example, so the July 2004 edition of the "Language Guide" contains 17 complete pawn programs that cover a variety of topics and 21 pawn code snippets that form complete functions. Various extension modules come with their own documentation with more example programs. The "Implementers Guide" contains 10 C/C++ code snippets (for embedding the abstract machine in your application) that build a complete program (with various options) when put together. pawn is also one of the very few scripting languages that documents the abstract machine: the pseudo-instructions, memory layout and pseudo-registers.
- Pawn is a 32-bit language (even when compiled with 16-bit DOS tools), you can also compile it as a 64-bit language. It runs on 16-bit platforms (either DOS or an "embedded" platform) without problem.
- The security model of pawn is based on the robusteness of the tools and on execution of the P-code in a "sandbox" environment. There is a caveat: native functions (provided by the host application or executing environment) can do anything; the implementer of such native functions should address the appropriate security issues.
Enhancements: Bug fixes and minor enhancements.
Pawn 3.3.4097 Screenshot
Pawn 3.3.4097 Keywords
Bookmark Pawn 3.3.4097
Pawn 3.3.4097 Copyright
Want to place your software product here?
Please contact us for consideration.