21 karma · joined Nov 28, 2024 (1y ago) · 59 submissions
comment 2mo ago · link · parent
This is difficult in the general case, but Ironwood makes it tractable through ahead-of-time compilation, a closed world of reachable code, and conservative method summaries. It does not need to infer every object’s lifetime perfectly. It only needs to prove that each explicit free is safe.
If aliases, call effects, or control flow make that proof uncertain, the compiler rejects the free. The programmer must then restructure the code or omit free, in which case the allocation remains until process termination. This is intended as the conservative fallback, not the normal outcome for straightforward, compiler-provable ownership patterns.
After an accepted free, any later use is also rejected. This approach may increase compilation work, but it provides memory safety without runtime ownership tracking.
comment 2mo ago · link · parent
public static void main(String[] args) {
Chatter chatter = new Chatter();
String text = "Hello " + chatter.getWord() + "!";
System.out.println(text);
free text; // destroy object and reclaim the memory
free chatter; // destroy object and reclaim the memory
// System.out.println(chatter); // use after free NEVER compiles
}
}// OR:
public class Hello {
public static void main(String[] args) {
Chatter chatter = new Chatter();
defer free chatter;
String text = "Hello " + chatter.getWord() + "!";
defer free text;
System.out.println(text);
}
}comment 2mo ago · link · parent
Unlike GraalVM Native Image, which takes existing Java bytecode and packages the required Java runtime components into a native executable, Ironwood is a separate language designed from the start around native execution and explicit compiler-enforced safe memory management.
It uses LLVM, like Rust and Zig, so the native code produced can be very fast. It has a "defer" keyword for deferred cleanup, like Zig.
What do you think of the idea?
4.
What do you think of a Java-like language that compiles to native code?(github.com ↗)
2 points · by joas_coder · 2mo ago · 7 comments
comment 2mo ago · link · parent
comment 2mo ago · link · parent
> If it's not your first rodeo in compilers, IMHO just design your runtime primarly for register-passable values from day one, it might feel like premature optimization, but since the value model will permeate so much of the runtime, the knock-on effects once you do decide to fix it probably makes it worth to go with it from day 1.
Day one, definitely. Those were cheap to fix only because the value model never had to change.
comment 2mo ago · link · parent
Funny, Ironwood (https://github.com/ironwood-lang/ironwood) explores exactly this space: familiar Java programming without JVM startup, warmup, or GC.
comment 5mo ago · link · parent
comment 5mo ago · link · parent
The idea is to ship more powerful lightweight free models as they become available. I'm looking forward to Gemma 5!
> The biggest concern for an app like this is how much RAM you end up using trying to run it
You are totally right. A new feature for a future version would be to turn off the model when the app is idle. And only launch it next time the user takes a screenshot. It is a trade-off between latency to generate the names and memory RAM.
comment 5mo ago · link · parent
11.
Show HN: I made a Gemma 4 Mac app that names screenshots with local AI(snapname.app ↗)
7 points · by joas_coder · 5mo ago · 6 comments
comment 1y ago · link · parent
comment 1y ago · link · parent
Or on GitHub: https://github.com/coralblocks/CoralBench?tab=readme-ov-file...
comment 1y ago · link · parent
There is also an ongoing discussion on SO => https://stackoverflow.com/questions/79268109/c-implementatio...
The GitHub for the project is at https://www.github.com/coralblocks/CoralBench
comment 1y ago · link · parent
16.
Java (JIT) vs C++ (AOT) for a simple hash table(github.com ↗)
4 points · by joas_coder · 1y ago · 8 comments