From 40c3513bbe612621669749c4e3f6e46c00c41403 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:50:54 +0530 Subject: [PATCH 01/20] Support package-named single-file modules --- src/runtime/sys.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/runtime/sys.c b/src/runtime/sys.c index 67de00b..9e26a09 100644 --- a/src/runtime/sys.c +++ b/src/runtime/sys.c @@ -482,6 +482,21 @@ char *sys_resolve_module(const char *path) main_file); free(main_file); } + /* + * Also support a single-file package named after + * itself, e.g. levenshtein/levenshtein.fl. + */ + if (found == NULL) { + size_t need_named = strlen(dir_main) + 1 + + pathlen + 3 + 1; + char *named = malloc(need_named); + if (named != NULL) { + snprintf(named, need_named, "%s/%s.fl", + dir_main, path); + found = pkg_candidate(named); + free(named); + } + } if (found == NULL) { size_t need2 = strlen(dir_main) + 4; From e6f620767001b49763ba80fd72d121386aa54917 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:50:57 +0530 Subject: [PATCH 02/20] Support package-named single-file modules --- rust/flintlang/c-src/src/runtime/sys.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rust/flintlang/c-src/src/runtime/sys.c b/rust/flintlang/c-src/src/runtime/sys.c index 67de00b..9e26a09 100644 --- a/rust/flintlang/c-src/src/runtime/sys.c +++ b/rust/flintlang/c-src/src/runtime/sys.c @@ -482,6 +482,21 @@ char *sys_resolve_module(const char *path) main_file); free(main_file); } + /* + * Also support a single-file package named after + * itself, e.g. levenshtein/levenshtein.fl. + */ + if (found == NULL) { + size_t need_named = strlen(dir_main) + 1 + + pathlen + 3 + 1; + char *named = malloc(need_named); + if (named != NULL) { + snprintf(named, need_named, "%s/%s.fl", + dir_main, path); + found = pkg_candidate(named); + free(named); + } + } if (found == NULL) { size_t need2 = strlen(dir_main) + 4; From e4172d929a33e13baf0719a99d318566a3a8a2e1 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:50:59 +0530 Subject: [PATCH 03/20] Test imports from package-named single-file modules --- tests/pkg_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pkg_test.sh b/tests/pkg_test.sh index 7d1d2d6..e0e99c4 100644 --- a/tests/pkg_test.sh +++ b/tests/pkg_test.sh @@ -123,7 +123,7 @@ cat > "$WORK/gitsrc/flint.toml" <<'EOF' name = "shout" version = "0.3.0" EOF -cat > "$WORK/gitsrc/main.fl" <<'EOF' +cat > "$WORK/gitsrc/shout.fl" <<'EOF' export fn loud(who) { return "HEY " + who } @@ -158,7 +158,7 @@ expect "git import works" "HEY zed" "$("$FLINT" use.fl 2>&1)" pin=$(sed -n '/^commit = /s/commit = "\(.*\)"/\1/p' flint.lock) expect "lock pins a 40-char commit" "40" "${#pin}" -cat > "$WORK/gitsrc/main.fl" <<'EOF' +cat > "$WORK/gitsrc/shout.fl" <<'EOF' export fn loud(who) { return "LOUDER " + who } From 42a1414731e8d052172fbbcf0fe69604d5373fc9 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:54:56 +0530 Subject: [PATCH 04/20] Prepare 0.14.0 version metadata and release notes --- rust/flintlang/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/flintlang/Cargo.toml b/rust/flintlang/Cargo.toml index a7ea071..1e9fcc3 100644 --- a/rust/flintlang/Cargo.toml +++ b/rust/flintlang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flintlang" -version = "0.13.2" +version = "0.14.0" edition = "2021" description = "Safe Rust embedding of the Flint scripting language runtime" license = "MIT" @@ -14,4 +14,4 @@ name = "flintlang" path = "src/lib.rs" [dependencies] -flintlang-sys = { version = "0.13.2", path = "../flintlang-sys" } +flintlang-sys = { version = "0.14.0", path = "../flintlang-sys" } From 58fd2f4ab60e9b0d3ef64c045c60e8014b379b3f Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:54:59 +0530 Subject: [PATCH 05/20] Prepare 0.14.0 version metadata and release notes --- rust/flintlang-sys/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/flintlang-sys/Cargo.toml b/rust/flintlang-sys/Cargo.toml index 5702f8f..f9b01d0 100644 --- a/rust/flintlang-sys/Cargo.toml +++ b/rust/flintlang-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flintlang-sys" -version = "0.13.2" +version = "0.14.0" edition = "2021" description = "Safe Rust bindings over the Flint native C ABI" license = "MIT" From e2b2a31b3b366946cf4c062510aa29817709cf4b Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:55:01 +0530 Subject: [PATCH 06/20] Prepare 0.14.0 version metadata and release notes --- rust/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 9fed3ae..322437f 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -4,11 +4,11 @@ version = 4 [[package]] name = "flintlang" -version = "0.13.2" +version = "0.14.0" dependencies = [ "flintlang-sys", ] [[package]] name = "flintlang-sys" -version = "0.13.2" +version = "0.14.0" From 4237f4c211343f07407503f66acce5e5cf9fb676 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:55:04 +0530 Subject: [PATCH 07/20] Prepare 0.14.0 version metadata and release notes --- rust/examples/rust-native/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/examples/rust-native/Cargo.lock b/rust/examples/rust-native/Cargo.lock index 54e7f95..f88eda4 100644 --- a/rust/examples/rust-native/Cargo.lock +++ b/rust/examples/rust-native/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "flintlang-sys" -version = "0.13.2" +version = "0.14.0" [[package]] name = "rust-native" From 23cfeaceeed1ff3d9b9c59cad7ced4567c15016e Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:55:06 +0530 Subject: [PATCH 08/20] Prepare 0.14.0 version metadata and release notes --- rust/examples/tui-native/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/examples/tui-native/Cargo.lock b/rust/examples/tui-native/Cargo.lock index 0e11b1f..9b4bb66 100644 --- a/rust/examples/tui-native/Cargo.lock +++ b/rust/examples/tui-native/Cargo.lock @@ -382,7 +382,7 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flintlang-sys" -version = "0.13.2" +version = "0.14.0" [[package]] name = "fnv" From fb195fd64f5889048d2403eb2af757accb20523e Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:55:10 +0530 Subject: [PATCH 09/20] Prepare 0.14.0 version metadata and release notes --- rust/flintlang/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/flintlang/README.md b/rust/flintlang/README.md index c0eaef4..067d6c1 100644 --- a/rust/flintlang/README.md +++ b/rust/flintlang/README.md @@ -4,7 +4,7 @@ Safe, idiomatic embedding of the [Flint scripting language](https://github.com/p ```toml [dependencies] -flintlang = "0.13.2" +flintlang = "0.14.0" ``` ```rust @@ -44,8 +44,8 @@ builds target mingw-w64, matching the rest of the project. ## Versions -This crate versions in lockstep with the language: `flintlang 0.13.2` -embeds Flint 0.13.2. The `flintlang-sys` version tracks the wrapper, and +This crate versions in lockstep with the language: `flintlang 0.14.0` +embeds Flint 0.14.0. The `flintlang-sys` version tracks the wrapper, and the ABI version (`FL_ABI_VERSION`, currently 1) tracks the C header independently — a new function does not change it, a changed layout does. From 05a59e7742dbc1dacfd518a97bb82b379a1a333b Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:55:13 +0530 Subject: [PATCH 10/20] Prepare 0.14.0 version metadata and release notes --- rust/flintlang-sys/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/flintlang-sys/README.md b/rust/flintlang-sys/README.md index 90196fc..bb4bf20 100644 --- a/rust/flintlang-sys/README.md +++ b/rust/flintlang-sys/README.md @@ -33,7 +33,7 @@ later; the host roots retained handles against the collector. ## Versions -`flintlang-sys 0.13.2` binds ABI version 1; `abi_version()` asks the +`flintlang-sys 0.14.0` binds ABI version 1; `abi_version()` asks the host at run time, which is the check that decides whether a module loads. The reviewed header copy lives in `c-api/`. From 49cee91980e8a608859d6e2698e970aabb5e706d Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:55:15 +0530 Subject: [PATCH 11/20] Prepare 0.14.0 version metadata and release notes --- RELEASES.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 7be710d..6965d5f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,18 @@ # releases +## v0.14.0 + +- Package imports now resolve a package-named single-file module such as + `flint_modules/levenshtein/levenshtein.fl`, in addition to the existing + `main.fl` and flat-module layouts. This fixes `import levenshtein` for + packages that publish a same-named module file. +- Keep the C runtime and the Rust-embedded C source in sync. +- The Git dependency package test now covers a package whose entry file is + named after the package. + +Release validation is pending; do not publish artifacts until the full +`make validate` gate and supported-platform CI have passed. + ## v0.13.2 native modules load through `import` -- no subcommand, no loader From 721263264b15d8b1a9d51556910b685d56ead484 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:56:01 +0530 Subject: [PATCH 12/20] Keep release versioning separate from package resolver fix --- rust/flintlang/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/flintlang/Cargo.toml b/rust/flintlang/Cargo.toml index 1e9fcc3..a7ea071 100644 --- a/rust/flintlang/Cargo.toml +++ b/rust/flintlang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flintlang" -version = "0.14.0" +version = "0.13.2" edition = "2021" description = "Safe Rust embedding of the Flint scripting language runtime" license = "MIT" @@ -14,4 +14,4 @@ name = "flintlang" path = "src/lib.rs" [dependencies] -flintlang-sys = { version = "0.14.0", path = "../flintlang-sys" } +flintlang-sys = { version = "0.13.2", path = "../flintlang-sys" } From 99c9b57533e63811fccdb14b513cb9d396b7e3e9 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:56:05 +0530 Subject: [PATCH 13/20] Keep release versioning separate from package resolver fix --- rust/flintlang-sys/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/flintlang-sys/Cargo.toml b/rust/flintlang-sys/Cargo.toml index f9b01d0..5702f8f 100644 --- a/rust/flintlang-sys/Cargo.toml +++ b/rust/flintlang-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flintlang-sys" -version = "0.14.0" +version = "0.13.2" edition = "2021" description = "Safe Rust bindings over the Flint native C ABI" license = "MIT" From 28b5557113d7f331fac1ac883293829ca78a4378 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:56:08 +0530 Subject: [PATCH 14/20] Keep release versioning separate from package resolver fix --- rust/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 322437f..9fed3ae 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -4,11 +4,11 @@ version = 4 [[package]] name = "flintlang" -version = "0.14.0" +version = "0.13.2" dependencies = [ "flintlang-sys", ] [[package]] name = "flintlang-sys" -version = "0.14.0" +version = "0.13.2" From ddf75ce36f420e8edb1fef6cb2ddabcc6664d8b4 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:56:10 +0530 Subject: [PATCH 15/20] Keep release versioning separate from package resolver fix --- rust/examples/rust-native/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/examples/rust-native/Cargo.lock b/rust/examples/rust-native/Cargo.lock index f88eda4..54e7f95 100644 --- a/rust/examples/rust-native/Cargo.lock +++ b/rust/examples/rust-native/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "flintlang-sys" -version = "0.14.0" +version = "0.13.2" [[package]] name = "rust-native" From 88249ecb1a54529a4ee795d66e67ed74369f959d Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:56:13 +0530 Subject: [PATCH 16/20] Keep release versioning separate from package resolver fix --- rust/examples/tui-native/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/examples/tui-native/Cargo.lock b/rust/examples/tui-native/Cargo.lock index 9b4bb66..0e11b1f 100644 --- a/rust/examples/tui-native/Cargo.lock +++ b/rust/examples/tui-native/Cargo.lock @@ -382,7 +382,7 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flintlang-sys" -version = "0.14.0" +version = "0.13.2" [[package]] name = "fnv" From 8903941cbd5772f4ea2f8cf02e5bc78bbe30a187 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:56:16 +0530 Subject: [PATCH 17/20] Keep release versioning separate from package resolver fix --- rust/flintlang/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/flintlang/README.md b/rust/flintlang/README.md index 067d6c1..c0eaef4 100644 --- a/rust/flintlang/README.md +++ b/rust/flintlang/README.md @@ -4,7 +4,7 @@ Safe, idiomatic embedding of the [Flint scripting language](https://github.com/p ```toml [dependencies] -flintlang = "0.14.0" +flintlang = "0.13.2" ``` ```rust @@ -44,8 +44,8 @@ builds target mingw-w64, matching the rest of the project. ## Versions -This crate versions in lockstep with the language: `flintlang 0.14.0` -embeds Flint 0.14.0. The `flintlang-sys` version tracks the wrapper, and +This crate versions in lockstep with the language: `flintlang 0.13.2` +embeds Flint 0.13.2. The `flintlang-sys` version tracks the wrapper, and the ABI version (`FL_ABI_VERSION`, currently 1) tracks the C header independently — a new function does not change it, a changed layout does. From 7832d361fc91d1d27403efe784bfe4a5b0d5524e Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:56:27 +0530 Subject: [PATCH 18/20] Keep release versioning separate from package resolver fix --- RELEASES.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 6965d5f..7be710d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,18 +1,5 @@ # releases -## v0.14.0 - -- Package imports now resolve a package-named single-file module such as - `flint_modules/levenshtein/levenshtein.fl`, in addition to the existing - `main.fl` and flat-module layouts. This fixes `import levenshtein` for - packages that publish a same-named module file. -- Keep the C runtime and the Rust-embedded C source in sync. -- The Git dependency package test now covers a package whose entry file is - named after the package. - -Release validation is pending; do not publish artifacts until the full -`make validate` gate and supported-platform CI have passed. - ## v0.13.2 native modules load through `import` -- no subcommand, no loader From adf07916d91ccc6c783a338250b2dc55c4d15c5c Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:56:29 +0530 Subject: [PATCH 19/20] Keep release versioning separate from package resolver fix --- rust/flintlang-sys/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/flintlang-sys/README.md b/rust/flintlang-sys/README.md index bb4bf20..90196fc 100644 --- a/rust/flintlang-sys/README.md +++ b/rust/flintlang-sys/README.md @@ -33,7 +33,7 @@ later; the host roots retained handles against the collector. ## Versions -`flintlang-sys 0.14.0` binds ABI version 1; `abi_version()` asks the +`flintlang-sys 0.13.2` binds ABI version 1; `abi_version()` asks the host at run time, which is the check that decides whether a module loads. The reviewed header copy lives in `c-api/`. From 8b56b68287f7c9429997e5a5b226e2735d6c431a Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 10 Oct 2026 19:57:47 +0530 Subject: [PATCH 20/20] Document package-named module import resolution --- docs/packages.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/packages.md b/docs/packages.md index b330e5a..730dacb 100644 --- a/docs/packages.md +++ b/docs/packages.md @@ -81,29 +81,39 @@ installs; the next install records the hashes. `pkg list` output is unchanged. Each dependency lands in `flint_modules//` with its sources and -its own `flint.toml`: +its own `flint.toml`. A package can expose its default module as +`main.fl`, as a same-named file such as `levenshtein/levenshtein.fl`, +or as a flat `flint_modules/.fl` file. ```text flint_modules/ libfoo/ flint.toml - foo.fl + main.fl + levenshtein/ + flint.toml + levenshtein.fl ``` ## imports and resolution ```flint -import "libfoo/foo.fl" -print(foo.hello()) +import libfoo +print(libfoo.hello()) + +import levenshtein +print(levenshtein.distance("kitten", "sitting")) import "gitlib/g.fl" print(g.greet()) ``` -A quoted path with a `/` or a `.fl` extension is a file: relative to the -importing file, except `flint_modules/` is also searched, and packages -resolve before the standard library. A bare name (`import math`) is the -standard library. +A bare name first checks installed packages in `flint_modules/`: +`/main.fl`, then `/.fl`, then the flat +`.fl` layout. If no package matches, the standard library is +checked (so `import math` still imports the library). A quoted path with +a `/` or a `.fl` extension can address a file relative to the importing +file; package-internal paths are also resolved from `flint_modules/`. ## transitive dependencies