3 ms·
I once saw block languages described as "What I could have typed out in twenty characters takes me 100 meters of dragging and dropping instead." Pretty much sum
by vanderZwan 12y ago
I once saw block languages described as "What I could have typed out in twenty characters takes me 100 meters of dragging and dropping instead." Pretty much sums up the one major issue with them, doesn't it?
Having said that, I'm convinced there's a way to design an interface around it that creates an acceptable compromise with (most of) the best of both worlds, although I don't know what that interface would look like. Perhaps introducing a cursor and treating the blocks as we would normally treat glyphs in typed languages[0], using keyboard shortcuts to quickly insert and manipulate blocks.
EDIT: Also, what's notable about all these block lanuages is that they're essentially taking writing, and turning the words into things that can be dragged around and manipulated as objects. Although we do to some degree process language in that way, I wonder if it isn't doing things backwards.
If you look at Bret Victor's recent work you can see interesting alternative takes on this where the problem is approached from a concrete example first and then generalised into abstractions[1][2][3].
[0] Err... not as in typed languages, obviously, but as in languages that we type out.
[1] https://vimeo.com/66085662 https://vimeo.com/66085662
[2] https://vimeo.com/64895205 https://vimeo.com/64895205
[3] https://worrydream.com/DynamicPicturesMotivation/ https://worrydream.com/DynamicPicturesMotivation/
- sukilot 12y agoRight, what you want is a seamless view that shows the block diagram while you type, perhaps by "dissolving" a single block while you type in a way that transiently corrupts the block, and condenses the block when the incremental compile notices that there is once again a valid block.
- TheLoneWolfling 12y agoSome editors already do this, by, for example, highlighting pairs of brackets.
- TheLoneWolfling 12y agoSome IDEs end up being effectively doing this.
- vanderZwan 12y agoRight, but in that case the IDE evolved around the existing character-based programming language. What if we try it the other way around? Start by designing an elegant block language and then create a keyboard interface around it.
- TheLoneWolfling 12y agoDid it? Look at tokenized FORTH, for instance. Now, admittedly there's not a whole lot of syntax there to begin with, but still. People tend to shy away from languages that don't have textual representations, and for good reasons. It's harder to share code, among other things. I think the best approach would be to come up with something that is human-readable and writable, but is optimized for the block approach. And I'd argue that some languages (lisp?) already fit this.
- TeMPOraL 12y ago> And I'd argue that some languages (lisp?) already fit this. Yup. And with proper editing help like Paredit, you start to actually think in terms of moving tree nodes ("blocks") around instead of typing in text. With that, all you'd have to do is to start drawing colored boxes around the code instead of parens, and you'd have a decent, keyboard-operated "block language".