changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > org > docs / ulang.org

changeset 5: bb51c61e4d4b
parent: 1c57e053f043
child: 713c22bdab6a
author: ellis <ellis@rwest.io>
date: Fri, 24 Nov 2023 22:39:07 -0500
permissions: -rw-r--r--
description: blog update
1 {{{header(ulang,
2 Richard Westhaver,
3 ellis@rwest.io,
4 The Universal Language)}}}
5 
6 This document describes a *U-Language* as described by the late great
7 Haskell Curry:
8 
9 #+begin_quote
10 Every investigation, including the present one, has to be communicated
11 from one person to another by means of language. It is expedient to
12 begin our study by calling attention to this obvious fact, by giving a
13 name to the language being used, and by being explicit about a few of
14 its features. We shall call the language being used the
15 U-Language. [...] There would be no point in calling attention to it,
16 if it were not for the fact that language is more intimately related
17 to our job than of most others.
18 #+end_quote
19 
20 * ulang
21 :PROPERTIES:
22 :CUSTOM_ID: 8447a560-7f77-45c7-bd14-2a2af6ad2abc
23 :END:
24 As the title suggest we refer to our *U-Language* as
25 ulang. When I say something along the lines of "Please refer to
26 [[Links][ulang:links]]", I am referencing the section named /Links/ of this
27 document.
28 
29 Each section of this document describes an element of the ulang. It is
30 recommended to skim through the top-level sections ([[Org-mode][Org-mode]] and
31 [[Elements][Elements]]) and review the element sub-headings as needed.
32 
33 #+TOC: headlines 3
34 
35 ** Org-mode
36 :PROPERTIES:
37 :CUSTOM_ID: 98a02bb2-3f39-49c6-898a-68ccd8f3cbe1
38 :END:
39 [[https://www.gnu.org/software/emacs/][GNU Emacs]] is our text editor, so naturally [[https://orgmode.org/][Org Mode]] is our
40 documentation engine.
41 
42 If you are already familiar with Emacs and org-mode, I recommend
43 opening the source file of this document in Emacs and following along.
44 
45 If not, I recommend browsing through the [[https://orgmode.org/worg/][Worg resources]], but we won't
46 be getting too deep into tribal hacker knowledge of Emacs. The choice
47 of Org is arbitrary and the concepts here would apply to other formats
48 (LaTeX, Markdown, etc).
49 
50 Let us first consider /Org the syntax/.
51 
52 Org syntax is much less popular than Markdown and lacks parsing
53 utilities in popular programming languages[fn:1]. Regardless, we are
54 committed to it as a foundation because it is the most hackable
55 documentation engine available. With enough experience you can morph
56 Org into whatever documentation system that is needed.
57 
58 [fn:1] The ecosystem is changing though, thanks to the dedication of
59 some excellent hackers: [[https://github.com/karlicoss/orgparse][python]], [[https://github.com/tecosaur/Org.jl][julia]]
60 
61 *** TODO organ
62 :PROPERTIES:
63 :CUSTOM_ID: 22474039-5c18-4179-82aa-a6731e6313a2
64 :END:
65 - State "TODO" from [2023-11-05 Sun 19:21]
66 
67 =Org-mode= the application depends on Emacs (it's written in Emacs
68 Lisp) but that doesn't mean we need to. To solve the issue of
69 interoperability between different systems, we are developing a tool
70 called [[https://lab.rwest.io/comp/core/-/tree/branch/default/lisp/lib/organ][organ]]. The purpose of =organ= is to provide an external API for
71 Org documents that doesn't depend on GNU Emacs.
72 
73 If we were designing a /personal/ note-taking system, I would argue
74 that we don't need this tool. The problem is it's /not/ personal - we
75 have a much wider intended audience and need to present information in
76 many different ways. This means thinking about hundreds to thousands
77 of documents instead of tens, about processing those documents into a
78 full-text search database, and reducing cost along the way.
79 
80 Emacs can do all of these things, but do you really want it to?
81 ** Elements
82 :PROPERTIES:
83 :CUSTOM_ID: 4aa3ec2a-b360-43ae-b2d8-f9735f211290
84 :END:
85 
86 *** Keywords
87 :PROPERTIES:
88 :CUSTOM_ID: 2cadda9a-22a3-4b42-ad4e-d7a774f74cba
89 :END:
90 The ulang *Keywords* are a superset of those defined by [[https://datatracker.ietf.org/doc/html/rfc2119][RFC-2119]]. The
91 definition of a keyword from the original spec is ultimately
92 unchanged:
93 
94 #+begin_quote
95 In many standards track documents several words are used to signify
96 the requirements in the specification. These words are often
97 capitalized. This document defines these words as they should be
98 interpreted in IETF documents. Authors who follow these guidelines
99 should incorporate this phrase near the beginning of their document:
100 
101 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
102 NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
103 "OPTIONAL" in this document are to be interpreted as described in
104 RFC 2119.
105 #+end_quote
106 
107 We can't be bothered to include these with every document, so here
108 they are - don't forget!
109 
110 #+begin_quote
111 1. MUST This word, or the terms "REQUIRED" or "SHALL", mean that the
112  definition is an absolute requirement of the specification.
113 
114 2. MUST NOT This phrase, or the phrase "SHALL NOT", mean that the
115  definition is an absolute prohibition of the specification.
116 
117 3. SHOULD This word, or the adjective "RECOMMENDED", mean that there
118  may exist valid reasons in particular circumstances to ignore a
119  particular item, but the full implications must be understood and
120  carefully weighed before choosing a different course.
121 
122 4. SHOULD NOT This phrase, or the phrase "NOT RECOMMENDED" mean that
123  there may exist valid reasons in particular circumstances when the
124  particular behavior is acceptable or even useful, but the full
125  implications should be understood and the case carefully weighed
126  before implementing any behavior described with this label.
127 
128 5. MAY This word, or the adjective "OPTIONAL", mean that an item is
129  truly optional. One vendor may choose to include the item because a
130  particular marketplace requires it or because the vendor feels that
131  it enhances the product while another vendor may omit the same item.
132  An implementation which does not include a particular option MUST be
133  prepared to interoperate with another implementation which does
134  include the option, though perhaps with reduced functionality. In the
135  same vein an implementation which does include a particular option
136  MUST be prepared to interoperate with another implementation which
137  does not include the option (except, of course, for the feature the
138  option provides.)
139 #+end_quote
140 
141 One of the important features of keywords is that we use them as Org
142 [[https://orgmode.org/manual/Workflow-states.html][Workflow states]]. You may use any of the keywords above or below as the
143 first word in a heading to signify a requirement or a workflow state:
144 
145 6. TBD A task to be done at a later date.
146 
147 7. TODO A task yet to be done.
148 
149 8. WIP Work In Progress task.
150 
151 9. NOTE Designates a note item.
152 
153 10. DRAFT Designates a draft item.
154 
155 11. DEAD Item that will not be completed.
156 
157 12. DONE Completed task.
158 
159 13. COMMENT A 'commented' item.
160 
161 *** Macros
162 :PROPERTIES:
163 :CUSTOM_ID: cdb4976b-1d0d-49df-bfb1-3dbd5d99590e
164 :END:
165 Several *global* [[https://orgmode.org/manual/Macro-Replacement.html][Org Macros]] are used throughout our documents. They are listed
166 here for convenience.
167 
168 #+name: ulang-macros
169 #+begin_src emacs-lisp :exports both :results pp
170  org-export-global-macros
171 #+end_src
172 
173 #+RESULTS: ulang-macros
174 : (("opts" . "#+OPTIONS: $1\n")
175 : ("header" .
176 : "#+TITLE: $1\n#+AUTHOR: $2\n#+EMAIL: $3\n#+DESCRIPTION: $4\n#+SUBTITLE: $4\n#+OPTIONS: ^:nil toc:nil num:nil html-postamble:nil\n#+HTML_HEAD: <link rel=\"stylesheet\" href=\"https://fonts.xz.style/serve/inter.css\"/>\n#+HTML_HEAD: <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.compiler.company/css/new.min.css\"/>\n#+HTML_HEAD: <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.compiler.company/css/night.css\"/>\n"))
177 
178 Macros /are not expanded/ in source files - you will see them in the
179 form ={{{NAME(ARGS)}}}=. You will need the relevant macro definition
180 (in =ulang.el=) in order to export ulang docs with the macros
181 expanded.
182 
183 *** Abbrevs
184 :PROPERTIES:
185 :CUSTOM_ID: b4c326ba-f74c-4409-9314-8d32df61fc5e
186 :END:
187 There are several 'abbrev' types made available via =ulang.el=. They
188 are intended for flexible templating and ease-of-use for the author.
189 
190 We try to align our abbrevs following categories:
191 - uri
192 - term
193 - phrase
194 - block
195 
196 Abbrevs may take arguments explicitly or inherit from their
197 environment, but usually /are expanded/ in source files.
198 
199 *** Links
200 
201 *** Timestamps