Skip to content

Commit b99070e

Browse files
committed
feat: Add ProXPL VS Code extension for language support and update project version to 0.7.0.
1 parent c3c5536 commit b99070e

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.15)
2-
project(ProXPL VERSION 0.6.0)
2+
project(ProXPL VERSION 0.7.0)
33

44
# Enable C and C++
55
enable_language(C CXX)

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,19 @@ func showcase_stdlib() {
302302
}
303303
```
304304

305+
### Foreign Function Interface (FFI)
306+
307+
ProXPL can invoke native C functions from dynamic libraries (`.dll`, `.so`) using the `extern` keyword.
308+
309+
```javascript
310+
// Load C standard library
311+
extern "msvcrt.dll" "puts" func c_puts(text);
312+
extern "msvcrt.dll" "abs" func c_abs(n);
313+
314+
c_puts("Hello from C!");
315+
let dist = c_abs(-100);
316+
```
317+
305318
---
306319

307320
## 📦 Package Manager (PRM)

docs/language-spec/LANGUAGE_SPEC.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,34 @@ func main() {
986986
main();
987987
```
988988

989+
990+
---
991+
992+
## Foreign Function Interface
993+
994+
ProXPL supports loading and calling external native functions using the `extern` declaration.
995+
996+
### Syntax
997+
```javascript
998+
extern "libname" "symbol" func name(param1, param2);
999+
```
1000+
1001+
- **libname**: Path or name of the dynamic library (`.dll`, `.so`, `.dylib`).
1002+
- **symbol**: Exact name of the exported symbol in the library.
1003+
- **name**: Name used to call the function within ProXPL.
1004+
- **params**: Parameter names (types are marshalled automatically).
1005+
1006+
### Type Marshalling
1007+
1008+
| ProXPL Type | C Type (Argument) | C Type (Return) |
1009+
|-------------|-------------------|-----------------|
1010+
| `Number` | `int` / `double` | `int` (default) |
1011+
| `String` | `char*` | `char*` |
1012+
| `Bool` | `int` | `int` |
1013+
| `Null` | `NULL` | `NULL` |
1014+
1015+
> **Note**: The current implementation primarily supports integer return types. Support for floating-point and void returns is planned.
1016+
9891017
---
9901018

9911019
## Conclusion

extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "proxpl",
33
"displayName": "ProXPL Language Support",
44
"description": "Syntax highlighting and language support for the ProXPL programming language",
5-
"version": "0.6.0",
5+
"version": "0.7.0",
66
"publisher": "ProXentix",
77
"repository": {
88
"type": "git",

0 commit comments

Comments
 (0)