Skip to content

Conversation

@niluxv
Copy link

@niluxv niluxv commented Dec 14, 2025

Right now this is mostly moving code around, so the benchmark runner (which I have in a separate branch) can share most of its code with the cli. I have no idea whether this library could be useful for users of nova as well, I don't really know their requirements, but I assume the current setup is not flexible enough for that. (For example, currently everything assumes there is only one realm.)

The benchmark runner needs to separately parse and execute scripts, while the cli can just immediately execute a parsed script, which is why I haven't touched the script parsing and execution logic of the cli. However, maybe we can store a list of parsed but not yet executed scripts in HostDefined (alongside the module map of already executed modules, or maybe merge them?), and then implement convenience commands for script/module parsing and execution for the Instance. Or maybe that is overly complicated and it is better to leave this work to the library user.

I would love to hear any suggestions, as I find myself really struggling to provide a flexible and convenient API.

@niluxv niluxv changed the title [WIP] Librarify nova_cli to avoid code duplication [WIP] refactor(cli): Librarify nova_cli to avoid code duplication Dec 14, 2025
This already factored out some logic that was duplicated between the
`eval` and `repl` subcommands. However, the real goal is to provide a
library the benchmark runner can use, to avoid code duplication there.
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.

1 participant