Skip to content

Add progress indicator for compile operations - #142

Open
qcjames53 wants to merge 4 commits into
WingedSeal:mainfrom
qcjames53:add-progress-indicator
Open

Add progress indicator for compile operations#142
qcjames53 wants to merge 4 commits into
WingedSeal:mainfrom
qcjames53:add-progress-indicator

Conversation

@qcjames53

@qcjames53 qcjames53 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This PR adds a progress indicator, spinner, current file string (called context), and additional user-facing logging to compile operations in interactive and non-interactive JMC compiles. It works in both TTY and non-TTY terminals and should support any compile errors gracefully (cleans up the status indicator where possible).

Demo recording:

Screencast.From.2026-07-15.22-38-24.mp4

Notes:

  • If the terminal is too small to display the context, it's not drawn.
  • I took care to make sure compile performance is not impacted by this addition. I ran a compile 100 times on the slowest computer I have and noticed no difference between this branch and the current master branch for average and median compile times (most times were well within the observed std dev of compile time).
  • Redraws are limited to 15 fps which seemed to be a decent performance compromise. This can be adjusted. If 100% accurate info is needed we can always run a print_status call on each emit_tick or emit_context call.
  • Displaying the progress indicator "Lexing [1/20]" isn't performant at all; I couldn't find a good way to pre-walk the import tree without doubling file reads (cost 150ms per compile in my test pack). We get a "Writing [1/20]" indicator for free if you'd like me to add that, though.

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