Readit News logoReadit News
mellonaut · a year ago
The last program on the examples page⁰ truly is amazing:

A guy (called Piet!) saw an artwork that reminded him of Piet (the lang) and tried executing it¹.

> It ran! [...] This is probably the first time in history that a graphic artist has painted a functionally workable computer program by accident.

[0]: https://www.dangermouse.net/esoteric/piet/samples.html [1]: https://gitlab.fabcity.hamburg/hofalab/piet-get-together

lifthrasiir · a year ago
If you relax the "functionally" condition enough, it has been already shown that most paint splatters (including art pieces) are actually valid Perl [1].

[1] https://www.mcmillen.dev/sigbovik/

nightpool · a year ago
I think the issue in this case is that the Perl programs were "really" created by OCR hallucinations, not graphic artists. Piet, on the other hand, is really executing the painting itself.
dylan604 · a year ago
and yet, I can write a line of Perl today that I will not remember how/why it does what it does tomorrow. I don't know if this says more about me or the language other than I don't do it enough any more. However, the fact that paint splatters are better than I am is just proof that it is not the language for me
mock-possum · a year ago
> Piet J. (yes, that's his real name) was browsing art in a small gallery and saw a work which reminded him of a Piet program. He spoke to the artist, who claimed to know nothing about the language. Piet took a photo of the artwork (left), converted it into a clean image file using close colours from the Piet palette (right), and tried running it.

> It ran! The code executes an infinite loop which reads in ASCII characters and prints out the corresponding numerical ASCII values.

Get out of town. Get right out of town.

gnfargbl · a year ago
I did enjoy the one which computes π;

> Naturally, a more accurate value can be obtained by using a bigger program.

I think that's a first for me.

schoen · a year ago
Isn't there an obfuscated C or Perl competition program that also estimates pi by measuring its own code in some way?

Edit: Oh yes, it's "westley" from 1988: https://www.ioccc.org/years-spoiler.html#1988_westley

mzi · a year ago
https://www.cise.ufl.edu/~manuel/obfuscate/pi.c

If I remember correctly, this program also calculates pi more precisely the larger the circle.

boothby · a year ago
Sadly, that depends on a discrepency between npiet and the current Piet spec:

> The interpreter now begins sliding from its current white codel, in the new direction of the DP, until it either enters a coloured block or encounters another restriction.

The npiet interpreter, instead, rewinds its position to the last colored codel upon peeking through whitespace. One of these days, I intend to add that behavior as an option to the lexer in my Piet compiler[1], but I haven't bothered yet.

Following the spec, the program is a trivial nonhalting loop because the extreme corners of almost all blocks are white-adjacent. Writing complex Piet programs to target multiple interpreters and compilers is quite the challenge, as they've all got subtly different undocumented interpretations of the spec. I think that the output of my Piet backend is more or less interpreter-agnostic, but I've only dug into the details of three or four other interpreters.

[1] https://github.com/boothby/repiet/

blauditore · a year ago
I wonder what the chances are that a simple painting like this (a few large rectangular blocks) is a valid program. From skimming the documentation, I tend to think even that every such image would run without error, given that "Any operations which cannot be performed (such as popping values when not enough are on the stack) are simply ignored, and processing continues with the next command."

However, another question is how many of such random images would actually do something "meaningful".

indigoabstract · a year ago
> It ran! [...] This is probably the first time in history that a graphic artist has painted a functionally workable computer program by accident.

I think this truly deserves a CS Ig Nobel Prize, if there were one, for making people laugh and then making people think.

thih9 · a year ago
> This is probably the first time in history that a graphic artist has painted a functionally workable computer program by accident

While impressive organically, it sounds easy when targeted; we could design a programming language where an image of Mona Lisa prints "hello world" - and claim a similar feat.

Perhaps the reverse is more interesting - programmers accidentally wrote a language that could treat real world abstract art as valid input.

cinntaile · a year ago
> Perhaps the reverse is more interesting - programmers accidentally wrote a language that could treat real world abstract art as valid input.

Isn't that what happened here?

thih9 · a year ago
update: actually we have perl, https://www.mcmillen.dev/sigbovik/
abrookewood · a year ago
I just read that ... incredible. I mean the language itself is just bizarre, but that story tops everything.
sedatk · a year ago
Piet is a milestone experiment among the esoteric programming languages, but I believe that it falls short of achieving its goal to make programs look like Mondrian paintings unless the developer really intends to do so.

I wish the language structure were designed in a way that anything that’s “written” with it would look like a Mondrian painting.

jack_riminton · a year ago
Yes well unfortunately Mondrian only really used the primary colours so that would be rather limiting
euroderf · a year ago
But FWIW Mondrian also showed how to convert a more conventional style into his signature style. This can be seen in Still Life with Gingerpot, numbers 1 and 2.
shever73 · a year ago
It could be done. The FizzBuzzLang esolang uses only the words FIZZ, BUZZ and FIZZBUZZ.
btbuildem · a year ago
Could encode more operators into shape ratios / proportions, line thickness etc.
wouldbecouldbe · a year ago
just have to make them really big
WillAdams · a year ago
This has always raised a question to me:

>What does an algorithm look like?

Is there a real-world possibility of creating something like to _The Glass Bead Game_ from Herman Hesse's novel (originally published as _Magister Ludi_)?

As a visually oriented person, I'd like to think so, and have actually tried to use such tools:

https://community.carbide3d.com/uploads/default/original/3X/...

but the danger has been, for want of an unambiguous answer to the afore-mentioned question, they always run the risk of:

https://blueprintsfromhell.tumblr.com/

https://scriptsofanotherdimension.tumblr.com/

and it's hard striking a balance between visual expressiveness and modularity (which all-too readily results in the wall of text which one is presumably trying to avoid).

boothby · a year ago
> What does an algorithm look like?

Writing Piet by hand is a fun way to explore this. Sergei Lewis[1] and I[2] have each written tools to generate Piet code. Sergei's assembler makes much nicer looking code than my Piet backend. All you can really see from my compiler's output is that I'm really lazy and used a trampoline[3]

[1] http://www.toothycat.net/wiki/wiki.pl?MoonShadow/Piet

[2] https://github.com/boothby/repiet/

[3] https://en.wikipedia.org/wiki/Trampoline_(computing)

andoando · a year ago
I have a belief that there is a 1 to 1 relationship between any algorithm, or even any mental conception, and a visual representation. I got this idea reading one of Steven's pink book, in which he says that any abstract word can be broken down into simpler words which in the end describe some spatial relationship. For example to "rekindle" is to "bring two things back together".

It is easy similarly to say that a for loop is the mental conception of "one thing going over a bunch of other things", which has a visual representation like "100" -> "010" -> "001".

I wonder then if its possible to create a language where one defines these constructs purely as visual transformations.

pyinstallwoes · a year ago
That reminds me of some thinking I did regarding the primordial gods one finds across many cultures: The penis and vagina symbolism, the first physical objects representing ontology as building blocks.

From there, we spatialize and logicize concepts like "mine," "like me," "unlike me," "other," "in front," "back," and "forward."

Additionally, at the risk of igniting flames, I find it interesting to ponder the significance of gender in the current zeitgeist. Could attacking gender at a political level be a form of assault on sense-making, tugging at the roots of ontological logic centers in the brain? Might this destabilize civilization centers deemed as enemies by some? Feels like the right exploit from a hacker mentality.

Pompidou · a year ago
> any abstract word can be broken down into simpler words which in the end describe some spatial relationship

What if my computing model rely on quantum phenomenon ? Maybe some of them don't have good visual representation. But it's a guess. I don't know...

Regarding the global idea of your comment: what about languages such as J it APL or BQN ? In such languages each character is an atomic part of algorithms (in j, two characters are used to implement dynamic IF for instance. One character only is used to define the dimensional depth of each part of algorithms). In this way, iversonnian languages can be seen as general and pure visual representation of algorithms once you consider each J or APL character as an arbitrary glyph.

andoando · a year ago
For simple programs you can also imagine just implementing a Turing machine where the symbols are colors.
donalhunt · a year ago
This is the type of thing, I'd expect to show up in a (crime) thriller, stumping the protagonist / investigators until someone deduces it's a code.

And we all thought QR codes were useful...

OscarCunningham · a year ago
This person made a quine in Piet: http://mamememo.blogspot.com/2009/10/piet-quine.html?m=1. The image there is broken, but there's a copy here: https://codegolf.stackexchange.com/a/23255/103045.
whatrocks · a year ago
Discovering Piet is a special moment of awe and confusion and wonder. Mine was captured in this chat with my friend Oz in our Computer Science podcast “The CS Primer Show”: https://show.csprimer.com/episodes/e2-dont-let-a-gpt-have-al...
renke1 · a year ago
We had a small course in university on esoteric programming language. Each of us had to select a language (Brainfuck, Piet and a few others) and play around with it. I chose Piet and had a lot of fun with it, but to be honest, my small example application was not really aesthetically pleasing. I guess you have to be a Piet expert to make art with it.
bocytron · a year ago
The samples page is amazing. You can see the evolution of the canvases, becoming more and more sophisticated and beautiful to took at.

https://www.dangermouse.net/esoteric/piet/samples.html