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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Sample programs in the Piet programming language

130 点作者 journeeman大约 9 年前

8 条评论

kibwen大约 9 年前
For those using Piet in production, what async web framework do you favor? Warhol seems pretty popular, but Schiele has me impressed with its expressiveness. We're currently using Dali, though I'm a bit dissatisfied at how surreal its API is.
评论 #11342922 未加载
评论 #11342947 未加载
评论 #11343285 未加载
评论 #11342865 未加载
评论 #11343436 未加载
评论 #11343221 未加载
评论 #11342844 未加载
评论 #11342752 未加载
评论 #11343667 未加载
评论 #11343349 未加载
评论 #11342886 未加载
leni536大约 9 年前
An &quot;actual&quot; piet quine:<p><a href="http:&#x2F;&#x2F;mamememo.blogspot.hu&#x2F;2009&#x2F;10&#x2F;piet-quine.html" rel="nofollow">http:&#x2F;&#x2F;mamememo.blogspot.hu&#x2F;2009&#x2F;10&#x2F;piet-quine.html</a><p>For me the image doesn&#x27;t load, it&#x27;s archived on stackexchange fortunately:<p><a href="https:&#x2F;&#x2F;codegolf.stackexchange.com&#x2F;questions&#x2F;23193&#x2F;output-an-image-of-your-source-code-not-quite-a-quine" rel="nofollow">https:&#x2F;&#x2F;codegolf.stackexchange.com&#x2F;questions&#x2F;23193&#x2F;output-an...</a><p><pre><code> $ ..&#x2F;npiet-1.1&#x2F;npiet quine.gif &gt; quine2.gif $ diff quine.gif quine2.gif </code></pre> It&#x27;s freakin&#x27; impressive.
greenpenguin大约 9 年前
I had an interesting time writing a JIT for Piet some time ago. Piet is a pretty weird language in a few non-obvious ways. From what I remember:<p>* Execution moves between blocks of colour. Flood fill algorithms are a valid compiler optimisation!<p>* Execution can move left&#x2F;right&#x2F;up&#x2F;down. You can&#x27;t necessarily tell what will be executed without doing it. The &#x27;codel chooser&#x27; stuff means you can exit a colour block in two different ways depending on program state (plus left&#x2F;right&#x2F;up&#x2F;down, so 8 ways total...).<p>* Instructions are encoded in the difference between colour blocks.<p>* Piet is otherwise a fairly straightforward stack machine.
frobozz大约 9 年前
I wouldn&#x27;t trust these programs to work. The fibonacci one certainly doesn&#x27;t.<p>When the explanatory line in the fibonacci example first hits the left hand side of the program, the Direction Pointer appears to be being rotated anti-clockwise.<p>Were it rotated clockwise, as-per the spec, it would go up, hit the black block above, and eventually end up in an infinite loop.<p>The command executed on entry to that block is PUSH (pale to normal yellow), so it shouldn&#x27;t have any effect on DP.
S4M大约 9 年前
I&#x27;m wondering if there is a practical use of such a graphic language. I am thinking of printing the pictures associated with the code, put them somewhere, and other people could take some photos of those pictures with their smartphones and run the corresponding code. That might be useful for a game but I can&#x27;t think of anything yet.
评论 #11347501 未加载
AstroJetson大约 9 年前
I was going to attempt a humorous comment of &quot;I prefer a language that supports recursion, so I use Escher&quot;. But then my brain went, &quot;think there already is an Escher&quot;. There is one, it&#x27;s from 1995.<p>Are programming languages about to hit the same problem as musicians, thinking up that cool but unused band name?
Radle大约 9 年前
The Pi calculator gave me the rest.
评论 #11342976 未加载
qznc大约 9 年前
Any museum wants to host an exhibition?