-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
TL;DR
Introduce a dedicated, internal Truffle language for implementing POSIX-level file and networking support in guest languages.
Problem description
Languages (e.g., Python, Ruby, ...) usually don't have very good OS abstractions, they tend to model their APIs after POSIX and expose rather low-level aspects of POSIX. Emulating all those APIs with Truffle filesystem and other Truffle APIs that actually do abstract OS properly is tedious and partially impossible. Thus, any POSIX layer in languages may need to expose access to the underlying native libraries for maximum compatibility, and also implement alternatives to those APIs on top of the Truffle APIs to allow sandboxing and virtualization via the Truffle features (FileSystem, permissions, limits, ...).
Goals
- A Truffle API that would offer POSIX functionality
- An emulated backend for that Truffle API: implemented on top of existing Truffle abstractions (TruffleFile, FileSystem, ...) and thus keeping the Truffle sandbox intact
- A native backend for that Truffle API: this calls native POSIX functions directly using NFI ("NFI POSIX") for maximum compatibility
Non-Goals
- Complete emulation of all POSIX functionality in the emulated backend
- Isolation of the native backend when different contexts are active in the same OS process