Skip to content

Conversation

@lionel-
Copy link
Contributor

@lionel- lionel- commented Jan 30, 2026

The core of Ark has historically been implemented in interface.rs and consolidated in a singleton struct RMain in #52

Really this struct is mostly about the ReadConsole and WriteConsole handlers, and we've been thinking about renaming interface.rs to console.rs, and RMain to Console for a while. Some files already use the console_ prefix, e.g. console_debug.rs and console_annotate.rs. This PR gets us through the other side of that ongoing change.

@lionel- lionel- requested a review from DavisVaughan January 30, 2026 12:49
@lionel- lionel- force-pushed the task/rename-interface branch from 0819c21 to 72fa9d0 Compare January 30, 2026 18:01
Copy link
Contributor

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

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

I think we should put in the effort to complete the rename. i.e. let main should become let console everywhere. And I'd prefer if con could be console, for clarity

}

let main = RMain::get();
let main = Console::get();
Copy link
Contributor

Choose a reason for hiding this comment

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

You're going to have a lot of these, which are going to be quite confusing to read 😢

If you can get these to update to let console = then I'd be in favor of that

#[cfg(not(test))] // Unit tests do not have an `RMain`
// Mem-Safety: Object protected by `RMain` for the duration of the `r_task()`
let mut env = crate::interface::RMain::get().read_console_frame().sexp;
#[cfg(not(test))] // Unit tests do not have an `Console`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#[cfg(not(test))] // Unit tests do not have an `Console`
#[cfg(not(test))] // Unit tests do not have a `Console`

let events_tx = events_tx.clone();
move || {
RMain::with_mut(|main| main.set_lsp_channel(events_tx));
Console::with_mut(|con| con.set_lsp_channel(events_tx));
Copy link
Contributor

Choose a reason for hiding this comment

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

I greatly prefer console over con. I immediately think "connection" when I see con

Copy link
Contributor Author

@lionel- lionel- Feb 2, 2026

Choose a reason for hiding this comment

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

I see where you're coming from. That said the con abbreviation for console is a very common one: https://github.com/search?q=%22con+%3D+console%22&type=code

Another abbrev I've been using for connection is "conn".

For readability I think it's important to have an abbreviation for small scopes especially tiny ones like this lambda.

// For shutdown signal in integration tests
pub static CLEANUP_SIGNAL: (Mutex<bool>, Condvar) = (Mutex::new(false), Condvar::new());

pub fn setup_r(args: &Vec<String>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to trust that nothing changed in here beyond moving it from interface.rs to console.rs 😄

@lionel- lionel- force-pushed the task/rename-interface branch from 72fa9d0 to 27acaae Compare February 2, 2026 15:08
@lionel- lionel- force-pushed the task/rename-interface branch from 27acaae to b655078 Compare February 2, 2026 15:20
@lionel- lionel- merged commit f7deecf into main Feb 2, 2026
7 of 8 checks passed
@lionel- lionel- deleted the task/rename-interface branch February 2, 2026 15:21
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants