← Concurrency Model | Debugging and Profiling → |
---|---|
Interfaces with External Systems¶
(This document is a placeholder and needs to be populated with details about how Dana programs interface with external systems, focusing on the Resource
mechanism but also considering other potential integration points.)
Key Aspects to Cover:¶
- Core Mechanism:
Resource
Capabilities - Reiterate the concept of
Resource
capabilities (see../01_dana_language_specification/capabilities_and_resources.md
- to be created or linked). - How Python-defined
Resource
classes are made available to the Dana runtime. - How Dana code invokes methods on these resources (e.g.,
private:llm_resource.call("some_prompt")
). - Configuration of resources (e.g., API keys, endpoints) via
SandboxContext
or a dedicated configuration mechanism. - Error handling for resource calls.
- Data serialization/deserialization between Dana types and Python types at the resource boundary.
- Standard Library of Resources: What common resources will be provided out-of-the-box? (e.g., HTTP client, file system access, LLM interfaces).
- Calling External Python Code:
- Beyond structured
Resource
capabilities, are there ways to call arbitrary Python functions? - Security implications and sandboxing considerations if this is allowed.
- Foreign Function Interface (FFI): Any plans for interfacing with code in other languages (e.g., C, Rust)? (Likely a future consideration).
- Input/Output:
- Standard streams (stdin, stdout, stderr) and how they are handled, especially for
log()
. - File I/O: primarily through a
FileSystemResource
? - Inter-Process Communication (IPC): If Dana agents need to communicate, what mechanisms would be used?
- Embedding Dana: How can the Dana interpreter/sandbox be embedded within a larger Python application?
- Programmatic API of the
DanaSandbox
orDanaInterpreter
. - Passing initial context, retrieving results.
Self-reflection: The Resource
model is the primary and safest way for Dana to interact with the outside world. Other mechanisms need careful security and design consideration.