Quote:
Originally Posted by Powerlord
I'm only saying this because APIs are better to write in C++ than SourcePawn, just because you can create type-safe Handles in the C++ API side
|
I can't immediately see the motivation for creating Handles from Pawn, since Pawn cannot create its own heap-allocated data structures. Deriving new Handle types from existing ones from Pawn - sure. But, for example, C++ needs to hook into CloseHandle to free memory, and that doesn't make much sense for Pawn.
And you don't need to override Handles to get similar safety properties. You can re-tag, and introduce your own alternative to CloseHandle (for example, VoteThing:, DestroyVoteThing).
Quote:
Originally Posted by Powerlord
plus the lack of multi-dimension array passing through natives in SourcePawn
|
You mean, local arrays, and not ADT arrays? For Pawn<->Pawn you should use ADT arrays. It's difficult to marshal 2D local arrays in the current VM because they have to be copied between the plugin's memory spaces. This restriction is deeply embedded into the VM, but could be removed with a little effort.
Writing extensions in C++ is a huge burden (on you, your users, and even the SM maintainers) - sometimes it's necessary, when embedding 3rd-party libraries or needing complex datastructures not exposed to Pawn. But ideally, the language and Core functionality could be improved to obviate the need. I didn't realize this when first designing SourceMod, and thus the extension system is fairly powerful. In retrospect, we should have focused on interop and FFI.
__________________