Tell me more!
SourcePawn 2 runs plugins directly from source. That means you can drop ".sp" files in your plugins folder and they
just work. Offline syntax and type checking is also supported. There are no plans to remove .smx support, however, .smx files will not be able to take advantage of SourcePawn 2.
My goal is to support enough SourcePawn language features that 70% of plugins on the forums will work. From there I'll evaluate what features are remaining and whether they're worth adding. In this initial prototype, enough features are working to write very simple plugins, though #include does not work so you must declare natives manually.
Here are the known language features I have not implemented, but will implement:
- Const with non-refs
- Array literals
- Float comparison
- Non-branching comparison
- Global variables
- Dynamic arrays
- #include <>
- Array slicing
- Float comparisons
- Booleans
- The any: tag
- Optional semicolons
- Chained relational operators
- Ternary expressions
- Passing functions as variables/parameters
- SortCustom2D, SortStrings
- Very limited, specific uses of #if and #define
Eventually, if/as the language reaches maturity, I will start adding new language features that people have been requesting:
- Resizable arrays
- Global dynamic arrays
- Structs
- Classes
- Closures/nested functions
- Discriminated unions
- Dynamic types
- First-class FFI
SourcePawn 2 includes garbage collection. I've implemented a very basic garbage collector that only runs on map changes. For most use cases I've managed to maintain SourcePawn's performance and memory guarantees surrounding arrays, which is great.
Aside from that, the entire architecture is much more amenable to high-powered performance optimizations than SourcePawn 1. Although the implementation right now is simple (GC is not realtime, and the execution mode is an interpreter), the entire architecture is geared toward making an advanced GC and an optimizing JIT very easy.