Nilo
Written by AI so you can code by hand.
A small language for generative art. A model builds it. I draw with it. This is the record of how it is being made, in order.
plate(1920, 2400)
random layout
background(#f4f1ea)
for i in 0 ..< 200 {
let p = vec(layout.float(0 ..< 1920), layout.float(0 ..< 2400))
circle(p, layout.float(4 ..< 40))
fill(#1b1b1f)
}
Journal
- 1 Written by AI so you can code by hand I am making a small language for generative art. A model builds it. I draw with it.
- 2 Why not just use JavaScript? Nilo compiles to JavaScript, so why not write JavaScript in the first place.
- 3 One real layer A test on real work: one layer of a finished piece, rewritten in Nilo and checked stroke for stroke.
- 4 The first libraries Noise, colour and one brush, written in Nilo itself, and the first new piece made with them.
- 5 Curves, gradients and groups Three things the language could not say: a smooth curve, a blend of colour, and a set of marks treated as one.
- 6 One command How I know a change to the compiler has not quietly broken everything else.
- 7 Moving the compiler The compiler is written in Dart. It is going to be rewritten in Go, and this is why.
- 8 One kind of list Nilo had two ways to hold many things. Now it has one, and it cost nothing.
- 9 The compiler, in Go The compiler is now in Go and the Dart one is gone. Every build comes out the same, byte for byte, and the tests themselves were checked.
- 10 Teaching the tests to change The tests can now take a new right answer, after showing me what changed. Making that safe took far longer than planned, and the work found the compiler drawing the wrong art without a word.
- 11 The first one bare Calls in Nilo now give the first value bare and name the rest. I first wanted every value named, and changed my mind when I saw it on real lines.