-
Notifications
You must be signed in to change notification settings - Fork 55
Commit 1200459

Steve Krouse
## Back to research & denotational design
* TOC
{: toc }
Yesterday I resolved to do more research (roughly two days per week, leaving three days for emails, podcast, and freelancing), and I had a good start yesterday with a half-day of solid research!
### Older Oct 2018 shower notes
A few scattered notes from earlier this month that are semi-interesting:
* wouldn't it be neat if HTML had a date/time widget built-in (so it could work in email) that displayed a time in the correct timezone automatically (detected from your browser, or manually change-able within the widget)?
* Is addition (+) too general? Is there not enough *intent* encoded within it? Would it be better to say 7 years and then 2 years later = 9 years? Or 4 kilos with an additional 3 kilos = 7 kilos?
* why are mouseX and mouseY FRP Behaviors and not Events? Because they happen so fast! Maybe we should expose slow things, such as network requests, as Events, with a way to Behavior-ify them!
* Context is key: behaviors on my machine are events are yours!

### Shower denotational design
Conal Elliot is the man. My god, I'm so excited to be able to grok a part of what he has to say! Yesterday I re-watched [Denotational Design: from meanings to programs](https://github.com/conal/talk-2014-lambdajam-denotational-design) and was re-blown away. It's funny: whenever I recommend Conal to friends I have to caveat it with, "I need to watch his stuff multiple times before I get it." This was true of this talk as well.
So here's the denotational methodology as far as I can tell:
1. Come up with abstract "uses" you want the library to be able to accomplish
2. Come up with a sketch of an API
3. Write down the relevant types
4. Write down the μ (mu, meaning) of those types as mathematical objects (likely, functions)
5. Write down the μ of each API function
6. See if any of your types fit existing type classes (monoid, functor, applicative, monad, comonad, etc)
So I tried to follow it in the shower yesterday and I think it went pretty well!

I had a few key insights:
* There should be a way to turn `Events a` on one computer to something like `Event (Event User a)`, where the outer event represents *this computer's perception* of the event happening and the inner event represents when the event *actually happened*.
* Another key insight: the default behavior of FRP applications should be to persist data for forever unless programmed otherwise. The resetting of app's data on page reload is a wacky accident!
* I was having trouble coming up with the semantics for a User... We want a way to authenticate someone and then we need a unique key to identify them. In terms of access for reading and writing, I imagine that logic should live (like everything else) with the relevant pieces of state.
I had another insight, but more about [prototype 4](https://futureofcoding.org/log#prototype-4):
* If we want to have an app be always running
* And we also want to have each modification create an entirely new hash of its definition (no mutation)
* How do we stay sane?
* We could have a pointer-based naming system. It could point at a hash to start.
* Then if we edit a sub-expression in that hash, it creates a new hash for the sub-expression
* It may auto-create a new definition for the larger expression
* And it may also auto-update the pointer to point to the new hash of the larger expression
* Migrations could happen in a similar way if we update a piece of state it could help us combine the old state with a way of producing new state. (Up until time t produce state in this way, then map it to this new format, and then produce state in this new way...)
### Todos 10/24/18
* continue research with [prototype 4](https://futureofcoding.org/log#prototype-4) and/or [multi-node FRP](https://futureofcoding.org/log#cloud-or-multi-node-frp) (continued above with denotational design)
* set SPLASH intentions
* Read all of [Kartik](http://akkartik.name/) & redo my /about page
* Organize FoC Thinking & FoC Research lists from Google Inbox
* Read m fix paper, and understand how the circular monad works... and how I can simulate it in JS1 parent 50d65da commit 1200459Copy full SHA for 1200459
File tree
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changedFilter options
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changed
0 commit comments