Skip to content

Integrate Conductor Interface for py-slang Runner #56

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

Merged
merged 3 commits into from
May 24, 2025

Conversation

WangYuyang1013
Copy link
Contributor

This PR integrates the Conductor Interface into the py-slang project, enabling standardized communication between the py-slang runner and the Source Academy frontend.

Adapted the Conductor Interface from source-academy/conductor, including the following directories:
src/conductor/
src/common/
src/conduit/
I modified README.md to include acknowledgements to the author of the conductor. Additionally, each adapted file includes a header comment indicating its origin from the conductor repository.
The conductor-related folders were directly copied from the repository. I did not modify that part of the code and did not know much about it (I just know it works will now).

The part I designed and implemented is the connection layer—mainly:
src/runner/pyRunner.ts:
This introduces the runCSEMachine function, which wraps the evaluate function and returns a standardized Result using CSEResultPromise.

src/index.ts:
Exports runInContext, which converts Python code into an ESTree AST and runs it through runCSEMachine.
Initializes the Conductor plugin with initialise(PyEvaluator).

@Fidget-Spinner
Copy link
Contributor

I'll review this in a day or two. Thanks!

Copy link
Contributor

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't review the conductor bits in detail, but I trust it's just copied from upstream.

@WangYuyang1013 WangYuyang1013 marked this pull request as ready for review May 24, 2025 08:55
@WangYuyang1013 WangYuyang1013 merged commit f26c68c into main May 24, 2025
5 checks passed
@WangYuyang1013 WangYuyang1013 deleted the conductor-interface branch May 24, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants