3 ms·
2-D syntax everywhere. It's a 2-dimensional binary. Suddenly the intermediate layers between binary and the higher level langs we work with day in and day out h
by breck 5y ago
2-D syntax everywhere. It's a 2-dimensional binary. Suddenly the intermediate layers between binary and the higher level langs we work with day in and day out have the same form.
For example, 2d langs for HTML, CSS, JSON, others:
https://jtree.treenotation.org/designer/ https://jtree.treenotation.org/designer/
A 2D lang that replaces Markdown: http://scroll.pub/ http://scroll.pub/
You can have 2D langs for TCP/IP, DNS, HTTP, et cetera. A grid is all you need.
I figured the math out 8 years ago, https://medium.com/space-net https://medium.com/space-net, and slowly getting there. Still in early days, but good annual growth rate. I'd be surprised if it doesn't happen. The math makes too much sense.
- dmos62 5y agoI don't follow. Can you elaborate? What is 2-D syntax?
- breck 5y ago1D syntax assumes a linear pass from beginning to end across the bytes of a program to build the AST. You have concepts like brackets and parens and quotation marks and colons. 2D languages have none of those. They imagine all programs as laid out on a grid. Think of a spreadsheet. For trees, you use indentation. There is not a single computer language in all the world that cannot have it's semantics represented with just that 2D syntax. This realization has long fascinated me. It knocks me off my feet, the same way I feel about binary notation. Here is a talk I gave in 2017 about 1D vs higher D languages: https://www.youtube.com/watch?v=ldVtDlbOUMA https://www.youtube.com/watch?v=ldVtDlbOUMA Here is a video that makes the connection between programming languages and spreadsheets clearer: https://www.youtube.com/watch?v=0l2QWH-iV3k https://www.youtube.com/watch?v=0l2QWH-iV3k
- neolog 5y agoAre you related to https://www.tree-annotation.org/ https://www.tree-annotation.org/ ?
- breck 5y agoNo, but this is really interesting! Thank you so much for sharing! I obviously have quite a passion for the idea that there's a universality to Tree Structures and some fundamental simple notation we are stumbling towards, so interesting to see others with that! This page (https://www.tree-annotation.org/blog/no-escape.html https://www.tree-annotation.org/blog/no-escape.html) is close to one of the benefits, but it turns out you don't need any escape characters at all! Simply indentation let's you have blocks that cut and paste naturally with no escaping.
- herbst 5y agoWhat is making Scrolldown more 2d than markdown? Is it just the extendibility? The intends? I don't think I fully understand your concept I also noticed your example grammar often contains a lot of js code. So it's not intended as different language but as data model with built in JavaScript? Kinda like a more modern XSLT?
- breck 5y ago> What is making Scrolldown more 2d than markdown? Is it just the extendibility? You hit the nail on the head. The extendibility is the key thing. In Scrolldown every little piece of content is in its own little scope. It's like every block is it's own little file written in one of many different grammars. These all compose effortlessly. This is the early days, but I expect there to be thousands of little "micro-grammars" for use by people using Scroll. For example, you might have a microgrammar for making flow charts, or making interactive observablehq/worrydream/jupyter like documents, or quick sims, or blueprints, or audio content, or slide shows. It's sort of like web components done right. > I also noticed your example grammar often contains a lot of js code. The idea with Grammar is to keep refining the language and hoisting as many patterns into pure 2D/Tree languages as possible. But I have to use resources judiciously, and strike a balance between research and deliverables. Folks have started Tree Notation implementations in languages like Kotlin and Swift, and when/if there turns out to be a need to have something like a Kotlin Grammar interpreter, then at the time it would make sense to iterate on Grammar so the `javascript` blocks are instead a DSL. You can see that is a bit in progress with the `compiler` nodes; but have gone with the hacky `javascript` bits in many places just for pragmatic reasons. > So it's not intended as different language but as data model with built in JavaScript? Kinda like a more modern XSLT? Grammar started out as a POC but evolved into something pretty practical. Sort of an ANTLR for 2D languages. But sometimes I still just hard code the parser/compiler for a language from scratch. They are generally pretty simple.