Version 0.2.2 Release - Import Resolution & Redundancy Fixes

This release fixes two issues with Hachi’s import capability, and increased convenience.

1. The Import Duplication Dilemma and Our Clean Fix

In earlier versions of Hachi, our transpiler would sometimes add the same header or import statement over and over again. This meant that if multiple parts of your Hachi code required the same dependency, the transpiler would attempt to include it several times, which caused breaking underlying namespace issues and definition errors.

So, What Was the Issue?

Every time a dependency was needed, our transpiler was simply outputting its import statement—without checking if it had already been added earlier.

How Did We Fix It?

We introduced a simple yet effective solution:

2. The Import Redundancy Challenge and Our Streamlined Fix

In earlier versions, importing a standard library file required you to specify both the folder and file name (for example, “fmt/fmt”). This was redundant since the folder and file shared the same name. We wanted to simplify your import statements so that you could simply write “fmt” and let Hachi figure out the rest.

What Was the Issue?

Hachi’s import logic was set up to look for a folder (like “fmt”) and then for a file inside that folder starting with the same name. This meant that you had to repeat “fmt” twice. While functional, it was unnecessarily verbose.

How Did We Fix It?

We updated the import resolution process to detect when an import string contains no forward slash. If you import “fmt”, Hachi now automatically constructs candidate paths by assuming the file resides in a folder named “fmt” and is named “fmt” with the appropriate extension (e.g., .8, .hachi, or .đŸș). If a match is found, the import succeeds—otherwise, the old relative path resolution kicks in.

This change lets you write cleaner, more concise import statements without sacrificing functionality.

Additional Changes

-Mike