3 ms·
I originally wrote a long reply, but my damn tablet crapped out on me and I lost it, so my apologies for the brevity here. Object Pascal will do most of what y
by TimJYoung 8y ago
I originally wrote a long reply, but my damn tablet crapped out on me and I lost it, so my apologies for the brevity here.
Object Pascal will do most of what you want ( c) with VM interop is an issue, but will be for most languages), and is available on a lot of platforms.
On native platforms, you get straight-up manual memory management of class instances (Create/Free methods) or alloc/free memory directly.
On VM platforms like the JVM or CLR, or LLVM-backend compilers that use ARC, the Create/Free methods for class instances are typically mapped to Create/Dispose methods so that non-GCed resources can be disposed of properly.
Things like strings, dynamic arrays, and interfaces are already reference-counted and don't use manual memory management, but can be move'd, etc. and dealt with like normal blocks of memory on native platforms.
There is also marshalling for lower-level access to C APIs from the VM platforms and LLVM back-ends, and direct call access to C APIs from native code with various call modifiers.
There are also some neat things for native platforms like methods for hooking class instance allocation so that you can provide your own per-class memory pools.
The only downside is that you may find some syntax differences on certain platforms, and besides Free Pascal, the compilers tend to cost $$$.
- sjmulder 8y agoThis is a very interesting idea and might be just what I'm looking for. Thanks.