TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

λ-2D: An exploration of drawing as programming language

371 点作者 ink404大约 3 年前

35 条评论

tromp大约 3 年前
&gt; To be able to draw programs that look visually appealing themselves, such that someone would want to put a frame around them and hang them on the wall.<p>I&#x27;ve done that with the predecessor function in lambda diagram form:<p><pre><code> ┬────────── ┼─────┬──── ┼─────┼─┬── │ ──┬─┼ ┼ ┬ │ ┬─┼─┼ │ │ │ │ ├─┘ │ │ │ ├─┘ │ │ └─┤ │ │ └─────┤ │ └─┘</code></pre> Lambda diagrams [1] are just a graphical output format for the pure lambda calculus though, and not a 2D programming language like Λ-2D.<p>[1] <a href="https:&#x2F;&#x2F;tromp.github.io&#x2F;cl&#x2F;diagrams.html" rel="nofollow">https:&#x2F;&#x2F;tromp.github.io&#x2F;cl&#x2F;diagrams.html</a>
评论 #30939830 未加载
评论 #30943847 未加载
LichenStone大约 3 年前
This is very cool. I&#x27;ve always been very disappointed that programming is so utterly dominated by the linear text format. It feels like so much potential for expression and feedback is getting left on the table, making use of our capacity to understand and work with spatialisation, patterns, sounds, colours, dynamics, etc would make a lot of sense.<p>Bret Victor&#x27;s The Future of Programming and other talks come to mind - <a href="https:&#x2F;&#x2F;youtu.be&#x2F;8pTEmbeENF4" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;8pTEmbeENF4</a>
评论 #30941744 未加载
评论 #30935416 未加载
评论 #30949234 未加载
graderjs大约 3 年前
This guy is such a genius. I&#x27;m continuously blown away by his stuff. His work just keeps getting better and better. It&#x27;s mind-boggling. He&#x27;s also the author of all this stuff on GitHub which is incredible:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;LingDong-" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;LingDong-</a><p>His work is timeless. to me it has this sort of timeless quality to it: people will look at it in like a hundred years or 400 years and be like yeah this person was a genius, they were doing like 2022-Renaissance level stuff at this time. That&#x27;s what I think... And obviously there&#x27;s incredible groups like what openai just did with the drawing technology. But as an individual contributor this person&#x27;s incredible.<p>Also I love the relentless exploration of code as an artistic medium.
评论 #30953524 未加载
评论 #30945211 未加载
munificent大约 3 年前
<i>&gt; Coding in λ-2D is somewhat like playing Minecraft or Factorio, but it&#x27;s even better because I can call it research.</i><p>I love the honesty in this sentence so much.
kmill大约 3 年前
I&#x27;ve messed around with this same graphical language, though only on paper. As I understand it, the lambda&#x2F;apply nodes are the two morphisms for reflexive objects[1], and these are something like string diagrams for them -- though I haven&#x27;t fully understood how to interpret oriented wires from this point of view...<p>There a paper referenced by [2] (a project shared on HN in the last couple months) that goes into a graphical language for lambda calculus with the same apply&#x2F;lambda nodes, but with explicit copying and dropping. The paper is Lafont, &quot;Interaction Combinators&quot; from 1997. (You have to squint to see why it&#x27;s got anything to do with the lambda calculus.) A similar graphical language is Chemlambda by Buliga, which uses graph rewrite rules with very similar node types.<p>Programming by drawing things in 2D on a fixed grid is an interesting idea I&#x27;ve wanted to experiment with. (I&#x27;d imagined a more Factorio-like Puredata or Max&#x2F;MSP. It&#x27;s something that came to mind from having read about [3].)<p>[1] <a href="https:&#x2F;&#x2F;ncatlab.org&#x2F;nlab&#x2F;show&#x2F;reflexive+object" rel="nofollow">https:&#x2F;&#x2F;ncatlab.org&#x2F;nlab&#x2F;show&#x2F;reflexive+object</a> [2] <a href="https:&#x2F;&#x2F;github.com&#x2F;Kindelia&#x2F;HVM&#x2F;blob&#x2F;master&#x2F;HOW.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Kindelia&#x2F;HVM&#x2F;blob&#x2F;master&#x2F;HOW.md</a> [3] <a href="https:&#x2F;&#x2F;100r.co&#x2F;site&#x2F;orca.html" rel="nofollow">https:&#x2F;&#x2F;100r.co&#x2F;site&#x2F;orca.html</a>
评论 #30943165 未加载
zozbot234大约 3 年前
The untyped lambda calculus seems pretty uninteresting compared to &#x27;typed&#x27; counterparts that tend to come with more interesting graphical visualizations out of the box, viz. string diagrams (where the topological features of the diagram have their counterpart in useful program transformations).<p>Also, I thought it would be fairly well established by now that the De Bruijn notation for the untyped lambda calculus, with prefix function abstraction but <i>postfix</i> application, better reflects its underlying properties since it allows for an intuitive visual understanding of reduction, where applications can be directly matched up to abstractions.
disqard大约 3 年前
This is really cool!<p>I worked on this very same idea (a programming language without text) during my grad school years, and it&#x27;s online here, if anyone is curious:<p><a href="https:&#x2F;&#x2F;www.blockstud.io" rel="nofollow">https:&#x2F;&#x2F;www.blockstud.io</a><p>Here&#x27;s an example of one creator&#x27;s projects (definitely not me!):<p><a href="https:&#x2F;&#x2F;blockstud.io&#x2F;profile&#x2F;15572" rel="nofollow">https:&#x2F;&#x2F;blockstud.io&#x2F;profile&#x2F;15572</a>
评论 #30938722 未加载
somewhereoutth大约 3 年前
Very nice!<p>However written languages convey not just what a program <i>does</i>, but also, through the names of things, what it <i>means</i>. Unfortunately there is no validation of (or other computation with) the meaning - so what it seems to mean may or may not have any bearing on what it actually means, either now or previously.<p>Thus a program is not just how humans talk to machines, but also (one of many ways) humans talk to humans.
评论 #30937849 未加载
renonce大约 3 年前
I haven&#x27;t understood the details of this language yet, but on first look isn&#x27;t it a... circuit board designer?<p>There are already games that allows you to place electric components, each as a pixel on a screen, where these pixels are powerful enough to allow you to code arbitrary programs. I particularly like The Powder Toy, with enough components to make a fast calculator: <a href="https:&#x2F;&#x2F;powdertoy.co.uk&#x2F;Browse&#x2F;View.html?ID=1214884" rel="nofollow">https:&#x2F;&#x2F;powdertoy.co.uk&#x2F;Browse&#x2F;View.html?ID=1214884</a><p>The author arK created some of the most powerful electronic-based saves in The Powder Toy. He also made a SNAKE game which you should definitely check out. They are impressive.<p>Redstone in Minecraft should also fit into this category, but the world is too big, components are less powerful and game tick is slow, so writing programs in it is too clumsy.
awhitty大约 3 年前
The author [1] was somewhat recently featured on Hacker News [2] for their Fishdraw [3] project, if you&#x27;re wondering why their name might look familiar. Always a treat to see what they come up with next!<p>[1] <a href="https:&#x2F;&#x2F;lingdong.works&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lingdong.works&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28157657" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28157657</a><p>[3] <a href="https:&#x2F;&#x2F;fishdraw.glitch.me&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fishdraw.glitch.me&#x2F;</a>
dTal大约 3 年前
This reminds me of nothing so much as the computers people implement in The Powder Toy [0] - beautiful, impressive, inscrutable.<p>[0] <a href="https:&#x2F;&#x2F;powdertoy.co.uk&#x2F;Browse&#x2F;View.html?ID=427363" rel="nofollow">https:&#x2F;&#x2F;powdertoy.co.uk&#x2F;Browse&#x2F;View.html?ID=427363</a>
twofornone大约 3 年前
Those animated runs look like they would be super useful for debugging. Offloads a ton of working memory that comes with tracking stack traces in your head when you can just see a visual representation of the stack and watch data flow in real time.
devarsirawal大约 3 年前
There is a lot of interesting work related to computation using shapes in the Shape Grammar[0] field. With shape grammars, rather than using computer vision to parse the pixels, computation can be done using the intrinsic properties of shapes. There is some great work being done at Georgia Tech in Dr. Economou&#x27;s Shape Computation Lab[1]. For beginners, they have created an unsigned binary adder using purely shape representations as numbers[2].<p>[0] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Shape_grammar" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Shape_grammar</a><p>[1] <a href="https:&#x2F;&#x2F;shape.design.gatech.edu&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;shape.design.gatech.edu&#x2F;index.html</a><p>[2] <a href="https:&#x2F;&#x2F;shape.design.gatech.edu&#x2F;Machine&#x2F;Projects&#x2F;12_Circuits_02&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;shape.design.gatech.edu&#x2F;Machine&#x2F;Projects&#x2F;12_Circuits...</a>
desertraven大约 3 年前
I love this. It&#x27;d be great to see further exploration of this theme. It could impact not just programming, but our ability to create and share ideas.<p>Obviously text is the most powerful and intuitive means of programming, but I wonder if it&#x27;s the best? Perhaps more generally, is language as we know it really the best way to convey meaning?<p>I&#x27;ve no idea on such topics. My curiosity has just been roused by this ambitious project.
Minor49er大约 3 年前
There&#x27;s a bug where if you have an animated run, but switch programs, the first animated run will keep executing over phantom pathways. You can start another animated run at the same time. The resulting visuals and audio are really interesting.<p>I also love the option to obfuscate the code in two separate ways. This project rules.
Cloudef大约 3 年前
This is pretty cool, the programs end up looking pretty pleasing to eye. Looks like schematics.
ammanley大约 3 年前
Absolutely fascinating. I actually put a lot of time a while back into looking for a way to &quot;draw&quot; either a psudeo-code specification language, or just Python, on an iPad for &quot;programming doodling&quot; that could be scanned and parsed for later execution (spoiler: handwriting code outside of a drawing program is terrible). I love the idea of being able to bring computation closer to a hand-to-paper medium. Computer vision processing of code -&gt; computation in an editor would be a dream. Please keep at this.
nuancebydefault大约 3 年前
Cool, but in practice, for software development you need version control. Has anyone ever seen a workable solution for diffing -- let alone merging -- _any_ graphical language?
评论 #30938153 未加载
dwringer大约 3 年前
I think it would be extremely cool to be able to transpile other languages into this language&#x27;s diagrams and then watch the execution.
camtarn大约 3 年前
Very interesting! Reminds me a bit of ladder logic, a 2D visual programming paradigm based on wiring together relays - but at a higher level of abstraction, since ladder logic is mostly based on simple boolean operations and doesn&#x27;t really have any notion of defining functions.<p>The fractal tree and UTM examples are absolutely beautiful and mind-bogglingly simple.
xixixao大约 3 年前
Who immediately thought: Factorio!
diamondage大约 3 年前
So cool. Does anyone build serious projects in max MSP? There is something satisfying about building visually that is repeated here. Those patches quickly get unwieldy though.
rhn_mk1大约 3 年前
Thisreminded me of another programming thing based on lambda calculus: <a href="https:&#x2F;&#x2F;justine.lol&#x2F;lambda&#x2F;" rel="nofollow">https:&#x2F;&#x2F;justine.lol&#x2F;lambda&#x2F;</a>
frozenport大约 3 年前
Looks like LabVIEW <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;LabVIEW" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;LabVIEW</a>
mikotodomo大约 3 年前
It looks very cool, like circuits. I bet these kinds of languages will obsolete text based languages in the future for being more powerful and easier to use.
Nuzzerino大约 3 年前
Reminds me of SuperHack - <a href="https:&#x2F;&#x2F;www.hacker.org&#x2F;sh&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.hacker.org&#x2F;sh&#x2F;</a>
cz35iek大约 3 年前
Gr8 piece. It would be awesome to see that in 3D (VR) with autogenerated layouts. (i.e. force directed graphs).
Razengan大约 3 年前
This made me wonder, of course if electrical circuits can be expressed as pretty much 1:1 WYSIWYG diagrams, why not computer programs?
lonk大约 3 年前
Crazy. Alien tech.
zitterbewegung大约 3 年前
What was that language or system where it would read what you wrote down on a piece of paper and then execute the program ?
评论 #30938645 未加载
评论 #30939855 未加载
评论 #30938313 未加载
评论 #30938614 未加载
davidjytang大约 3 年前
How would version control be done?
sandebert大约 3 年前
The animated run would probably be very interesting with a program emulating the Enigma machine.
NeutralForest大约 3 年前
It&#x27;s very cool and the presentation is clear. The animation of the parsing is fun as well =)
basicplus2大约 3 年前
quite a few plc&#x27;s (programmable logic controllers) are programmed graphically as well.
sn00tz00t大约 3 年前
relevant?<p><a href="https:&#x2F;&#x2F;drossbucket.com&#x2F;2021&#x2F;06&#x2F;30&#x2F;hacker-news-folk-wisdom-on-visual-programming&#x2F;" rel="nofollow">https:&#x2F;&#x2F;drossbucket.com&#x2F;2021&#x2F;06&#x2F;30&#x2F;hacker-news-folk-wisdom-o...</a>