Permalink
Please sign in to comment.
Showing
with
483 additions
and 0 deletions.
- +4 β0 .gitignore
- +2 β0 README.md
- +84 β0 doc/ABCD.md
- +3 β0 doc/Mobile.md
- +5 β0 doc/Wiki.md
- 0 index.html
- +23 β0 manifest.json
- BIN media/lightning-144.png
- BIN media/lightning-192.png
- BIN media/lightning-512.png
- BIN media/lightning-96.png
- +45 β0 service.js
- 0 src/abcd/analyze.js
- 0 src/abcd/denoise.js
- 0 src/abcd/embed.js
- +317 β0 src/abcd/normalize.js
- 0 src/abcd/render.js
- 0 src/app/index.js
- 0 src/app/ui/Browser.js
- 0 src/app/ui/Canvas.js
- 0 src/app/ui/Image.js
- 0 src/app/ui/SearchBar.js
- 0 src/app/ui/Video.js
@@ -0,0 +1,4 @@ | |||
*~ | |||
*#* | |||
.*~ | |||
.*#* |
@@ -0,0 +1,2 @@ | |||
Denshi is an experimental programming environment, intended to explore | |||
applications of machine learning to the development of software. |
@@ -0,0 +1,84 @@ | |||
## Program Rewriting | |||
The four primitive combinators: | |||
|
|||
``` | |||
[A] [B] a = B [A] | |||
[A] [B] b = [[A] B] | |||
[A] c = [A] [A] | |||
[A] d = | |||
``` | |||
|
|||
An alternative basis: | |||
|
|||
``` | |||
[A] a = A | |||
[A] b = [[A]] | |||
[A] [B] c = [A B] | |||
[A] d = [A] [A] | |||
[A] e = | |||
[A] [B] f = [B] [A] | |||
``` | |||
|
|||
The first basis emphasizes the concept of *scope*. I think it can be | |||
motivated from lexical scoping in the lambda calculus, along with | |||
duplication/erasure being tied to the *linear* lambda calculus. So the | |||
first basis seems more foundational. | |||
|
|||
Why is it good to work at such a low level of semantics? Why not use a | |||
more meaningful basis that deals with e.g. sum and product types? | |||
Consider: | |||
|
|||
``` | |||
assocl : (a * (b * c)) <-> ((a * b) * c) : assocr | |||
commute : (a * b) <-> (b * a) : commute | |||
uniti : a <-> (a * 1) : unite | |||
``` | |||
|
|||
One argument is that it's simply not necessary: "arithmetic" | |||
operations like this are readily recognized with ABCD: | |||
|
|||
``` | |||
[A] [B] pair exec = [A] [B] | |||
[A] [B] [C] pair pair assocl = [A] [B] pair [C] pair | |||
[A] [B] pair [C] pair assocr = [A] [B] [C] pair pair | |||
[A] [B] pair commute = [B] [A] pair | |||
[A] uniti = [[A] []] | |||
[[A] []] unite = [A] | |||
``` | |||
|
|||
I really like the idea of code as a cellular automata-like substance, | |||
a kind of "active Legos". It's important to work totally at the | |||
program level, encoding "data" as a program that introduces a value in | |||
to an environment. | |||
|
|||
## Machine Learning | |||
There are a number of interesting results in machine learning, and | |||
particularly in program synthesis, that I'd like to replicate in the | |||
context of a functional language. Many program synthesis papers use | |||
either Brainfuck or some novel assembly language made in imitation of | |||
e.g. x86. | |||
|
|||
[Neural Program Synthesis with Priority Queue | |||
Training](https://arxiv.org/abs/1801.03526) was a very surprising | |||
result: you can essentially "bootstrap" a randomly initialized neural | |||
network with its own output and solve basic program synthesis | |||
problems. This seems like a good place to start: a simple | |||
character-to-character model that's able to generate ABCD to solve | |||
e.g. basic operations on polynomials. For example, given the equation: | |||
|
|||
``` | |||
[foo] [bar] pair X = [bar] [foo] pair | |||
``` | |||
|
|||
can we bootstrap a random net to solve for `X`? | |||
|
|||
There are some other things I'd like to look at, like latent space | |||
embedding, but I think PQT is a good first milestone. | |||
|
|||
### Architecture | |||
Convolutional (dilated), residual character-to-character. | |||
Sequential (recurrent), with the "stack RNN" structure. | |||
|
|||
### Tsetlin Machines | |||
[A strange new model](https://arxiv.org/abs/1804.01508), should check | |||
this out. |
@@ -0,0 +1,3 @@ | |||
What is the mobile app like? | |||
|
|||
- Data browser like [Clojure's REBL](https://www.youtube.com/watch?v=c52QhiXsmyI) |
@@ -0,0 +1,5 @@ | |||
There are at least two visions of a "programmable", or "smart" wiki, | |||
that I'd like to take a look at. | |||
|
|||
- [Lisp, mud, and wikis](http://fexpr.blogspot.com/2018/10/lisp-mud-and-wikis.html) | |||
- [Wikilon](https://github.com/dmbarbour/wikilon/blob/master/docs/AwelonLang.md) |
No changes.
@@ -0,0 +1,23 @@ | |||
{ | |||
"name": "Denshi", | |||
"short_name": "Denshi", | |||
"start_url": "/", | |||
"scope": "/", | |||
"display": "standalone", | |||
"background_color": "#fefefe", | |||
"theme_color": "#fefefe", | |||
"icons": [ | |||
{ | |||
"src": "/media/lightning-96.png", | |||
"sizes": "96x96" | |||
}, | |||
{ | |||
"src": "/media/lightning-192.png", | |||
"sizes": "192x192" | |||
}, | |||
{ | |||
"src": "/media/lightning-512.png", | |||
"sizes": "512x512" | |||
} | |||
] | |||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,45 @@ | |||
// This file is a part of Denshi. | |||
// Copyright (C) 2019 Matthew Blount | |||
|
|||
// This program is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Affero General Public License as | |||
// published by the Free Software Foundation, either version 3 of the | |||
// License, or (at your option) any later version. | |||
|
|||
// This program is distributed in the hope that it will be useful, but | |||
// WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
// Affero General Public License for more details. | |||
|
|||
// You should have received a copy of the GNU Affero General Public | |||
// License along with this program. If not, see | |||
// <https://www.gnu.org/licenses/. | |||
|
|||
// XXX TODO This is dead code, rethink it for the reboot. | |||
|
|||
const version = "0.0.2"; | |||
const cacheName = `denshi-${version}`; | |||
const cacheUrls = [ | |||
"/", | |||
"/static/denshi.mjs", | |||
]; | |||
|
|||
async function onInstall(event) { | |||
let db = await caches.open(cacheName); | |||
await db.addAll(cacheUrls); | |||
self.skipWaiting(); | |||
} | |||
|
|||
async function onActivate(event) { | |||
await self.clients.claim(); | |||
} | |||
|
|||
async function onFetch(event) { | |||
let db = await caches.open(cacheName); | |||
let response = await db.match(event.request, { ignoreSearch: true }); | |||
return response || fetch(event.request); | |||
} | |||
|
|||
self.addEventListener("install", (e) => e.waitUntil(onInstall(e))); | |||
self.addEventListener("activate", (e) => e.waitUntil(onActivate(e))); | |||
self.addEventListener("fetch", (e) => e.respondWith(onFetch(e))); |
No changes.
No changes.
No changes.

Oops, something went wrong.
0 comments on commit
86c7022