“Code Generation” Tagged Pages

Mixing Hand-Written, Generating, and Generated Code with Koog

Revised on
Created on

Some days ago I released a little code generation utility that I have been using for well over a year in cranking out repetitive C++ code. Koog is—for lack of a better established term—a mixed-code generator. It is similar to other tools of its kind (such as Cog), but the only one that I know of that uses the Scheme language for specifying what code to generate. The concept of mixed-code generation is simple.

Read more…

Koog

Revised on
Created on

Koog is a mixed-code generation tool. It supports a choice of comment styles (C-style block comments by default), and assumes that code-generation directives are written in Racket. Koog provides a Racket API, a command-line interface, and editor integration for Emacs and Vim. The one novel feature it has (compared to existing mixed-code generators) is the option of only (re)generating individual code regions, which provides more control when used interactively in an editor.

Read more…