Skip to content

Commit 857951e

Browse files
author
Steve Krouse
committed
## Making the most of a lazy, jetlagged Monday
* TOC {: toc } I woke early for an Alexander lesson this morning, which was a big mistake as I am not nearly over my jetlag. I went back to bed after getting back and thus didn't get much work done today. Maybe 3 hours of reading, as discussed below, and random Inbox tasks I get done after writing this for an hour or two. ### Paths forward for p4 (I wrote this section yesterday and the shower note before that.) ![image](https://user-images.githubusercontent.com/2288939/48720162-0cec0f00-ec17-11e8-832f-a092e24d94f0.png) Reflex is the closest thing to the way I think UI should be written and yet it's so crappy to use. I think that fixing the worst parts of this is a great first step. Of course there are many other things to improve such as direct-manipulation, visual metaphors, etc, but let's start with the most egregious places first. #### Path 1: use Haskell Can I turn off optimizing flags in compiler, use a linter or code augmenter, haskell-id (or whatever thing that auto-checks code), sourcegraph? Maybe watching Haskell developers on Twitch would give me a better sense of the state-of-the-art workflow. #### Path 2: use JS CycleJS or rolling my own thing. Maybe with JS linter to only allow consts and no object modifications (will be tricky to get cycles this way...). #### Path 3: build JS haskell interpreter Build an interpreter with ability to swap nodes as running (like Scratch, Smalltalk) ### Haskell interpreter in JS Today after my jetlag sleepiness I read another few chapters of Stephen Diehl's book [Write You a Haskell](http://dev.stephendiehl.com/fun/index.html), including typing, evaluation, type inference, and the higher-level design of a "ProtoHaskell". It seems like a tractable problem, mostly an engineering problem given that it's mostly "solved". I even found two already on Github [here](https://github.com/johang88/haskellinjavascript) and [here](https://github.com/evilcandybag/JSHC), the first of which comes with [an online REPL](http://hiji.tinyrocket.se/)! It would be interesting to test the speeds of these REPLS vs each other and GHC. Now that I know a bit more about how Haskell works under the hood, I wonder how I would implement the features that I think would make a better experience: 1. Replacing expressions in the evaluation tree with other expressions as things are "running". In particular, I used to think I could evaluate the AST by visiting nodes one by one and I could replace an old subtree with a newer one, but now I'm not so sure that's how things work... 2. Representing various expressions or terms as hashes. In particular, how would I represent closures or the environment in hashed terms? Talking with Cyrus Omar, the Lamdu team, Paul Chuisano, Stephen Diehl will be key in this process... I feel very lucky to be able to confer with the world experts on these topics! ### Go back to drawing, Steve I can feel myself being pulled into "engineering mode" already and it's too early. I don't have my eye fixed on an experience target well enough to get dragged into trying to achieve it. For my work tomorrow, I shall draw out, in tedious frame-by-frame detail, what a simple experience with this "ideal Haskell experience" would look like. I wonder if I could make a simple stop-motion video out of it... The features I think are most important: 1. When I type out a UI term, it should appear in view in under a second (or even less) and be interactive 2. The types of every expression should be immediately accessible 3. The operations I can perform on expressions should be suggested in an accessible way, as well as new expressions I can add in relevant places 4. HMR 5. Automatic plumbing code or plumbing suggestions for conversions between silly types like strings and numbers 6. The live values running through the program should be tied to the static code somehow to give the types color For contrast, I think maybe I should start by trying to accomplish a few UI tasks in Reflex and record them and then make a list of all the pieces of data I wanted to know or actions I wanted to be able to take faster. ### Todos 11/19/18 * p4 next steps * watch videos of expert Haskellers on Twitch and try to copy their setup * build a few things in Reflex and video myself not having a good time * draw out what a better time would look like * read the first 6 chapters of TaPL * [regroup projects](https://futureofcoding.org/log#possible-dec-2018-re-group-projects) * schedule JE podcast * edit Katherine podcast * prep for Tudor podcast
1 parent bfc39f6 commit 857951e

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)