A categorical programming language
Revision | bf529a68c1fdcf1d1d3e210503e1acd3371ab4c8 (tree) |
---|---|
Time | 2022-12-17 03:08:25 |
Author | Corbin <cds@corb...> |
Commiter | Corbin |
Diagram how the tools interact.
@@ -52,6 +52,8 @@ in pkgs.stdenv.mkDerivation { | ||
52 | 52 | ranger |
53 | 53 | # Honey |
54 | 54 | python39Packages.flask purescript |
55 | + # Documentation | |
56 | + graphviz | |
55 | 57 | # experimenting with Honey |
56 | 58 | wabt binaryen |
57 | 59 | # openapi-generator-cli yaml2json python3Packages.virtualenv |
@@ -88,6 +88,7 @@ | ||
88 | 88 | * Might not be feasible unless we switch to stricter monoidal categories |
89 | 89 | * We'd need an equivalence X × 1 → X |
90 | 90 | * swap and dup would need to be primitive again too |
91 | + * Done | |
91 | 92 | * Prove that nat/add is smallest with its behavior |
92 | 93 | * Would justify its jet, since no smaller expression could be jetted |
93 | 94 | * Streams |
@@ -97,9 +98,6 @@ | ||
97 | 98 | * Creates a stream+maybe monad: X → [N, X + 1] |
98 | 99 | * Subtypes? |
99 | 100 | * Interval type? |
100 | -* Cantor's type of bitstrings: N -> 2 | |
101 | - * We have subobjects now, X -> 2 | |
102 | - * And finite bitstrings, [2] | |
103 | 101 | * Moore machines: For state type Q and input type S, Q × S -> Q |
104 | 102 | * Suppose we have output/observation type O and Q -> O |
105 | 103 | * Then Moore machines are equivalent to compact encodings [S] -> O |
@@ -110,7 +108,9 @@ | ||
110 | 108 | * Maybe allow inductive datatype definitions during toolchain build time |
111 | 109 | * Start by factoring out N and lists into inductive datatype modules somehow |
112 | 110 | * Then add trees, etc. |
113 | -* ulimit jellification? | |
111 | + * Motivations? | |
112 | + * Might be nice to build smaller subsets of the language ala carte | |
113 | + * Might allow coinductive types on top of that smaller subset! | |
114 | 114 | * formal power series N -> Q |
115 | 115 | * needs Q |
116 | 116 | * done for N -> N |
@@ -126,9 +126,6 @@ | ||
126 | 126 | * Would not be fast enough for raytracing, but could generate various |
127 | 127 | computable real constants |
128 | 128 | * Extraction to floats would hopefully require n < 100 |
129 | -* CI: automatic generation of demo images | |
130 | - * Would be nice to know how long it takes, too | |
131 | - * Parameterize by number of iterations? | |
132 | 129 | * fun/precomp is an ingredient of CPS transformation |
133 | 130 | * https://okmij.org/ftp/continuations/undelimited.html |
134 | 131 | * It's about time to rewrite the multisampling logic in Cammy |
@@ -173,8 +170,9 @@ | ||
173 | 170 | * (uncurry @0) could be defined as (comp (pair/mapfst @0) fun/app) |
174 | 171 | * list/uncons |
175 | 172 | * has particularly simple bytecode, becoming a term op |
176 | -* Missing optimization | |
173 | +* Missing optimizations | |
177 | 174 | * (comp f-log1p f-exp) => (comp (pair (fun/const f-one) id) f/add) |
175 | + * Valid but not needed yet | |
178 | 176 | * Lentz's algorithm |
179 | 177 | * https://en.wikipedia.org/wiki/Lentz's_algorithm |
180 | 178 | * What's a parser again? |
@@ -221,6 +219,13 @@ | ||
221 | 219 | * I can introduce a given |
222 | 220 | * I can ask djinn for some possibilities |
223 | 221 | * I can add an invariant and ask for a simplification from jelly? |
222 | + * Could prototype in Honey: tile asks for two types using existing djinn syntax | |
223 | + * Backend calls something like djinn | |
224 | + * Not just a list of candidates, but also a determination of strategies | |
225 | + * If input is one of several base cases: something like X -> X, return id | |
226 | + * If monomorphic: Something like F × F -> F, return hardcoded candidates | |
227 | + * Should also take constraints | |
228 | + * Some constraints are powerful enough to give solutions like (pr ...) | |
224 | 229 | * Metrics |
225 | 230 | * Euclidean |
226 | 231 | * Taxicab |
@@ -293,6 +298,9 @@ | ||
293 | 298 | * More recurrence relations |
294 | 299 | * Cobalancing numbers: x_n+1 = 6x_n - x_n-1 + 2, x0 = 0, x1 = 2 |
295 | 300 | * Requires subtraction, multiple prior elements, multiple starting points |
301 | +* More series | |
302 | + * n: floor(n! / e) is always even | |
303 | + * All of the pieces should be available | |
296 | 304 | * Non-empty lists form a comonad |
297 | 305 | * Moore machines form a comonad? |
298 | 306 | * Ints |
@@ -310,36 +318,7 @@ | ||
310 | 318 | * Still useful for e.g. equivalence relations |
311 | 319 | * Another option is multivalued functions: [X, [Y]] × [Y, [X]] |
312 | 320 | * Composition would be done in the list/set monad |
313 | -* Honey: Web browser IDE | |
314 | - * Smalltalk-ish list of recent expressions | |
315 | - * Each expression has a type | |
316 | - * IDE has templates which recognize types | |
317 | - * 1 -> F × (F × F) could be an element of F³, but also an RGB color | |
318 | - * Polymorphic arrows like X -> X could be natural transformations | |
319 | - * Rendering/viewing could be done per-template | |
320 | - * Colors could be shown with swatches in the recent-expression list | |
321 | - * Images and videos could be thumbnailed, previewed, etc. | |
322 | - * Sees a type like [X] -> ... and calls it "a natural transformation from | |
323 | - lists to ..." | |
324 | - * Types like X -> 2 are called "predicates on X" | |
325 | - * Suggests some sort of recursive templating structure | |
326 | - * Demo works for static images, sequences, elements, videos | |
327 | - * Honey API | |
328 | - * Let's write OpenAPI for this and use a generator | |
329 | - * I'm just so fucking tired of doing boilerplate by hand | |
330 | - * Done; seems like Flask servers and OCaml clients can be generated! | |
331 | - * Let's draw an animation on a canvas | |
332 | - * Everything is set up, but it doesn't work | |
333 | - * demo/mandelbrot takes a long time to render, probably | |
334 | - * draw/complex-fun is less clear; even rendering the identity function | |
335 | - is interesting, usually | |
336 | - * Interactive entry of new Cammy programs | |
337 | - * First plan: send S-expression from textbox to Python server | |
338 | - * Parse in Python | |
339 | - * Expand relative to hive in Python | |
340 | - * Typecheck as usual | |
341 | - * Return heap token | |
342 | - * Done! Works! | |
321 | + * Needs equality in order to avoid duplicates | |
343 | 322 | * Voronoi diagrams |
344 | 323 | * Take a list of points and our input point |
345 | 324 | * Fold over the list to find the nearest point to the input |
@@ -392,13 +371,7 @@ | ||
392 | 371 | * Let's rewrite Honey with FastAPI! |
393 | 372 | * And use PyPy! |
394 | 373 | * But not right now! |
395 | - * Let's compile Cammy to JS using PureScript! | |
396 | - * This is feasible; set up a stub and then compile | |
397 | - * Done! But it is not especially faster | |
398 | 374 | * Slogans? |
399 | 375 | * Cammy is compositional |
400 | 376 | * Cammy is chimeric |
401 | 377 | * Cammy is category-theoretic |
402 | -* More series | |
403 | - * n: floor(n! / e) is always even | |
404 | - * All of the pieces should be available |
@@ -0,0 +1,7 @@ | ||
1 | +digraph tools { | |
2 | + Cammy -> Cammy [label="jelly"]; | |
3 | + Cammy -> WAT [label="cammy-wasm"]; | |
4 | + Cammy -> PNG [label="cammy-draw"]; | |
5 | + Cammy -> Types [label="cammy-type"]; | |
6 | + Types -> Cammy [label="cammy-djinn"]; | |
7 | +} |