Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Compiler Plugins #241

Closed
andrewmd5 opened this issue May 21, 2023 · 0 comments
Closed

[FEATURE] Compiler Plugins #241

andrewmd5 opened this issue May 21, 2023 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@andrewmd5
Copy link
Contributor

andrewmd5 commented May 21, 2023

Objectives

  • Introduce a streamlined approach to augment the functionality of bebopc, including the enhancement of existing generators and the creation of new ones.
  • Ensure plugins can be developed in any programming language, thereby increasing developer productivity.
  • Maintain full sandboxing of plugins to prevent file system access. While 'bebopc' is trusted, allowing arbitrary native code execution through the compiler could expose potential supply chain attack vectors.

Preliminary Design

  • Plugins will adopt the WebAssembly (wasm) format.
  • 'bebopc' will employ Wasmtime for loading and engaging with plugins.
  • We will provide a series of official packages that developers can integrate into their plugin projects. These packages will supply all the essential abstractions and definitions for plugin development.
  • Plugins will define their capabilities upon registration. For example, if a plugin needs to generate an auxiliary file, it should make this declaration in its manifest. In addition, a plugin should specify whether it serves as a generator or an enricher. A generator plugin will receive the complete AST, much like a built-in generator. Conversely, an enricher plugin will receive event notifications when certain generator activities are about to take place (including those from other generator plugins). This could involve events such as documentation being written or a class definition being prepared, allowing the enricher plugin to contribute additional data or modify the impending output.

Proof of Concept (POC)

  • Develop a hosting layer within bebopc.
  • Design a plugin abstraction and library compatible with AssemblyScript.
  • Illustrate the usage of these elements by creating an exemplary AssemblyScript plugin.

Non-goals

  • Creating a hosted repository of plugins. While this would be magnificent for a lot of reasons, it is sadly out of the scope of the project goals for now.
  • Runtime support: the creation of a Bebop runtime will still largely be done by hand for any language.
@andrewmd5 andrewmd5 added the enhancement New feature or request label May 21, 2023
@andrewmd5 andrewmd5 pinned this issue May 21, 2023
@andrewmd5 andrewmd5 added this to the v3.0.0 milestone Dec 21, 2023
@andrewmd5 andrewmd5 unpinned this issue Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant