Pārlūkot izejas kodu

More clarification on thule

Getty Ritter 9 gadi atpakaļ
vecāks
revīzija
848b974c68
2 mainītis faili ar 42 papildinājumiem un 1 dzēšanām
  1. 3 0
      scraps/idea--thule
  2. 39 1
      scraps/idea--thule-alternatives

+ 3 - 0
scraps/idea--thule

@@ -10,6 +10,9 @@ content: |
   to sidestep many of the problems with other computer UI systems. In
   particular, it builds on top of a relatively simple UNIX substrate,
   without trying to reinvent _too_ much elsewhere.
+
+  It consists of a protocol more than an implementation, so that it is
+  easy to reimplement elsewhere in many forms.
 related:
   - name: idea--thule-architecture
     why: The basic architecture

+ 39 - 1
scraps/idea--thule-alternatives

@@ -1,5 +1,43 @@
 id: 'idea--thule-alternatives'
-content: tbd
+content: |
+  The big alternative I know of is
+  [termkit](https://github.com/unconed/TermKit), which is an interesting
+  experiment: but, to me, it's filled with far too many special cases
+  and not enough nice primitives. For example, there's a special
+  way of outputting a list of files (e.g. output from `ls`) but this
+  isn't because "files" are necessarily a distinct thing, but because
+  there's a special type of output for `ls`-like commands (in this
+  case, `application/json; schema=termkit.files`, which corresponds
+  to a list of filenames.)
+
+  Thule builds on top of this by having a standard set of building
+  blocks, so that you no longer have the special-case "list of files",
+  but rather primitive building blocks like `list`s and `file`s.
+  Consider the output from `wc`: this also contains file references,
+  but it additionally contains a table mapping those to values. In
+  a TermKit-like setting, you'd have to come up with a new schema
+  (say, `application/json; schema=termkit.wordcount`) that understands
+  which parts of the output are files and which aren't.
+
+  Thule aims to pull those low-level building blocks out, so the
+  output from `ls` might give you a collection like
+
+  ~~~~
+  (set (file "/tmp/foo.txt") (file "/tmp/bar.c"))
+  ~~~~
+
+  and the output from `wc` will give you
+
+  ~~~~
+  (table ("lines" "words" "characters" "file")
+    ((int 10) (int 30) (int 300)  (file "/tmp/foo.txt"))
+    ((int 20) (int 60) (int 900)  (file "/tmp/bar.c"))
+    ((int 30) (int 90) (int 1200) (text "total")))
+  ~~~~
+
+  Both of these would not be displayed in a raw way by the shell, but
+  rather the structure of the collections would be a hint to the
+  shell on how to display them in a rich way.
 related:
   - name: idea--thule
     why: The high-level idea