It was surprisingly easy to get my stack based programming language to generate the file format of https://git.sr.ht/~rabbits/dotgrid by @neauoire
Implemented variable bindings (in one global dictionary) and graphics state (for now only a x,y position).
Alternative output device,
the interpreter now generates json files in the format used by my AxiDraw driver.
The "save" at the bottom looks weird because the lower part is getting clipped.
@l3kn 0___0
@l3kn pull dotgrid, I've replaced lineto to just line. I might implement lineto at some point which will use the latest point as a starting-off position. But for now, it's line, arc and bezier.
@neauoire Nice, I'll try out arcs next
@l3kn this feels soo good
@neauoire Thanks for making such a nice piece of software to play with, this is just what I needed after weeks of learning for exams!
@l3kn I'm very happy you like it. Would you likeit if I added point() so you can draw individual pixels?
@neauoire That would be great, maybe also filled rectangles?
@l3kn I love the way you've managed to incorporate braces with stack based stuff. I dig Forth conceptually, but the lack of code organization makes it tough to read for me (primarily C background)
@jefftime PostScript uses a similar syntax but
I didn't look up how it's implement internally yet.
Everything inside { ... } is treated similar to quoted list in Lisp, unquoting (pushing the contents on the stack and processing them) when looking up a variable value or when using if / ifelse / for.
@l3kn AAAAAH that's so pretty. Do you think I could use that on XXIIVV?
@neauoire Sure, here's the original bmp file: https://leonrische.me/files/dotgrid-render.bmp
@l3kn cheers :)
@l3kn the moiré effect on the circles when you move the image is interesting.
@l3kn I want a book of these.
@jameschip I'd like to get there at some point, normal PostScript would probably be a better fit for it.
For now I'm working through the list of features I'd like to have in my language, then try to make a minimal image to test the new ones.
If you DM me your address I can send you some of the A4 drafts,
I might take a while to get to that though.
@l3kn I love this so much
@nasser Thanks! I really like these kinds of single-purpose programming languages and for some reason including the source code adds a lot to it. It's a bit like a puzzle, trying to relate elements of the code to elements of the picture
Ellipse test