@fraczak/k 6.0.1 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/AGENTS.md +35 -0
  2. package/CHANGELOG.md +48 -0
  3. package/CLAUDE.md +64 -0
  4. package/DOCS/BIG_PICTURE.md +4 -8
  5. package/DOCS/BINARY_CODEC_STATUS_AND_TODO.md +74 -0
  6. package/DOCS/CONVERGENCE.md +92 -0
  7. package/DOCS/DIVERGENCE_DETECTION.md +24 -0
  8. package/DOCS/Makefile +99 -0
  9. package/DOCS/OBJECT_FILE_AND_PATTERN.md +217 -0
  10. package/DOCS/PATTERNS.md +114 -0
  11. package/DOCS/PATTERNS_AND_TYPED_VALUES.md +665 -0
  12. package/DOCS/REPL.md +125 -125
  13. package/DOCS/TEXTUAL_VALUES.md +108 -0
  14. package/DOCS/TYPE_DERIVATION.md +230 -0
  15. package/DOCS/book/06-values-in-memory.md +1085 -0
  16. package/DOCS/book/07-the-partial-function-abi.md +143 -0
  17. package/DOCS/book/08-operational-semantics-and-execution.md +201 -0
  18. package/DOCS/book/09-compiler-architecture.md +160 -0
  19. package/DOCS/book/10-from-ast-to-intermediate-representation.md +167 -0
  20. package/DOCS/book/14-canonical-serialization.md +176 -0
  21. package/DOCS/book/appendix-b-incorporating-external-predefined-types-and-functions.md +155 -0
  22. package/DOCS/book/overview.txt +68 -0
  23. package/README.md +71 -27
  24. package/codecs/README.md +8 -0
  25. package/codecs/pandoc.css +71 -0
  26. package/codecs/runtime/test-codec.mjs +89 -0
  27. package/package.json +2 -2
  28. package/{codecs/k-pattern.mjs → patterns/from-k.mjs} +3 -3
  29. package/repl2.mjs +259 -50
  30. package/scripts/generate-dependency-graph.mjs +121 -0
  31. package/test-repl2.mjs +55 -8
  32. package/DOCS/book-combined.html +0 -3798
  33. package/DOCS/book-combined.md +0 -3745
  34. package/DOCS/book-combined.pdf +0 -0
  35. package/DOCS/book-combined.tex +0 -5682
  36. package/DOCS/book.html +0 -65
  37. package/DOCS/book.pdf +0 -0
  38. package/DOCS/book.tex +0 -150
package/DOCS/book.html DELETED
@@ -1,65 +0,0 @@
1
- <div data-align="center">
2
- <pre><code> { } { }
3
- / \ {.lang name} |
4
- lang by --&gt; name
5
- | | |
6
- &#39;k&#39; &#39;wojtek&#39; &#39;k&#39;</code></pre>
7
- </div>
8
- <h1 id="the-k-language-book">The k-language Book</h1>
9
- <p>This book describes the k programming language - a minimal functional
10
- language for transforming tree-structured data using partial functions
11
- and algebraic data types.</p>
12
- <h2 id="table-of-contents">Table of Contents</h2>
13
- <ol type="1">
14
- <li><a href="book/01-introduction.md">Introduction</a></li>
15
- <li><a href="book/02-syntax-and-values.md">Syntax and Values</a><br />
16
- </li>
17
- <li><a href="book/03-types-as-finite-automata.md">Types as Finite
18
- Automata</a></li>
19
- <li><a href="book/04-partial-functions-and-composition.md">Partial
20
- Functions and Composition</a></li>
21
- <li><a href="book/05-typing-filters-and-normalization.md">Typing,
22
- Filters, and Normalization</a></li>
23
- <li><a href="book/06-values-in-memory.md">Values in Memory</a></li>
24
- <li><a href="book/07-the-partial-function-abi.md">The Partial Function
25
- ABI</a></li>
26
- <li><a href="book/08-operational-semantics-and-execution.md">Operational
27
- Semantics and Execution</a></li>
28
- <li><a href="book/09-compiler-architecture.md">Compiler
29
- Architecture</a></li>
30
- <li><a href="book/10-from-ast-to-intermediate-representation.md">From
31
- AST to Intermediate Representation</a></li>
32
- <li><a href="book/11-llvm-basics.md">LLVM Basics</a></li>
33
- <li><a href="book/12-code-generation.md">Code Generation</a></li>
34
- <li><a href="book/13-linking-and-execution.md">Linking and
35
- Execution</a></li>
36
- <li><a href="book/14-canonical-serialization.md">Canonical
37
- Serialization</a></li>
38
- <li><a href="book/15-optimization-and-folding.md">Optimization and
39
- Folding</a></li>
40
- <li><a href="book/16-toward-a-universal-schema-registry.md">Toward a
41
- Universal Schema Registry</a></li>
42
- </ol>
43
- <h2 id="appendices">Appendices</h2>
44
- <ul>
45
- <li><a
46
- href="book/appendix-a-implementing-a-prototype-compiler-in-python.md">Appendix
47
- A: Implementing a Prototype Compiler in Python</a></li>
48
- <li><a
49
- href="book/appendix-b-incorporating-external-predefined-types-and-functions.md">Appendix
50
- B: Incorporating External Predefined Types and Functions</a></li>
51
- </ul>
52
- <hr />
53
- <p><em>Note: This is the master file. Individual chapters are stored in
54
- the <code>book/</code> directory for easier editing and maintenance.
55
- Each chapter can be edited independently and the changes will be
56
- reflected when the individual files are viewed.</em></p>
57
- <h2 id="usage">Usage</h2>
58
- <ul>
59
- <li><strong>For reading</strong>: Click on any chapter link above to
60
- read individual chapters</li>
61
- <li><strong>For editing</strong>: Edit the individual chapter files in
62
- the <code>book/</code> directory</li>
63
- <li><strong>For publishing</strong>: Combine chapters as needed for
64
- different output formats</li>
65
- </ul>
package/DOCS/book.pdf DELETED
Binary file
package/DOCS/book.tex DELETED
@@ -1,150 +0,0 @@
1
- % Options for packages loaded elsewhere
2
- \PassOptionsToPackage{unicode}{hyperref}
3
- \PassOptionsToPackage{hyphens}{url}
4
- \documentclass[
5
- ]{article}
6
- \usepackage{xcolor}
7
- \usepackage{amsmath,amssymb}
8
- \setcounter{secnumdepth}{-\maxdimen} % remove section numbering
9
- \usepackage{iftex}
10
- \ifPDFTeX
11
- \usepackage[T1]{fontenc}
12
- \usepackage[utf8]{inputenc}
13
- \usepackage{textcomp} % provide euro and other symbols
14
- \else % if luatex or xetex
15
- \usepackage{unicode-math} % this also loads fontspec
16
- \defaultfontfeatures{Scale=MatchLowercase}
17
- \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
18
- \fi
19
- \usepackage{lmodern}
20
- \ifPDFTeX\else
21
- % xetex/luatex font selection
22
- \fi
23
- % Use upquote if available, for straight quotes in verbatim environments
24
- \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
25
- \IfFileExists{microtype.sty}{% use microtype if available
26
- \usepackage[]{microtype}
27
- \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
28
- }{}
29
- \makeatletter
30
- \@ifundefined{KOMAClassName}{% if non-KOMA class
31
- \IfFileExists{parskip.sty}{%
32
- \usepackage{parskip}
33
- }{% else
34
- \setlength{\parindent}{0pt}
35
- \setlength{\parskip}{6pt plus 2pt minus 1pt}}
36
- }{% if KOMA class
37
- \KOMAoptions{parskip=half}}
38
- \makeatother
39
- \setlength{\emergencystretch}{3em} % prevent overfull lines
40
- \providecommand{\tightlist}{%
41
- \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
42
- \usepackage{bookmark}
43
- \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
44
- \urlstyle{same}
45
- \hypersetup{
46
- pdftitle={k-language},
47
- pdfauthor={W. Fraczak},
48
- hidelinks,
49
- pdfcreator={LaTeX via pandoc}}
50
-
51
- \title{k-language}
52
- \author{W. Fraczak}
53
- \date{}
54
-
55
- \begin{document}
56
- \maketitle
57
-
58
- \begin{verbatim}
59
- { } { }
60
- / \ {.lang name} |
61
- lang by --> name
62
- | | |
63
- 'k' 'wojtek' 'k'
64
- \end{verbatim}
65
-
66
- \section{The k-language Book}\label{the-k-language-book}
67
-
68
- This book describes the k programming language - a minimal functional
69
- language for transforming tree-structured data using partial functions
70
- and algebraic data types.
71
-
72
- \subsection{Table of Contents}\label{table-of-contents}
73
-
74
- \begin{enumerate}
75
- \def\labelenumi{\arabic{enumi}.}
76
- \tightlist
77
- \item
78
- \href{book/01-introduction.md}{Introduction}
79
- \item
80
- \href{book/02-syntax-and-values.md}{Syntax and Values}\\
81
- \item
82
- \href{book/03-types-as-finite-automata.md}{Types as Finite Automata}
83
- \item
84
- \href{book/04-partial-functions-and-composition.md}{Partial Functions
85
- and Composition}
86
- \item
87
- \href{book/05-typing-filters-and-normalization.md}{Typing, Filters,
88
- and Normalization}
89
- \item
90
- \href{book/06-values-in-memory.md}{Values in Memory}
91
- \item
92
- \href{book/07-the-partial-function-abi.md}{The Partial Function ABI}
93
- \item
94
- \href{book/08-operational-semantics-and-execution.md}{Operational
95
- Semantics and Execution}
96
- \item
97
- \href{book/09-compiler-architecture.md}{Compiler Architecture}
98
- \item
99
- \href{book/10-from-ast-to-intermediate-representation.md}{From AST to
100
- Intermediate Representation}
101
- \item
102
- \href{book/11-llvm-basics.md}{LLVM Basics}
103
- \item
104
- \href{book/12-code-generation.md}{Code Generation}
105
- \item
106
- \href{book/13-linking-and-execution.md}{Linking and Execution}
107
- \item
108
- \href{book/14-canonical-serialization.md}{Canonical Serialization}
109
- \item
110
- \href{book/15-optimization-and-folding.md}{Optimization and Folding}
111
- \item
112
- \href{book/16-toward-a-universal-schema-registry.md}{Toward a
113
- Universal Schema Registry}
114
- \end{enumerate}
115
-
116
- \subsection{Appendices}\label{appendices}
117
-
118
- \begin{itemize}
119
- \tightlist
120
- \item
121
- \href{book/appendix-a-implementing-a-prototype-compiler-in-python.md}{Appendix
122
- A: Implementing a Prototype Compiler in Python}
123
- \item
124
- \href{book/appendix-b-incorporating-external-predefined-types-and-functions.md}{Appendix
125
- B: Incorporating External Predefined Types and Functions}
126
- \end{itemize}
127
-
128
- \begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
129
-
130
- \emph{Note: This is the master file. Individual chapters are stored in
131
- the \texttt{book/} directory for easier editing and maintenance. Each
132
- chapter can be edited independently and the changes will be reflected
133
- when the individual files are viewed.}
134
-
135
- \subsection{Usage}\label{usage}
136
-
137
- \begin{itemize}
138
- \tightlist
139
- \item
140
- \textbf{For reading}: Click on any chapter link above to read
141
- individual chapters
142
- \item
143
- \textbf{For editing}: Edit the individual chapter files in the
144
- \texttt{book/} directory
145
- \item
146
- \textbf{For publishing}: Combine chapters as needed for different
147
- output formats
148
- \end{itemize}
149
-
150
- \end{document}