I guess there's some history there that I'm not familiar with because JBoss also has a FernFlower decompiler library https://mvnrepository.com/artifact/org.jboss.windup.decompil...
Show HN: I wrote a Java decompiler in pure C language
71–80 of 104 posts
Re: Show HN: I wrote a Java decompiler in pure C language
#72Earlier quoted context omitted.
We need people who can (and do) write in C, assembly, and all these low-level languages. Otherwise, software will just get slower and slower.
Rust has the same low-level memory model as C without the footguns.
Re: Show HN: I wrote a Java decompiler in pure C language
#73Earlier quoted context omitted.
But for example verifying that memory is not touched after it is supposed to, is much harder when you can't rely on it being freed. Of course literally running valgrind is still possible, but it is difficult to get useful information.
You cannot have use-after-free if you never call free, so there are no points at which memory should not be touched. That's the beauty of the never free memory management strategy.
Re: Show HN: I wrote a Java decompiler in pure C language
#74Can you also write a C decompiler in pure Java language?
Re: Show HN: I wrote a Java decompiler in pure C language
#75Very cool project! Love the idea of a Java decompiler written in C — the speed must be great. Any plan to support `.dex` in the future? Also curious how you handle inner classes inside JARs.
I am writing the part of decompiling dex and apk. The current speed is about 10 times faster than that of Java, and it takes up less resources than Java. And the compiled binary is smaller, only about 300k. Thank you for your attention.
I was hoping that these days' Java would be "almost" as fast C/C++. Oh well.
Re: Show HN: I wrote a Java decompiler in pure C language
#76Earlier quoted context omitted.
Many command line tools do not need memory management at all, at least to first approximation. Free nothing and let the os cleanup on process exit. Most libraries can either use an arena internally and copy any values that get returned to the user to the heap at boundaries or require the user to externally create and destroy the arena. This can be made ergonomic with one macro that injects an arena argument into func…
That might be true, but leaking is neither the critical nor the most hard to find memory management issue, and good luck trying to adapt or even run valgrind with a codebase that mindlessly allocates and leaks everywhere.
Re: Show HN: I wrote a Java decompiler in pure C language
#77I cannot help but wonder why starting a new project in C in 2025. It’s like driving a car with no seat belts. You sure you want to do that?
And, yes, I know it's trivial to interface the Python C-API with C++ and quite often better as the 'object model' is very similar but the underlying concept I wanted to explore (guaranteed tailcalls) isn't possible in C++ from what I can tell.
Re: Show HN: I wrote a Java decompiler in pure C language
#78Earlier quoted context omitted.
Rust has the same low-level memory model as C without the footguns.
Rust certainly does have some improvements, but I'm not 100% certain that it's the best tool for all low-level software. For example, I'm experimenting with Rust for some filesystem type code and I can't figure out how to write/read a struct to/from disk all at once. I'm brand new to Rust, so it's quite possible that it can be done and I just don't know the technique. Basically, I'm looking for something in Rust anal…
Re: Show HN: I wrote a Java decompiler in pure C language
#79Earlier quoted context omitted.
Rust certainly does have some improvements, but I'm not 100% certain that it's the best tool for all low-level software. For example, I'm experimenting with Rust for some filesystem type code and I can't figure out how to write/read a struct to/from disk all at once. I'm brand new to Rust, so it's quite possible that it can be done and I just don't know the technique. Basically, I'm looking for something in Rust anal…
I think you're going to want to reach for serde. Its a bit of annotating but you can then de/serialize structs to arbitrary formats with one call.
Re: Show HN: I wrote a Java decompiler in pure C language
#80You've used GPL2 code taken from git (hashmap.c) in your Apache 2.0 project. https://opensource.stackexchange.com/questions/10737/inclusi...
Do you have a scanner that checks these sorts of things or is it something that you are passionate about?