Skip to content

Commit 10196bd

Browse files
hiiboltclaude
andcommitted
fix: show update notice before program output, add changelog
Moves the version update notice to appear between transpilation and program execution so it doesn't interrupt output. Refactors CLI main to extract common transpilation logic. Adds CHANGELOG.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent df0b985 commit 10196bd

3 files changed

Lines changed: 76 additions & 36 deletions

File tree

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Changelog
2+
3+
All notable changes to Rosy are documented here. Versions follow [Semantic Versioning](https://semver.org/).
4+
5+
## [0.3.1] - 2026-03-20
6+
7+
### Fixed
8+
- Update notice now appears between transpilation and program output instead of after program output
9+
10+
### Changed
11+
- Refactored CLI main to extract common transpilation logic before Run/Build dispatch
12+
13+
## [0.3.0] - 2026-03-20
14+
15+
### Changed
16+
- **Docs overhaul**: all module docs rewritten with user-intent "Looking for something?" navigation tables
17+
- **Module reorganization**: operators grouped into `arithmetic/`, `comparison/`, `unary/`, `collection/`; math functions grouped into `trig/`, `exponential/`, `complex/`, `rounding/`, `vector/`, `query/`, `memory/`
18+
- README slimmed to showcase + install, pointing users to the full Rustdoc reference
19+
20+
## [0.2.0] - 2026-03-20
21+
22+
### Added
23+
- CI workflow (`cargo check` + tests on every push/PR)
24+
- Version-gated docs and release workflows (trigger on `Cargo.toml` version changes, not tags)
25+
- Auto-injected version in rustdoc header via `env!("CARGO_PKG_VERSION")`
26+
- Semver versioning with `semver` crate
27+
- Background update check against GitHub releases (warns if a newer version exists)
28+
- GitHub Actions release workflow (builds Linux x86_64, macOS x86_64, macOS aarch64)
29+
- Colored step-by-step transpiler progress output (`[1/5] Parsing...`, etc.)
30+
- Real-time cargo build output piping (no more silent compilation)
31+
- `rosy --version` flag
32+
- Install docs: `cargo install --path rosy`, GitHub Releases, NIU Metis MPI instructions
33+
34+
## [0.1.0] - 2026-03-20
35+
36+
Initial release with core language support.
37+
38+
### Language Features
39+
- 7 base types: `RE`, `ST`, `LO`, `CM`, `VE`, `DA`, `CD`
40+
- Multi-dimensional arrays
41+
- 13 binary operators with full type compatibility
42+
- 40+ intrinsic functions (trig, exponential, complex, rounding, vector, query, conversion, string)
43+
- 13 intrinsic procedures (SCRLEN, CPUSEC, QUIT, OS, DA operations, linear algebra, etc.)
44+
- Control flow: `IF`/`ELSEIF`/`ELSE`, `LOOP`, `WHILE`, `PLOOP` (MPI), `BREAK`
45+
- `FUNCTION` and `PROCEDURE` definitions with recursion
46+
- File I/O: `WRITE`, `READ`, `OPENF`, `CLOSEF`, binary I/O
47+
- `FIT` optimization loop
48+
- Differential Algebra: `OV`, `DA(n)`, `CD(n)`, `DAPRV`, `DAREV`
49+
- Optional MPI support via `PLOOP`

rosy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rosy"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
edition = "2024"
55

66
[dependencies]

rosy/src/main.rs

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -323,19 +323,33 @@ fn main() -> Result<()> {
323323

324324
let cli = Cli::parse();
325325

326-
match cli.command {
327-
Commands::Run {
328-
source,
329-
output_dir,
330-
release,
331-
cosy_syntax,
332-
} => {
333-
syntax_config::set_cosy_syntax(cosy_syntax);
334-
let binary_path = rosy(&source, output_dir, release)?;
326+
// Extract common fields and transpile
327+
let (source, output_dir, release, cosy_syntax, output_name) = match &cli.command {
328+
Commands::Run { source, output_dir, release, cosy_syntax } => {
329+
(source.clone(), output_dir.clone(), *release, *cosy_syntax, None)
330+
}
331+
Commands::Build { source, output, output_dir, release, cosy_syntax } => {
332+
let name = output.clone().unwrap_or_else(|| {
333+
source.file_stem()
334+
.and_then(|s| s.to_str())
335+
.unwrap_or("rosy_output")
336+
.to_string()
337+
});
338+
(source.clone(), output_dir.clone(), *release, *cosy_syntax, Some(name))
339+
}
340+
};
341+
342+
syntax_config::set_cosy_syntax(cosy_syntax);
343+
let binary_path = rosy(&source, output_dir, release)?;
344+
345+
// Show update notice after transpilation (network has had time)
346+
update_handle.finish();
335347

348+
// Run or copy the binary
349+
match cli.command {
350+
Commands::Run { .. } => {
336351
eprintln!("{BOLD}{CYAN} Running{RESET} {}\n", source.display());
337352

338-
// Run the binary, piping stdout and stderr
339353
let status = Command::new(&binary_path)
340354
.status()
341355
.with_context(|| format!("Failed to run binary at `{}`!", binary_path.display()))?;
@@ -345,28 +359,8 @@ fn main() -> Result<()> {
345359
status.code()
346360
);
347361
}
348-
349-
Commands::Build {
350-
source,
351-
output,
352-
output_dir,
353-
release,
354-
cosy_syntax,
355-
} => {
356-
syntax_config::set_cosy_syntax(cosy_syntax);
357-
let binary_path = rosy(&source, output_dir, release)?;
358-
359-
// Determine output name
360-
let output_name = output.unwrap_or_else(|| {
361-
source
362-
.file_stem()
363-
.and_then(|s| s.to_str())
364-
.unwrap_or("rosy_output")
365-
.to_string()
366-
});
367-
368-
// Copy binary to PWD
369-
let destination = PathBuf::from(&output_name);
362+
Commands::Build { .. } => {
363+
let destination = PathBuf::from(output_name.unwrap());
370364
std::fs::copy(&binary_path, &destination)
371365
.context("Failed to copy binary to current directory")?;
372366
eprintln!(
@@ -376,8 +370,5 @@ fn main() -> Result<()> {
376370
}
377371
}
378372

379-
// Show update notice if a newer version was found
380-
update_handle.finish();
381-
382373
Ok(())
383374
}

0 commit comments

Comments
 (0)