Hacker Newsnew | past | comments | ask | show | jobs | submit | joas_coder's commentslogin

public class Hello {

    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);
    }
}


How does a UAF never compile without whole program lifetime and alias analysis?


Ironwood performs closed-world, whole-program allocation-identity, alias, escape, and liveness analysis at final link.

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.


Whats to stop frees in the wrong place ?


Ironwood is an interesting project: a Java-like, object-oriented language that compiles AOT to native executables, without a JVM, JIT, garbage collector, raw pointers, or Rust-style ownership.

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?


How close it to Java ? The documentation shows a lot of similarity but I need to investigate for non-trivial projects. There is a lot of Java software that can be ported. But it all boils down on how close it is. The closer, the less porting effort.

We definitely need something like this.


This resonates with an adjacent problem I’ve been exploring: durable project provenance rather than live-session portability. I’m building PromptSourceCode for Codex Desktop; it preserves the human requests, corrections, and attachments as readable local history alongside the project: https://github.com/ironwood-lang/prompt-source-code. It deliberately doesn’t try to translate or resume sessions across agents. Does Skillsync expose stable session and turn identifiers that an external audit history could reference after translation?


can you explain what you mean by turn identifiers? It does allow you to audit the sessions and build your own systems on top after translation


Strongly agree. Ironwood (https://github.com/ironwood-lang/ironwood) takes that to the limit by throwing away the JVM :) The static type is the tag, so nothing is tagged at runtime. Primitives are machine-width values, references are one pointer, and generics specialize in the closed world, so the language has no boxing at all.

> 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.


Umm, Java/JVM has mostly static typing (if you discount the generic mess) but regardless Java/JVM computations has no type-tags for values (vtables for object types however).

This discussion is mostly in relation to dynamically typed languages such as JS (Not Java), Python,etc.

And unless the language was initially designed for static typing it's not always applicable to mix in discussions of static typing (I literally wrote my thesis on the subject of type inference).


> Now with containers, running Java apps in containers isn't great because of that JVM layer.

Funny, Ironwood (https://github.com/ironwood-lang/ironwood) explores exactly this space: familiar Java programming without JVM startup, warmup, or GC.


And a quick YouTube short video on how to put the app on auto-pilot so that you don't have to do anything to have your screenshots receive meaningful names: https://youtube.com/shorts/8bxhBgJvp7M


Thanks for the feedback. I did not know my Mac had an on-device Apple Foundation model. Is it multimodal? I'll be checking it out and comparing it with Google Gemma 4. I thought Apple was out of the AI model race.

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.


It's not as powerful as Gemma 4, but I think they likened it to GPT-3. It's perfectly capable of looking at images and classifying them at the level you'll need for this app. And it runs everything on the Apple Neural engines, so decently quick. Of course, this assumes that your users are using Apple Silicon processors, I believe that's the limitation – and they must have enabled Apple Intelligence which downloads the model at that point.


For anyone who wants to see the workflow before downloading the large app bundle, here’s a short demo: https://www.youtube.com/watch?v=QIt2H_CUYBM


You can find all the results and code in our GitHub repository => https://github.com/coralblocks/CoralBench?tab=readme-ov-file...


Is there a summary somewhere, i.e. what are the overall conclusions from the measurement results?


It will be hard to make a final conclusion. It is more of a research exercise to learn. All we can say is that as the code stands right now Java JIT is faster than C++ clang AOT for this simple map implementation. And all the code, compilation scripts, executions scripts, details, etc. are available in our GitHub so that other people can execute and play with these benchmarks in their own environment, to draw their own conclusions.

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


It's not about a "final conclusion", just about a summary of the measurement results at hand. Instead of letting the user to trawl through a lot of documents and figures and make geomean and factors calculations him/herself, the author who publishes measurement results should do this. Here is an example how this could look: https://github.com/rochus-keller/Oberon/blob/master/testcase.... It is immediately recognizable how much less time on average the C++ implementation used compared to the reference (LuaJIT in this case).


I see your point. Sorry about that. Your given example looks very cool. We'll try to do something like that. For now, you can see the results here: https://gist.github.com/coralblocks/21523d73f460924874685f11...

Or on GitHub: https://github.com/coralblocks/CoralBench?tab=readme-ov-file...


It would be interesting to compile the C++ with PGO (it should catch up with JIT)


I agree it would be interesting and a fun project! Correct me if I'm wrong, but the problem with PGO is that every time the code changes the PGO needs to be updated as well. Also, my past experience with PGO (for the GraalVM native-image) is that it improves a bit, but not much. Maybe 50% at best. But again, the only way to know for sure is to do it and measure it. That's something we should definitely dig deeper to see what kind of difference (in practice) it can make.


I thought they were trustworthy but I can be wrong. Where is the screaming text in what site that you are referring to?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: