← Back to context

Comment by pshirshov

3 days ago

Btw, working on Java 7 support. At this moment I sorta have working Java 7 compiler targeting Java 6 bytecode (Java 7 has StackMapTable which is sort of annoying).

Also, I've tried to replace parser with a modern one. Claude succeeds in generating Java 8 parsers with various parser generators/parser combinators but fails to resolve extremely tight coupling.

what is the feasibility/crazyness level of "llm porting" the javac source code to c++ ?

setting copyright issues aside, javac is a pretty clean textual-input-output program, and It can probably be reduced to a single thread variant

  • Claude won't handle a project of that scale. Even with Java 7 modernization project, which is much simpler than full javac translation, I constantly hit context limits and Claude throws things like "API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.3.content.76: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."},"request_id":"req_011CVWwBJpf3ZrmYGkYZLQVf"}" at me.

looking at the "att" branches (excuse my unhealthy curiosity) I can only say - "jesus fucking christ".

from the old parser ast -> to json -> to new ast representation (that is basically again copy of the old one) -> to some new incomplete bytecode generation

im sure there is some good explanation, but....why?! :)

  • I've been looking for a way to decouple legacy parser from the rest of the compiler, plus create a way to dump parser output in a readable form. Unfortunately, the coupling is too tight there. In my own compilers all the outputs of all the phases are serializable.

    In the end I've just reanimated the original parser generator and progressed to full Java 7 syntactically (-att5 branch), but there are some major obstacles with bytecode.

    • i thought it might be something like this (still a weird overkill), but if you are effectively replacing the parser with new peg and replacing the backend with something new - then there is nothing left - just start from scratch :)

      1 reply →