isd changed the topic of #sandstorm to: Welcome to #sandstorm: home of all things sandstorm.io. Say hi! | Have a question but no one is here? Try asking in the discussion group: https://groups.google.com/group/sandstorm-dev | This channel is logged at: https://freenode.irclog.whitequark.org/sandstorm/
fkautz has quit [Read error: Connection reset by peer]
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
larjona has joined #sandstorm
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
fkautz has quit [Excess Flood]
fkautz has joined #sandstorm
blowfist has quit [Ping timeout: 240 seconds]
blowfist has joined #sandstorm
<isd> I'll probably want to try this out on a smaller one-off project before I think about using it in Sandstorm proper, but this was fun to build and I'm happy with how it came out: https://github.com/zenhack/incremental.js
<abliss> does the library really transform (x + y) * z into (x * y) + z? :P
<simpson> Fun. I implemented Adapton for similar purposes: https://github.com/monte-language/typhon/blob/master/mast/fun/adapton.mt
<isd> abliss: derp, good catch.
<isd> The README is the sloppiest part of the repo right now; I need to go back over and document properly.
<isd> There's some really key stuff that's needs to be stated that isn't.
<isd> Like .then(). and the way observers work
<isd> simpson: happen to know if/how the design of adapton differs from what incremental does?
<simpson> isd: Offhand no, but they're all based on very similar ideas.
<simpson> isd: Looking at your examples, I think that the biggest difference between your particular presentation and mine is that yours is monadic.
<simpson> I've got cells, sort of like in a spreadsheet, inspired by "Lamport slots", which are just slots which change value according to a Lamport clock.
<simpson> So rather than returning to the monad in order to do computations, users pull from the slots directly as if they held plain values. Behind the scenes, the slots send messages to each other to incrementally update.
<isd> yeah, incremental is less explicit about the graph abstraction; the idea is you can mentally erase the .map() and .bind() calls and get back the non-incremental computation trivially
<simpson> Yeah. It's a "handle" monad, like ResourceT or ST in Haskell. And these can be really useful; microKanren is usually embedded via this sort of monad.
<isd> well, .then() in javascript rather than .bind()
<simpson> The downside is that the logic variables need to be opaque, and the user can't get at what's actually passed around. Twisted Deferreds have this problem too.
* simpson sometimes wonders why callbacks are "hell" but monads are "elegant"
<isd> simpson: composability. Usually when people talk about callback hell, what they're getting at is fairly-ad-hoc use of callback arguments. Where as with monads you can without too much trouble mentally erase the .then() calls and get back to "normal" code
<isd> relatedly, I wish javascript's async/await was generalized to arbitrary monads
* isd googles microKanren
<simpson> http://minikanren.org/ is the landing page, http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf is the paper to read. It's a really fun weekend project.
<isd> Aha, yeah monads seem like a natural fit for embedding something like that.
<simpson> isd: As the slogan goes, "promises form a monad", right? https://github.com/bravoserver/bravo/blob/master/bravo/world.py#L93-L95 shows a halfway-to-E sort of style with Deferreds.
<simpson> In modern Monte, we'd write m`def chunk := self.requestChunk(bigx, bigz); when (chunk) -> { f(self, chunk, ...) }`
<isd> Sadly Python makes monadic style code super awkward, due to the no-statements-in-a-lambda restriction.
<simpson> Yeah. E goes the other way and doesn't have statements.
<isd> +1
larjona has quit [Ping timeout: 260 seconds]
xet7 has quit [Remote host closed the connection]