News for hackers. Stuff that matters.

armorer

Show HN: RedDragon, LLM-assisted IR analysis of code across languages

https://github.com/avishek-sen-gupta/red-dragon

RedDragon is an experiment in building a compiler pipeline that analyses code (malformed / without dependencies / unknown language) across ~15 languages through a single 27-opcode IR, with LLM fallbacks. The design question: where exactly can LLMs enter a compiler pipeline?RedDragon has three specific insertion points:- LLM as an alternative compiler frontend. For languages without a built-in...

( Read More... | no comments | on HN )
RedDragon is an experiment in building a compiler pipeline that analyses code (malformed / without dependencies / unknown language) across ~15 languages through a single 27-opcode IR, with LLM fallbacks.

The design question: where exactly can LLMs enter a compiler pipeline?

RedDragon has three specific insertion points:

- LLM as an alternative compiler frontend. For languages without a built-in parser, the LLM receives a formal IR spec (all 27 opcodes, lowering templates, worked examples) and translates source to IR directly. No language-specific code needed. This works for Haskell, Elixir, Perl — anything with parseable source.

- LLM for syntax repair. When the parser hits a parse error in malformed source, an LLM fixes the broken spans and the system re-parses. The repair is constrained to syntactic fixes; the LLM doesn't change what the code does.

- LLM as runtime resolver. When the VM hits a call to a function that doesn't exist in the IR (e.g., requests.get()), an LLM can produce plausible return values and side effects, so that execution continues through incomplete code.

All three are optional. When code is complete and well-formed, the pipeline makes zero LLM calls. When an LLM fails at any point, the system falls back to symbolic placeholders and keeps going.

This is a work in progress.

Show HN: Tape/Z – a toolkit for analysing z/OS assembler (HLASM) code

https://github.com/avishek-sen-gupta/tape-z

Tape/Z is an evolving toolkit for analysing mainframe (z/OS) HLASM (High Level Assembler) code. The library provides capabilities for working with mainframe assembler code, including parsing, control flow graph building, dependency tracing, and flowchart visualisation capabilities. Check it out at https://github.com/avishek-sen-gupta/tape-zSibling to Cobol-REKT...

( Read More... | no comments | 2 points | on HN )
It's not a crazy idea. For example, Amazon's BluAge offering does automatic translation. However, frequently, forward engineering teams do not want a 1:1 translation of the code, because that might end up reproducing the same system organisation of the original Cobol base (in a modern language), and engineers/architects usually want to work on a new design (while maintaining the original domain logic). So far, this library does not step into the forward engineering territory, and tries to merely provide useful information/artifacts, which could help the reverse engineering teams move (hopefully) faster, but obviously there is a lot of experimentation / inference that can be done on top of the extracted data.
Yes, there's a lot of it kicking around. This evolved from a personal testbed to iterate on ideas to apply on actual legacy code modernisation work I've been involved in.

Show HN: COBOL-REKT, a toolkit for analysing and reverse-engineering COBOL

https://github.com/avishek-sen-gupta/cobol-rekt

This is an evolving toolkit of capabilities helpful for analysing and reverse engineering legacy Cobol code. Currently, the following capabilities are available:- Program / Section-level flowchart generation based on AST (SVG or PNG) - Parse Tree generation (with export to JSON) - Control Flow Tree generation (with export to JSON) - Allows embedding code comments as comment nodes in the graph -...

( Read More... | 49 comments | 31 points | on HN )