Generates Pony actor code from ActorSimulation DSL.
Pony is a capabilities-secure, actor-model language that provides:
- Type safety and memory safety
- Data-race freedom and deadlock freedom
- Zero-cost actors with async message passing
- Built-in testing with PonyTest
This generator creates production-ready Pony projects with:
- Actor implementations with behaviors
- Callback traits for custom behavior
- PonyTest test suites
- Corral dependency management
- CI/CD pipeline
- Complete documentation
Example
simulation = ActorSimulation.new()
|> ActorSimulation.add_actor(:sender,
send_pattern: {:periodic, 100, :msg},
targets: [:receiver])
|> ActorSimulation.add_actor(:receiver)
{:ok, files} = PonyGenerator.generate(simulation,
project_name: "my_actors",
enable_callbacks: true)
PonyGenerator.write_to_directory(files, "pony_output/")
Summary
Functions
Generates complete Pony project files from an ActorSimulation.
Writes generated files to a directory.
Functions
Generates complete Pony project files from an ActorSimulation.
Options
:project_name(required) - Name of the Pony project (snake_case):enable_callbacks(default: true) - Generate callback traits
Returns
{:ok, files} where files is a list of {filename, content} tuples
Writes generated files to a directory.
Creates the directory and all subdirectories as needed.