Skip to content

Basic Python code generation #831

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

The current code generator creates code that can only be executed with the Safe-DS/Runner. It would be nice if it could also generate code that can be run with a normal Python interpreter that has the required DS packages.

Desired solution

Add a flag to the code generator (off by default). If it is set, the code generator no longer creates code to save placeholders or to memoize functions.

Open question: How do we handle eager_or, eager_and, eager_elvis, safe_access? To preserve the same semantics, we might just add the complete functions to the generated files, as needed, rather than an import. Maybe we always do this and remove this functionality from the runner, for simplicity? We could add the CODEGEN_PREFIX to the function names to prevent collisions with user-defined declarations.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Assignees

Labels

releasedIncluded in a release

Type

No type

Projects

Status

✔️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions