bikeshed icon indicating copy to clipboard operation
bikeshed copied to clipboard

Explore interest in KGT (railroad diagram generator) as an alternative railroad diagram DSL

Open mikesamuel opened this issue 7 months ago • 4 comments

Regarding § 14 Railroad Diagrams

Diagrams are described by a custom DSL that somewhat resembles Python.

If there's interest in using ABNF and other traditional grammar syntaxes, katef/kgt also generates SVG railroad diagrams from those input formats.

As an example, below is an excerpt of a date time example and the laid out diagram.

ABNF of RFC 5322
; date and time format taken from RFC 5322.
; https://tools.ietf.org/html/rfc5322#section-3.3

date-time       =   [ day-of-week "," ] date time [CFWS]

day-of-week     =   ([FWS] day-name) / obs-day-of-week

day-name        =   "Mon" / "Tue" / "Wed" / "Thu" /
                    "Fri" / "Sat" / "Sun"

date            =   day month year

day             =   ([FWS] 1*2DIGIT FWS) / obs-day

month           =   "Jan" / "Feb" / "Mar" / "Apr" /
                    "May" / "Jun" / "Jul" / "Aug" /
                    "Sep" / "Oct" / "Nov" / "Dec"

...
Image

mikesamuel avatar May 27 '25 22:05 mikesamuel

In theory I'm in favor of allowing more input formats (and especially happy to interoperate with one of Kate's tools!), but I need to support Python (and ideally JS...) while Kate's tools are written in C.

tabatkins avatar May 27 '25 23:05 tabatkins

practically, would providing a wasm binary help? i'm forever unsure how to package this kind of thing

katef avatar May 28 '25 09:05 katef

Yeah. If python native modules are acceptable, what would you want to see? A PyPi package with Environment::WebAssembly or some other environment classifiers?

mikesamuel avatar May 28 '25 14:05 mikesamuel

practically, would providing a wasm binary help? i'm forever unsure how to package this kind of thing

Unsure. I'd need to experiment to see what it would mean for me to invoke a wasm tool in Bikeshed. Don't do any work on my regard unless/until I can confirm this makes sense.

tabatkins avatar Jul 08 '25 21:07 tabatkins