Search code examples
javajvmoolong

What is Oolong in terms of JVM?


I'm reading "Programming for Java Virtual Machine" by Joshua Engel book where the author offers "an assembly language for JVM" called Oolong.

As far as I understand this is the language which is compiled into java bytecode and which is really similar to the original java bytecode(big number of bytecode opcodes are used there). If it's so then why is it called assembly language? Is that because it's low-level language and looks like a bytecode?

Another question is about Jasmin. As Wikipedia says it's "a free open source assembler to create class files from human readable assembler-like syntax using the Java Virtual Machine instruction sets". The syntax of Jasmin files(which also have .j extension) looks like Oolong's syntax. Is it used there?


Solution

  • Joshua Engel's Oolong1 is an assembly language for the JVM.

    ... why is it called assembly language?

    You are best off looking up what "assembly language" means in (for example) Wikipedia. It is essentially a language that has a direct one-to-one mapping2 between "statements" and machine instructions for the target machine. OOlong matches this description, if you view the JVM as the target machine. (There is a one-to-one mapping between Oolong statements and JVM bytecode instructions.)

    The syntax of Jasmin files(which also have .j extension) looks like Oolong's syntax. Is it used there?

    I've seen sources that say that Oolong's syntax is "based on Jasmin", but I can't find any stand-alone documents describing the syntax in any detail.

    If you are interested in looking at Oolong, this SO question has details on where to download it from:


    1 - There is another unrelated Oolong programming language; see https://github.com/thesquaregroot/oolong. And then there is Castegren & Wrigstad's OOlong: An Extensible Concurrent Object Calculus.
    2 - I am oversimplifying. Some assembly languages support "macros" where a single source statement can map to multiple target instructions. Read the Wikipedia reference.