Hi all,
Announcing Terse.jl (release pending in General)!
I found myself wanting a succinct syntax for building complex type hierarchies for two reasons: 1) working on complex hierarchies myself, and 2) understanding quickly how Claude code is approaching a problem (It also saves you a few precious tokens in your 1M context window).
You can probably immediately guess what the following creates:
using Terse
@types Shape > (
TwoDimensional > (
Circle(radius::Float64 = 1.0),
Rectangle(width::Float64 = 1.0, height::Float64 = 1.0),
Triangle(base::Float64, height::Float64)
),
@mutable ThreeDimensional > (
Sphere(@const(radius::Float64); hollow::Bool = false),
Cube(@const(side::Float64); hollow::Bool = false),
Prism > (
TriangularPrism(base::Float64, height::Float64),
Cylinder(radius::Float64 = 1.0; height::Float64 = 1.0)
)
)
)
Check it out and let me know what you think!