Skip to content

Process args in to Server instead of mutating & referencing args in the program - #54

Open
John-Colvin wants to merge 5 commits into
SogoCZE:mainfrom
John-Colvin:process_args
Open

John-Colvin wants to merge 5 commits into
SogoCZE:mainfrom
John-Colvin:process_args

Conversation

@John-Colvin

@John-Colvin John-Colvin commented Jul 29, 2025

Copy link
Copy Markdown
Contributor

This allows for some separation between what the user asked for in args and what the internals reference. It makes things easier in a multi-project setting (the server becomes per-project & should represent all the state for it, settings like jai path can be different per project). It also seems better prep for using Jails as a library.

Comment thread server/diagnostics.jai Outdated
Comment thread server/main.jai
args: Args;
quit := false;

// This is from the config file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed because misleading: roots et al are discovered if not set to anything in config.

Comment thread server/main.jai
log_error("Could not parse arguments");
exit(1);
}
log("Args are %", args);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

subtle difference in logging here. Previously the code logged the args including the result of any compiler path finding work, now it does not, which seems fine as a) more honest w.r.t. actual passed args & b) the compiler path finding has its own logging.

Comment thread server/main.jai
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