Skip to content

refactor(nostrand): split the engine out of the CLI into a Nostrand library - #189

Merged
parth-io merged 4 commits into
developfrom
refactor/split-cli-from-boot
Oct 7, 2026
Merged

parth-io merged 4 commits into
developfrom
refactor/split-cli-from-boot

Conversation

@parth-io

@parth-io parth-io commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #185

Code refactor

  • The boot sequence moves from NostrandMain.exe into nostrand-lib/ (Nostrand.dll) as Runtime.Boot, LoadNostrand, EstablishProject and Run, which the CLI's Main calls.
    • nostrand.core, nostrand.tasks, nostrand.repl and nostrand.deps.* move with it and no longer reference NostrandMain or Mono.Terminal, so a host without a console (the Unity Editor) can serve the UDP REPL.
    • Terminal tasks (version, where, repl* functions) move to a new nostrand.cli.

Tweaks made to support the refactor

  • Runtime.RegisterTasks adds a namespace to the unqualified-name search after nostrand.tasks, so a host cannot shadow a built-in. The CLI registers nostrand.cli this way. The task list and FindFunction move from Nostrand into Runtime beside Run, so the registry lives in one class.
  • nostrand.repl/socket takes :on-start and :on-eval callbacks in place of its console loop and echo, and nostrand.cli supplies both, along with the private helpers continue-prompt and balanced?.
    • The unused nostrand.repl/repl function is deleted.

Cleanup

  • Drops nostrand/Scripts/patch-assembly-info.sh and unpatch-assembly-info.sh, and drops the custom SetSourceRevisionId targets from .csproj files. Those changes originally added git describe strings, but now since SDK 8, SourceLink fills in the full commit SHA itself.

@parth-io parth-io self-assigned this Oct 5, 2026
@parth-io
parth-io marked this pull request as draft October 5, 2026 09:15
…in SourceLink

The runtime and nostrand csprojs ran `git describe` to fill
SourceRevisionId. Since SDK 8, SourceLink fills in the full commit SHA
itself.
@parth-io
parth-io force-pushed the refactor/split-cli-from-boot branch 2 times, most recently from 8acc1fa to 1a68869 Compare October 6, 2026 06:36
@parth-io
parth-io requested a review from skydread1 October 6, 2026 06:39
@parth-io
parth-io marked this pull request as ready for review October 6, 2026 06:39
@parth-io
parth-io force-pushed the refactor/split-cli-from-boot branch from 1a68869 to 443df73 Compare October 6, 2026 06:48
Comment thread nostrand/Program.cs
Comment thread nostrand-lib/Runtime.cs
Comment thread nostrand-lib/Runtime.cs
Comment thread nostrand/nostrand/cli.clj
Comment thread nostrand-lib/nostrand/repl.clj Outdated
Comment thread nostrand-lib/Nostrand.cs Outdated
Comment thread nostrand-lib/Nostrand.cs
Comment thread nostrand-lib/Nostrand.cs
Comment thread docs/bootstrap.md Outdated
Comment thread CHANGELOG.md Outdated
…ibrary (#185)

Nostrand.cs held both the engine and the console entry point, so the
only way to boot MAGIC was to run the exe. The engine now lives in
nostrand-lib/ as Nostrand.dll, and nostrand/ is the CLI wrapper.

The terminal tasks moved to a new nostrand.cli, which the CLI registers
through Runtime.RegisterTasks. nostrand.repl/repl had no callers and was
removed.
@parth-io
parth-io force-pushed the refactor/split-cli-from-boot branch from 443df73 to 7c0d887 Compare October 7, 2026 05:36
@parth-io
parth-io requested a review from skydread1 October 7, 2026 05:42
@parth-io
parth-io merged commit e2bdd3c into develop Oct 7, 2026
1 check passed
@parth-io
parth-io deleted the refactor/split-cli-from-boot branch October 8, 2026 01:26
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.

nostrand/ contains the code to boot MAGIC as well as the CLI

2 participants