Add the ability to call native code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mars |
Fix Committed
|
Wishlist
|
Matt Giuca |
Bug Description
Mars currently provides no way to call native code, code written in other languages, or operating system services. Currently, the only non-computational (I/O) facilities in Mars are offered by the built-ins get_char, put_char and get_env.
There should be a way to interface with native code, even if it is very primitive. Provide additional built-in functions which present an interface to the POSIX dlopen/dlsym API. This would allow library modules written in C or other low-level languages to be loaded and functions called.
Also provide built-in types and functions for marshalling data between Mars and native types (C ints and pointers). This can be done in a (dodgy) very simple way by providing a new built-in type, CInt, which represents all C int, object pointer and function pointer types. If malloc and pointer-
Related branches
- Matt Giuca: Approve
- Diff: 0 lines
Changed in mars: | |
milestone: | none → 1.0 |
This is in progress on the public branch, lp:~mgiuca/mars/dlopen. Everything described above has been implemented.