Quick
index
main
eev
eepitch
maths
angg
blogme
dednat6
littlelangs
PURO
(C2,C3,C4,
 λ,ES,
 GA,MD,
 Caepro,
 textos,
 Chapa 1)

emacs
lua
(la)tex
maxima
 qdraw
git
lean4
agda
forth
squeak
icon
tcl
tikz
fvwm
debian
irc
contact

A REPL for learning SVG (with a variant of eepitch; 2026)

1. Installing and testing
2. Some demos
2.1. The demo in svg.el
2.2. A first way of using groups
2.3. A demo for clipPath
2.4. Porting ideas from Pict2e and Dednat to SVG
3. What is the objective of this?
4. Hacking with low self-esteem
5. Homework
6. From Codeberg
7. Accusations

First version of this page: 2026aug02.
Announcements: eev mailing list (preliminary), help-gnu-emacs.
My old notes about SVG from 2022 are here.


1. Installing and testing

This is a work in progress that is still in a very early stage, and that at this moment consists of six files. If you have a notion of what are eev, eepitch and test blocks you can try esvg - a.k.a. "eepitch-svg" - by installing eev (recommended way: "with a sexp"), and running the eepitch block below. Note that it uses bullets, that are equivalent to red stars, and that the lines with `'s are comments with elisp hyperlinks, and some of them point to demos...

 (eepitch-shell)
 (eepitch-kill)
 (eepitch-shell)
rm -Rv /tmp/esvg/
mkdir  /tmp/esvg/
cd     /tmp/esvg/
wget https://anggtwu.net/elisp/esvg-show.el
wget https://anggtwu.net/elisp/esvg-eepitch.el
wget https://anggtwu.net/elisp/esvg-append.el
wget https://anggtwu.net/elisp/esvg-build.el
wget https://anggtwu.net/elisp/esvg-xy.el
wget https://anggtwu.net/elisp/esvg-demos.el
 (add-to-list 'load-path "/tmp/esvg/")
 (defun load-esvg () (interactive) (require 'esvg-xy))
 (code-c-d "esvg" "/tmp/esvg/" :anchor)
 (find-esvg "esvg-show.el")
 (find-esvg "esvg-eepitch.el")
 (find-esvg "esvg-eepitch.el" "demo-svg-el")
 (find-esvg "esvg-append.el")
 (find-esvg "esvg-build.el")
 (find-esvg "esvg-xy.el")
 (find-esvg "esvg-xy.el" "tricks-with-g-test-1")
 (find-esvg "esvg-demos.el")
 (find-esvg "esvg-demos.el" "demo-group-1")


2. Some demos

2.1. The demo in svg.el

The screenshots below are from 2026aug02:

The first one shows at the window at the right the very terse demo of svg.el that appears in its "Comments:" section. The second screenshot shows at the left my version of that demo, converted to a test block with lots of comments, and at the right the SVG that it creates, in three formats: SVG, Lisp, and XML. To watch that test block as a (very short) movie, click here: MP4.

The current version of this demo is here:

(find-esvg "esvg-eepitch.el" "demo-svg-el")


2.2. A first way of using groups

The screenshots below are from 2026aug13,

...and they show my first prototype that was able to handle groups correctly; the comments in the second screenshot below explain why I had to write an alternative to `svg--append'. To watch that test block as a short (36s) movie, click here: MP4.

The current version of this demo is here:

(find-esvg "esvg-demos.el" "demo-group-1")


2.3. A demo for clipPath

This one is based on https://www.fffuel.co/sssvg/#clippath, but REPL-ified. The screenshot below is from 2026aug15:

To watch that test block as a short (37s) movie, click here: MP4. The current version of this demo is here:

(find-esvg "esvg-demos.el" "demo-clippath-1")


2.4. Porting ideas from Pict2e and Dednat to SVG

In my presentation at the EmacsConf2023 I showed how I create my LaTeX diagrams using lots of small very hacky programs that I develop using REPLs and test blocks. Most of these hacky programs are written as extensions to Dednat6 (see its slides) that generate Pict2e code; the best example in the presentation appears at 29:59, and it uses Piecewise2.lua.

I'm now trying to generate diagrams similar to those ones using esvg.

  • The first screenshot below shows a modernized version of the demo at 29:59 from 2023. Note that it draws a `P'icture with a `G'rid, `A'xes, and `Ticks'; I usually abbreviate that as a "PGAT". The current version generates indented code for Pict2e by manipulating rectangles of text (see Pict4.lua), and the functions that generate the Pict2e code for grids, axes and ticks are methods of the PictBounds class, defined here. Again: remember that these programs are very hard to run if you are not me!
  • The second screenshot below, from 2026aug18, shows my first attempt to port this idea of "PGAT"s to SVGs. It draws a polyline on a grid.
  • The third screenshot, from 2026aug19, shows something far less trivial. It draws an "SBGAT", that is my abbreviation for an `S'VG with a white `B'ackground, a `G'rid, `A'xes, and `T'icks, and then a cubic spline and its control points. The first lines of its test block define words that perform operations like "append to" and "draw the SVG". To watch the test block of the third screenshot as a short (17s) movie, click here: MP4.
  • The fourth screenshot, from 2026aug21, shows some experiments with `g'. We first define a named group with three objects - a square and two circles - and then we redraw it in several places using `use'. Then in the "Second test" we do the same, but now with words for "create a named group" and "translate". To watch the test block of the fourth screenshot as a short (19s) movie, click here: MP4.
  • The fifth screenshot, from 2026aug25, that draws dots inside a parabola, was inspired by this demo of set comprehensions in Maxima. Note that this demo defines four functions whose names start with `dot'; nowadays most people would be happier by defining a single function there, but when we switch our brains to Forth mode then the four functions make more sense than one - our notion of happiness changes. To watch the test block of the fifth screenshot as a short (17s) movie, click here: MP4.

Here are links to the test blocks in the third, fourth and fifth screenshots:

(find-esvg "esvg-xy.el" "SBGAT-test-2")
(find-esvg "esvg-xy.el" "tricks-with-g-test-1")
(find-esvg "esvg-xy.el" "comprehension-test-1")




Warning: Some sections below this point are still in pre-draft stage!!!


3. What is the objective of this?

I read Jon Bentley's "Programming Pearls" in the 90s, before having had access to any Unix machines, and its p.139 is probably the page in Computer Science literature that blew my mind the most. It explains pipes with this example - a spelling checker:

prepare filename |     # remove formatting commands
 translit A-Z a-z |    # map upper to lower case
  translit ^a-z \n |   # remove punctuation
   sort |              # put words in alphabetical order
    unique |           # remove duplicate words
     common -2 dict    # report words not in dictionary

It is not a program that is useful in itself, but it presents a (new) way of connecting pieces - see the "orgy of one-liners" here -, it uses a well-chosen example, and it hides lots of implementation details that are hard to understand, like how the control is switched between the processes when enough input is ready.

Let me copy here three short excerpts from "The Evolution of Forth" (Rather, Colburn, Moore, 1996; ACM, PDF):

  • (p.630): After about two months, Rather began to realize that something extraordinary was happening: despite the incredibly primitive nature of the on-line computers, despite the weirdness of the language, despite the lack of any local experts or resources, she could accomplish more in the few hours she spent on the Forth computers once a week than in the entire rest of the week when she had virtually unlimited access to several large mainframes.
  • (p.633): Moore originally developed the system for his own use. It surprised him a little to find that Rather, and the other early users, also liked it and found it enhanced their productivity as much as it did his.
  • (p.646): People who have only seen or used limited public-domain Forth implementations often perceive that Forth itself is a toy.

Some of the demos above - in particular this one, in the section about Pict2e - are toy examples of an idea that is very big: "REPL-ifying". Consider, for example, forgetting and reconstructing; most mathematicians don't remember things exactly - they start from vague memories and reconstruct the rest...

This is from Michael Ham's "Factoring in Forth" (published in Dr. Dobb's Toolbook of Forth, vol.2, pp.45-60):

Veteran Forth programmers smile tolerantly at the novice's monster word and in its place produce two dozen tiny words. These words are typically bug-free, each being utterly simple, and they snap together like Lego blocks to build a command that efficiently accomplishes the same task as the beginner's awkward monster. Even better, the little words can be assembled in many ways and thus find many uses.

In my first attempts to learn SVG each element was like a "monster word": I would try to learn it, my mental buffer would overflow, and I would forget practically everything... but this started to change when I found ways to factor them into "little words" that were easy to test, and I could still understand them when I went back to my notes the next day.

The best way to discuss these techniques is via examples, by chat, by factoring other people's code, and by finding out where the difficulties are.

My main objective with this "REPL for SVG" thing is to discuss these things, in practice, on IRC.


4. Hacking with low self-esteem

My first plan with this project was to use it to discuss bigger problems, and it was going to say that REPL for SVGs is a particular case of "hacking with low self-esteem".

My self-esteem is usually very low, and things are getting worse because (...)


5. Homework


6. From Codeberg

From https://blog.codeberg.org/protecting-our-floss-commons-from-llms.html:

Collaboration at danger

It is not purely the digital and civic infrastructures that are impacted by the use of LLMs. The free/libre software ecosystem, of which we consider Codeberg an important part of, is a social phenomenon centered on collaboration. Working in this way is only possible thanks to free sharing and mutual learning. This includes even very small tools that are shared and re-used and around which collaboration can start out. In contrast, by adopting LLMs people tend to code single-use software from scratch. While this leads to an increase in 'shared' code, it is mostly code that not only has not been 'written' by anyone but is also not maintained by anyone.

(...)

Entering a vicious cycle

Together, these forces make collaboration not only harder but also less rewarding: With the transaction cost of collaboration increasing, people are becoming less likely to contribute to creating high-quality software projects and more likely to 'vibecode' a one-off software that is specific to your need, and won't evolve beyond. We get a vicious cycle where collaboration is becoming less and less rewarding, while the amount of single-use software that's unmaintained and never sees any improvements is going up.

Although often well intentioned, sharing the result of a prompt and calling it "libre software" does not make the world a better place. Codeberg is not and does not want to be a place to dump such generated single-use software that no one else will ever look at. We are a place for people to collaborate and improve software together. Within this context, the recent votes can be understood as a reconfirmation of those principles: As we want to center on human collaboration, we will not actively support or engage in the creation of LLMs and will not put our limited resources to use for storing single-use software that would pollute our FLOSS commons.


7. Accusations

I work in a bad campus of a good federal university in Brazil. In 2026mar11, two days after the classes had started, I was told - by a very embarassed secury guard - that there were orders forbidding me to enter the area of the campus... and I discovered that some of my colleagues had convinced some important people that I could be in the midst of a psychotic break, and they were afraid of what I could do - like killing people... My favorite way of describing that with few words is: I "became a psychopath".

The details are here, but they are all in Portuguese. The first time that I was able to write to tell that story in English was in 2026jul22, in the #emacs IRC channel, here:

<edrx> I'm having to sue some colleagues and I have very little
       mental energy left for technical things now.
<edrx> bertied: yep - 99% of the story is online, but it's all in
       Portuguese, and I haven't written a summary in English
       yet...
<edrx> bertied: here is a good starting point:
       https://anggtwu.net/2025-alguns-motivos-reginaldo.html
<edrx> basically they made lots of false accusations against me,
       made the university investigate those false accusations,
       ignored all the stuff that the judging commission produced
       showing that I was inoccent, made other false accusations,
       convinced some people that I could be planning to kill
       people, and asked the rector to forbid me to enter the
       university...

In that period - from 2026mar11 to 2026jul22 - practically every time that I thought about chatting on IRC my next thought was "I need a way to tell that story in English, but I don't have it", and I disappeared from IRC (and from mailing lists). =(

Here is a slightly longer version of the story:

In 2022 some of my colleagues started to make false accusations against me, and they opened a "processo administrativo" (a "PAD") against me. That PAD sort of ended in 2023 - with the judges declaring me inoccent... but in some technical senses it never ended, because its "relatório final" - a kind of final report/summary - was never produced... and then this same group of colleagues decided to ignore all the evidence that I was declared inoccent, and they convinced many other colleagues that I was very, very, very guilty. In 2025 I started to make some of the documents public, and in the 2026 I started to organize them in pages organized chronologically, like these ones: Reginaldo, Ana Isabel, Etel... and my colleagues panicked.

(Work in progress!)