Browse files


  • Loading branch information...
xkapastel committed Jan 2, 2019
0 parents commit 86c702248f54dfc2e9372c9ef4d6379ba653820a
@@ -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?

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]( 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](, should check
this out.
@@ -0,0 +1,3 @@
What is the mobile app like?

- Data browser like [Clojure's REBL](
@@ -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](
- [Wikilon](
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.
BIN +6.55 KB media/lightning-96.png
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
// 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
// <

// XXX TODO This is dead code, rethink it for the reboot.

const version = "0.0.2";
const cacheName = `denshi-${version}`;
const cacheUrls = [

async function onInstall(event) {
let db = await;
await db.addAll(cacheUrls);

async function onActivate(event) {
await self.clients.claim();

async function onFetch(event) {
let db = await;
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

Please sign in to comment.