Skip to content

rybakatchya/Pawn.Net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pawnx64.Net

A simple, efficient wrapper around PawnX64.

What is it?

Pawn is a simple, typeless, scripting language with a C-like syntax. 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 criterions for both the language and the abstract machine. Pawn prealloates all memory at startup and

This is an updated version of the pawn scripting language. Using Pawnx64 as a jit compiler. Please see PawnX64 for a list of changes from the original language.

What is it useful for?

Allowing end users to extend your applications in a safe sandboxed enviroment. There is no built in standard library so the language has no functions to call unless you implement them. This is greate for securely executing untrusted code on any machine.

Pawn has no runtime memory allocations or even a garbage collector, this makes pawn an ideal choice for making a mod sdk for video games.

When benchmarked against other .net scripting solutions PawnX64.Net performs much better.

Benchcmarks

Pawnx64.net

Alt text

Lua via MoonSharp

Alt text

js via Jint

Alt text

C# via Reflection

Alt text

Why use Pawnx64.Net and not reflection then?

Use Pawnx64.Net when you want to run untrusted code in a sanbox. As CAS is not longer supported, you cannot sandbox reflected assemblies. When you need memory efficciency. Pawn has no garbage collector and thus no runtime memory allocations. All memory for pawn is allocated at startup in a linear block.

Extending Pawnx64.net

You can register natives in your host application. You can also write plugins in C# or C see NativePluginTest and PluginTest.cs

Getting started

Setting up the pawn abstract machine is simple.