Nice project! At Guardsquare, we have a similar project: <a href="https://github.com/Guardsquare/proguard-assembler" rel="nofollow">https://github.com/Guardsquare/proguard-assembler</a><p>One of the things we use it for is testing: we can craft specific bytecode sequences that we want to test; for example, it's useful to test cases we've seen in the wild (e.g. obfuscated code) or to create a test that doesn't rely on a specific compiler/version.<p>An example of using the assembler from a ProGuard unit test <a href="https://github.com/Guardsquare/proguard/blob/master/base/src/test/kotlin/proguard/util/ProguardAssemblerTest.kt" rel="nofollow">https://github.com/Guardsquare/proguard/blob/master/base/src...</a>
I had a lot of fun doing this, and along the way I learned a lot about writing Gradle and IntelliJ plugins, and I hope others might find this fun too :)
Very cool! Reminds me of a little toy (and very unfinished) project I worked on almost a decade ago (jeez, can't believe it's been that long): <a href="https://github.com/dvx/jssembly" rel="nofollow">https://github.com/dvx/jssembly</a><p>Even our syntax is somewhat similar, though you're using plugins for cleaner code which is an awesome idea.
This is awesome.<p>I have been toying with writing my own little JVM language (for education purposes) and this could go a long way to making that a bunch easier.<p>Thanks for sharing!
My question (if I may), When people say the bytecode is "platform independent" I ask, exactly what platform is it being freed from?<p>The compiler?
The "cloud"?<p>And this goes back to my lack of understanding of what "publishing" a package means to Oracle and the ecosystem in general.<p>If I publish something on Maven, my guess is that it is transformed into bytecode directly, so that when I pull my package from a diff device the code can run.
In this case if the entire "internet" collapses then the only way to run my code would be a flashdrive with the .java file run via a compiler... unless there is a machine that has the JVM installed WITHOUT the compiler... THEN the bytecode is useful... Am I correct?
These are the type of posts that make some of us noobs feel like imposters, lol. (been coding webstack-ish for 10 years, fwiw, can't even begin to write an assembler though :shrug:)<p>Good on you though, we need inspiration too! And you definitely should feel great about pulling that off! I am imaging it must have been some really fantastic "flow" time! How did you feel while writing it? Did you have family or friend distractions? Did you feel super focused? What is that story?<p>What are some of your focus patterns that you have identified? What gets you motivated when you feel stuck?
I enjoyed reading about doing some things with the jvm which are not possible through the java language - can anyone recommend a page that goes further into that concept?
Looks like a fun project. One thing i'd be interested in, is if it's slower than using javac, given that the JIT can optimize common idioms that the compiler spits out. For instance, for some JITs, in the past anyway, This code<p>int myNumber = getANumber();
String s = "" + myNumber;<p>was faster to run than<p>int myNumber = getANumber();
String s= String.valueOf(myNumber);<p>even though the bytecode for the second bit of code is a proper subset of the first. (Meaning the first section had all the byte code of the second, plus some extra stuff.)<p>And yet the first ran faster than the second. So unless you've got some spectacularly tricky algorithm that you can naturally express in java, and can in jasm, i'm betting the javac output will be as fast or faster.<p>Again tho, i'm not criticizing the author for doing this project at all. Kudos!
Groovy version of this but based off Jasmine: <a href="https://github.com/renatoathaydes/Grasmin" rel="nofollow">https://github.com/renatoathaydes/Grasmin</a>
Brilliant, much better than having to use heavy and clunky tools like recaf or jbytemod, or one-off java projects with ow2 ASM to create custom classes.
Why not Jasmin?<p>Congrats on publishing your application. If this was something more than self-education please sell the benefits over Jasmin in your README? Looking forward to having a play with it.
"Let's just get this out of the way, shall we?<p>{code here}
"<p>Thanks for doing that; I can't stand it when I go to a site for something new and can't find what it actually looks like without digging around.
"With my recent scaling-back of the rosco_m68k project that’s been getting all my free time for the past couple of years, I needed a fun project to do during my time off, and I ideally wanted to take a break from Motorola 68k assembly and electronics and do something different."<p>All of your free time is consumed in programming?<p>Isn't it a bit absurd to have your entire life revolve around programming?