3 ms·
I agree and think strong emphasis should be on how a knowledge base saves its files, which should be very interoperable. I build my own little DSLs and have my
by breck 6y ago
I agree and think strong emphasis should be on how a knowledge base saves its files, which should be very interoperable.
I build my own little DSLs and have my own experimental
knowledge base studio going, where I can edit things using
my editors (Sublime, VSCode and Vim), view/query/visualize
in my web browser, and also view/edit in a spreadsheet web
interface using Handsontable.
The secret trick is all the DSLs use a thing I work on
called Tree Notation (some use an even dumber version
simply called Grid Notation). It's a plain text notation
that just defines lists of words (aka cells) on a line (aka
a node or row) and if you indent a line it becomes a child
of the parent line (like python) providing support for tree
structures and scope. That's the basics, and then on top of
that you can design all sorts of DSLs with types and very
different parsing strategies than traditional languages.
For example, here's a Tree Language called Dumdown that
compiles to markdown or html:
https://jtree.treenotation.org/designer/#standard%20dumbdown https://jtree.treenotation.org/designer/#standard%20dumbdown
But that's still a relatively traditional language. I have
some languages which generally you want to use a spreadsheet
interface to write programs in, where you can just plop a
tree anywhere on the sheet, and then start writing trees.
Those ones are kind of like having a canvas for your project
instead of a folder with files. Makes for a good base for
building DSLs for simulations.
Sorry, I digress, but my purpose in bringing this up is that
if anyone is working on personal knowledge base software
like the OP, Tree Notation is a pretty useful thing, if you
can figure it out. I've got it figured out but not very good
at explaining it.
- ar-nelson 6y agoTree Notation looks very interesting. It also looks like just another version of S-expressions (but with indentation instead of parens). That's not a bad thing, though! S-expressions aren't used nearly as much as they should be, and indentation syntax can be much clearer than parens. What's most interesting is the language design DSL that makes it easy to put together a new tree language. I wonder if that can be implemented in Lisp, possibly with an indentation-sensitive syntax like Wisp[1] so that it retains most of Tree Notation's features. [1]: https://srfi.schemers.org/srfi-119/srfi-119.html https://srfi.schemers.org/srfi-119/srfi-119.html
- breck 6y agoYes! It's mostly S-Expressions! However, the magic happens when you remove the parens and go to 2 and 3 dimensions. Think of Javascript, which has 20 million users, versus Excel, which has 2 billion^1. To paraphrase Twain, removing one thing can be the difference between a lightning bug and lightning. [1] Numbers are approximate.
- ar-nelson 6y agoCould you give an example (or a link) that demonstrates this higher-dimensional syntax? Are there things you can express with it that couldn't be expressed in S-expressions?
- breck 6y ago> Are there things you can express with it that couldn't be expressed in S-expressions? No. But that may be like asking "is there something I can do with the x86 that I couldn't do with any Turing Machine?" Pragmatically speaking when you factor in UX and time there are things that are dramatically faster with Tree Notation versus S-Expressions. For example, here's the editing experience for an upcoming DSL to enable non-programmer researchers to put together topical exploratory data analysis tools: https://github.com/treenotation/random-demos/blob/main/Screen%20Recording%202020-12-21%20at%206.51.02%20AM.mov https://github.com/treenotation/random-demos/blob/main/Scree... Lots of things that are muscle memory to Excel users (drag to fill, copy/paste blocks, move columns and rows, et cetera), would be very ugly/hard to do if we were using paren based S-Expression notation.
- RickS 6y agoThis is awesome. I just finished with a more narrowly scoped and probably worse version of something very similar – in JS/TS no less. Looking forward to digging deeper into this later.
- Blahah 6y agoThis is fascinating. Don't suppose you'd be willing to share your dsl definitions, or can recommend any collections? Seems like a great layer to have in a modular knowledge system.
- breck 6y agoA few of them are out there in the wild. I definitely hope to share more in the future but at the moment busy focusing with the team on a huge refactor of our codebase at the day job (which includes a fun new DSL editable in a spreadsheet). When we ship that and I take a breather hope to give the Tree Notation stuff a refresh and publish some of the newer langs.
- warpech 6y agoJust saw https://www.youtube.com/watch?v=vn2aJA5ANUc https://www.youtube.com/watch?v=vn2aJA5ANUc. It looks great! I am excited that Handsontable works for you in this context. Please let me know if you'd need any help with it.