My highly domain-specific FoC project, the Digital...
# devlog-together
k
My highly domain-specific FoC project, the Digital Scientific Notation I called Leibniz, is finally in a state where I think others can explore it without being lost immediately: https://github.com/khinsen/leibniz-pharo
Leibniz is a notation for digital scientific models and methods, but it is not a programming language. It is meant to be used in scientific articles, textbooks, PhD theses etc., with the goal of rendering all the formal parts machine-readable and explorable with computer tools. Those tools remain to be designed and written.
Its implementation in Glamorous Toolkit may be of interest to some here as well, just as an example of what can be done in that environment.
k
Your description here sounds tantalizing, but I'm having trouble connecting it up (just by reading) with the description in your link. What parts of this screenshot are your notation? They seem like regular math notation. Or is Leibniz a machine-readable representation of math notation?

https://raw.githubusercontent.com/khinsen/leibniz-pharo/master/screenshot.png

k
Everything shown in blue or magenta is Leibniz code. It looks similar to math notation, and it is meant to be used in the same way: embedded into prose. But it is machine-readable and, more importantly, has precisely defined and useful semantics via equational logic. Another difference is that there is an algorithmic aspect in the form of a term rewriting engine. The idea is that you can express both traditional equations and the specifications and algorithms of purely computational models. It remains to be seen how far this will go.
Fresh of the press: a conversation with @Tudor Girba about Leibniz and its implementation on top of Glamorous Toolkit:

https://www.youtube.com/watch?v=f10NpsMmbis

t
This is some impressive work!
k
I'm halfway through this video now, and am able to answer my earlier question to my own satisfaction. Leibniz is a markup language like html, markdown or Latex. As we have learned to expect, the markup can be rendered to a prettier form using some sort of rendering engine. In addition, however, the markup language includes affordances for performing side-effect-free computation. For example:
Copy code
{{2/4}}
will look the same, but:
Copy code
{{2/4; withNormalForm="yes"}}
will look like
1/2
when rendered. (Ignoring syntax because I don't actually know what I'm talking about.) Very cool!
k
Markup language with side-effect free computation is a good summary for Leibniz from language/semantics point of view.
t
That describes what one can do with it, indeed. But what I found more fascinating is the custom tools that help one develop and extend Leibniz itself. What is the name for that? 🙂
k
That was actually my main personal discovery in the process of developing Leibniz. I started out with a first implementation in Racket. I had a Scheme background, and Racket has a lot of support for developing languages, so it seemed like a good choice. And if you consider development tools a separate subject, as most of us do, it is. Implementing my first design of Leibniz in Racket (using Emacs as my IDE) was a good experience overall. But improving on the initial design, iteratively, turned out to be very frustrating. I had two nested edit-compile-run cycles, one for Racket and one for Leibniz, and no other tools than print statements for looking at the internal data structures of my implementation. That was way too cumbersome to handle. When I discovered Pharo (by accident), I immediately saw that a live environment is what I wanted. So I started my second implementation in Pharo, which at that time contained a precursor of today's Glamorous Toolkit that was already very useful. Since then it only got better. My current point of view is: you can't design a language without in parallel developing an IDE for that language. And that becomes an important criterion for choosing a platform.