I believe I understand where the designer is coming from. Traditional languages use a 1D syntax to express a structure that is really not 1D (the parse tree). However, I don't think it's really 2D either. If you think about how an interpreter would have to proceed to execute Recto code, it would still parse it into an internal representation and then execute that, and this internal representation no longer uses the 2D layout of the code.
I'm not implying that it's a bad idea or anything. To the contrary, I think Recto is a cool idea. I'm just skeptical that simply making a language syntax two-dimensional automatically makes it easier to understand, code in, collaborate in, or implement a parser/interpreter/compiler for.
> how an interpreter would have to proceed to execute Recto code, it would still parse it into an internal representation and then execute that, and this internal representation no longer uses the 2D layout of the code.
Adding parallel execution will make it true 2D at execution time. Even though it's sequential code. More over it can be logically, architecturally 2D while being 1D from interpreter's standpoint. If it uses cooperative multitasking with 1 running task at a time. Or simply 1 core processor.
Upvoted for the likelihood of producing interesting conversations on HN. But fundamentally this Recto language looks 1D, not 2D. As IsTom said below, it looks like "braces/parens with extra steps."
If there were any actual "in-game effect" of the rectangles — e.g. a "rotate rectangle" primitive that would change the order in which atoms were evaluated; or some meaning given to overlapping rectangles as in OgsyedIE's comment — then it would be much more interesting, because it would no longer be exactly isomorphic to Lisp/Scheme.
psychoslave 1 days ago [-]
>Virtually all the languages we humans use—spoken, written, or artificial (such as programming languages)—are fundamentally one-dimensional.
Anyone having a look at a musical score can conclude this is wrong.
Even when it comes to spoken language, intonation is conveying a lot, even in languages which are not classified as tonal.
All that said, that's nice to see an exploration of exotic expression form. It doesn't need to down other approach to make shine its own.
mhagiwara 18 hours ago [-]
Hi! Author here. You're right that music and speech carry more than just raw symbols such as intonation, pitch, dynamics, etc. all add important information. But in the framework I'm using, both are still fundamentally “1D” because their core structure unfolds sequentially in time: notes in a score, words and phrases in speech. Even when additional features like accent or dynamics are present, they're layered onto a linear stream.
Recto, by contrast, makes two dimensions part of the syntax itself: elements and rects can expand horizontally or vertically, and they can nest recursively. That's the difference I wanted to highlight.
impulsivepuppet 13 hours ago [-]
I find it quite intriguing to introduce "language-native" matrices and 2d blocks (which I still find difficult to wrap my head around.)
The reason why most people would more intuitively consider a music score as multidimensional has to do with parallelism or concurrency.
In theory, nothing is stopping you from creating a hyperarray language a la BQN++ (or dare I say QRP). Maybe I glossed over an example, but having proper pointwise application to hyperscalars feels like a must-have.
Second idea is to introduce process parallelism, which could actually make this form of syntax into an execution graph of sorts--could be quite promising!
ofalkaed 12 hours ago [-]
Western harmony can not be understood in one dimension, it is very much in two dimensions.
Ferret7446 1 days ago [-]
It's all about semantics and representation. All data is (can be represented as) one dimensional. Musical scores are definitely on the one dimensional side of the spectrum however (e.g., see Lilypond).
gmueckl 1 days ago [-]
Music notation is definitely not one-dimensional because it encodes simultaneous occurrence and simultaneous time-progression of independent pitches (e.g. a sequence of cords played legato).
dahart 5 hours ago [-]
Not necessarily true; this depends entirely on which music notation you’re talking about. Chord charts handle simultaneous pitches easily using a 1D flow of text along the timeline. Most music notations, including standard staff notation, use a layout that has a primary linear time axis, with lines that wrap, just like written text. Staff notation is different, but not that different from text. You can think of pitch as a secondary embedded dimension, but it’s certainly not necessary. You can also notate pitches and pitch combinations symbolically. The resulting audio, whether spoken or played musically, is 1-dimensional (in time) with respect to an idealized single point listener. So at some level, using anything more than one dimension is a type of feature expansion - it’s useful for notation and control, but adds new dimensions that are over-specified and unnecessary to the final result.
Ferret7446 23 hours ago [-]
And text encodes multiple bits per character. That's a meaningless distinction (or it means as much as you want it to mean in a subjective semantic debate)
gmueckl 20 hours ago [-]
I do not understand what point you are trying to make.
efskap 21 hours ago [-]
Yet that maps to MIDI, which is a linear sequence of events
gmueckl 20 hours ago [-]
No, MIDI is absolutely not isomorphic to sheet music.
almostgotcaught 1 days ago [-]
> musical score
sheet music isn't a language, it's a notation. it's just a concise way to represent a waveform (a song). and it's certainly one dimensional because you either play the song forwards or backwards.
ghssds 1 days ago [-]
>sheet music isn't a language
of course not a language in the same way English or Spanish are languages, but certainly a language in the same way mathematical formula, Lisp, or Java are languages.
>certainly one dimensional
The X axis represent time and the Y axis represent pitch. Moreover, you can have multiple pitches at the same time. I'm not a musician nor a geometrician but it does seems 2D to me, in a way regular text is not.
almostgotcaught 21 hours ago [-]
> of course not a language in the same way English or Spanish are languages, but certainly a language in the same way mathematical formula, Lisp, or Java are languages.
It is mostly certainly not - the defining feature of all languages (human, formal, mathematical, programming) is that you can define new words/concepts/primitives. Sheet music is notation.
Sharlin 15 hours ago [-]
Then regex, HTML, YAML, and so on are not languages either according to your definition.
Yet they are languages according to formal language theory, a definition which I’d say is a bit more widespread than yours. Indeed what you propose roughly maps to (a subset of) context-sensitive languages in particular.
Defining new primitived isn’t really essential. What matters is what you can express with the existing primitives and grammar rules. And sheet music has been quite successful at expressing incredibly complex musical concepts just fine.
(Also there’s the fact that sheet music can contain arbitrarily complex instructions to the performer in natural language, and define new notations too. But composers usually refrain from doing that for the same reason that people don’t go around inventing new idiosynchratic words in English unless they’re SF authors.)
almostgotcaught 8 hours ago [-]
> Yet they are languages according to formal language theory, a definition which I’d say is a bit more widespread than yours. Indeed what you propose roughly maps to (a subset of) context-sensitive languages in particular.
I love when people talk down to me as if I don't have a PhD in this shit lol. No actually what I'm talking about is Recursive languages.
> Then regex, HTML, YAML, and so on are not languages either according to your definition.
Do you see the M before the L there in both HTML and YAML? Do you know what it stands for? Markup. Markup is a funny word that colloquially means the same thing as annotate which bears a strong relationship to the word notation hmmmmmmmm.
Let me put it simply: if the force of the original comment is that context free languages can be 2d then I would say..... no duh.
dako2117 6 hours ago [-]
>written language
written language isn't a language, it's a notation. it's just a concise way to represent a waveform (a spoken sentence). and it's certainly one dimensional because you either read forwards or backwards
mpalmer 19 hours ago [-]
"Virtually all" about covers it, though.
joshmarinacci 1 days ago [-]
I love this concept but I feel it is hamstrung by the need to write it using a text editor. If the rectangles were defined by actual graphical shapes it would be a lot easier to read and understand.
Also I wonder if positional parameters would need to be replaced by named arguments.
abraxas 1 days ago [-]
I consider Unreal Blueprints to be essentially a 2D language with the data flow and the execution flow modelled in separate dimensions.
dkersten 1 days ago [-]
Max/MSP actually kinda encodes this into the language too: when all else is equal (eg if you connect the same data output to the input of two print nodes), nodes on the left happen before nodes on the right (normal input/output connections go from top to bottom in Max, unlike Blueprints and most others where its left to right).
xigoi 1 days ago [-]
Having only the corners marked out with weird markers makes it hard to visualize the rectangles. It would be nicer to have the entire rectangle laid out of Unicode box drawing characters.
bawana 7 hours ago [-]
Why stop here? Cant we endow macdraw with an LLM? With that kind of graphic- text language, you can draw structures (like you might on a napkin) with arrows resembling trees or flow diagrams that do computation. In this kind of macDraw-LLM language, we can use graphic primitives. As you zoom in, the primitive can reveal lines of code. Zoom out and you have a high level view of code blocks. Now those silly diagrams of transformer models actually become the code.
flyinghamster 1 days ago [-]
I'm guessing the author doesn't speak Spanish. :)
gus_massa 1 days ago [-]
At least here in Argentina you can say "recto" with a straigh face everywhere. And it means straigh or perpendicular.
The other meaning of "recto" is used only in medical literature or in mean jokes where you pretend to talk seriously.
I worked with teachers of other countries of Latam, sometimes in geometry problems for children. For example, it's usual "ángulo recto". I don't have it in my list of taboo or problematic words.
For example a kite-like cuadrilateral has a different names in each country, none in offensive, but you must be very cautios to ensure everyone understand the same meaning.
Also, ur kids dont understand am/pm that is usual in other countries. To avoid problems everything must be between 1:01 and 11:59.
f1shy 1 days ago [-]
Seems from japan. I often see names from japan to be Spanish words that often are not the best. e.g. verso (can be a poetry verse, but also in some countries a cheap lie), pajero (a car that can drive over hay, but in some countries wanker)
mlajtos 1 days ago [-]
I thought the name was intentional. :)
anthk 1 days ago [-]
The other geometrical meaning :)
nymiro 1 days ago [-]
My thoughts exactly lol
IsTom 1 days ago [-]
Isn't this just braces/parens with extra steps?
fnordlord 1 days ago [-]
I started to think the same thing when it got down to the for-loop example. Is Python 2-d because it uses indentation for blocks?
kkkqkqkqkqlqlql 1 days ago [-]
Everything is just braces/parens with extra steps.
recursive 15 hours ago [-]
Not befunge
apgwoz 22 hours ago [-]
In the very early 2000s, a coworker of mine, who was frequently banned from the Something Awful forums, shared with me a language, which I think was called “Path”, that was 2D. IIRC, execution of code followed a textual path through the file. I seem to remember it being sort of like a 2D brainfuck. You essentially drew a map to compute.
When I look at Orca (https://100r.co/site/orca.html) I’m reminded of it, but it was definitely unique. Anyone happen to remember / have a link to a successor?
archargelod 18 hours ago [-]
A very simple query "PATH programming language" with SearXNG returns [1].
I think it matches your description perfectly.
> 2003
> PATH is a programming language that is similar to Brainfuck. This intuitive language requires a simple grasp of two dimensional space, one requirement that almost no other programming languages have.
Has this paradigm been explored as a basis for visual programming languages? It seems like it could do a better job of handling the “density” of a program, which is often a problem in VPLs.
create x = 10;
time point;
print x; //prints 10 in first timeline, and 20 in the next
create traveler = 20;
traveler warps point{
x = traveler;
traveler kills traveler;
};
It's worth mentioning Orca[0] by Hundredrabbits, a 2-dimensional esolang which does incorporate time (and thus distance) and so is really 3-dimensional.
It's also worth checking out Extempore[1] by Andrew Sorensen and Ben Swift, which grants you have incredibly precise timing semantics at the sample level.
"Each extempore process has a scheduling engine built-in, allowing tasks to be scheduled for execution at a precise time in the future. Unlike threading constructs such as sleep() or wait(), which don’t provide strong guarantees about temporal accuracy (i.e. the time they’ll sleep/wait for), Extempore's scheduling engine is guaranteed to execute its tasks at the requested time (the number of audio samples since Extempore was started). This temporal guarantee is significant for time critical domains such as audio and graphic, and real-time systems programming."
What's cool about this is that you're able to modify the program while it's running, and only update sections of it at a time, using the editor as a scratchpad, and it supports networking so you can precisely synchronize a herd of non-local devices and do things you'd have an extremely hard time doing in other languages. The applications extend far beyond just audio and visual programming.
What both of these languages have in common is that they are designed for live coding, or as Sorensen says, cyberphysical programming. I am very interested in the marriage of these technologies and recent transformer models.
Besides Orca, Befunge, etc.. the McCulloch-Pitts Neuron is a graphical language with a discrete timestep, it solves some of the shortcomings of Orca and Recto where the evaluation has to do a lot of walking to traverse space.
It does so by creating instant connection between events across large distances.
Its inerrant parallalelism makes it also possible to do pretty complex evaluation on large canvases.
omoikane 1 days ago [-]
> No languages captures time as a dimension, yet.
Maybe not exactly, but there was one task[1] in ICFPc 2024[2] where you create programs that are laid out in 2D, and there is a special operator that causes the control flow to travel back in time. It was super fun.
I started thinking about Ven diagrams too and how that might be a useful flow control mechanism. It feels like there is a disconnect somewhere, and im not sure what it is.
1 days ago [-]
explodes 14 hours ago [-]
Amazing. I love how heptopods have a role in this. Best of luck to you and your family.
1 days ago [-]
4 days ago [-]
1 days ago [-]
hamstor 1 days ago [-]
Why the tight limit of only 2 dimensions? Seems unnecessary. A more general approach would be to support an arbitrary amount of dimensions
Mithriil 1 days ago [-]
Three cheers for the language that naturally requires a VR headset to visualize 5D tensor logic.
mlajtos 1 days ago [-]
Yes, we should store text in string tensors.
manugo4 13 hours ago [-]
Not the best name, as a spaniard
jeffreyyao 1 days ago [-]
I really enjoyed this read! Sending you support, strength and comfort to you for the days ahead
jezzamon 6 hours ago [-]
Another challenge of a language like this is git merges won't work. That was one painful part of working with Unreal's blueprints
chaostheory 1 days ago [-]
I think this is only makes sense if you have new hardware visuals like either VR or AR. It doesn’t make sense on a pancake screen
anthk 1 days ago [-]
"Straight" in Spanish. Perfect name for 2D and vectors.
f1shy 1 days ago [-]
Also ass (rectum) in spanish.
mockingloris 1 days ago [-]
Truly interesting read! @mhagiwara The article reads very well.
With the bandwidth left from parsing all that new information, all I can say is this is something. I know there's still a whole lot of figuring out to do.
(I imagine if there were peeps from other-than-earth, they'd probably communicate in a manner as this - depicted in the "Arrival" movie)
Thanks for sharing. I'll be donating a star on github and keeping watch-O
I believe I understand where the designer is coming from. Traditional languages use a 1D syntax to express a structure that is really not 1D (the parse tree). However, I don't think it's really 2D either. If you think about how an interpreter would have to proceed to execute Recto code, it would still parse it into an internal representation and then execute that, and this internal representation no longer uses the 2D layout of the code.
I'm not implying that it's a bad idea or anything. To the contrary, I think Recto is a cool idea. I'm just skeptical that simply making a language syntax two-dimensional automatically makes it easier to understand, code in, collaborate in, or implement a parser/interpreter/compiler for.
[0] https://esolangs.org/wiki/Funciton
Adding parallel execution will make it true 2D at execution time. Even though it's sequential code. More over it can be logically, architecturally 2D while being 1D from interpreter's standpoint. If it uses cooperative multitasking with 1 running task at a time. Or simply 1 core processor.
If there were any actual "in-game effect" of the rectangles — e.g. a "rotate rectangle" primitive that would change the order in which atoms were evaluated; or some meaning given to overlapping rectangles as in OgsyedIE's comment — then it would be much more interesting, because it would no longer be exactly isomorphic to Lisp/Scheme.
Anyone having a look at a musical score can conclude this is wrong.
Even when it comes to spoken language, intonation is conveying a lot, even in languages which are not classified as tonal.
All that said, that's nice to see an exploration of exotic expression form. It doesn't need to down other approach to make shine its own.
Recto, by contrast, makes two dimensions part of the syntax itself: elements and rects can expand horizontally or vertically, and they can nest recursively. That's the difference I wanted to highlight.
The reason why most people would more intuitively consider a music score as multidimensional has to do with parallelism or concurrency.
In theory, nothing is stopping you from creating a hyperarray language a la BQN++ (or dare I say QRP). Maybe I glossed over an example, but having proper pointwise application to hyperscalars feels like a must-have.
Second idea is to introduce process parallelism, which could actually make this form of syntax into an execution graph of sorts--could be quite promising!
sheet music isn't a language, it's a notation. it's just a concise way to represent a waveform (a song). and it's certainly one dimensional because you either play the song forwards or backwards.
of course not a language in the same way English or Spanish are languages, but certainly a language in the same way mathematical formula, Lisp, or Java are languages.
>certainly one dimensional
The X axis represent time and the Y axis represent pitch. Moreover, you can have multiple pitches at the same time. I'm not a musician nor a geometrician but it does seems 2D to me, in a way regular text is not.
It is mostly certainly not - the defining feature of all languages (human, formal, mathematical, programming) is that you can define new words/concepts/primitives. Sheet music is notation.
Yet they are languages according to formal language theory, a definition which I’d say is a bit more widespread than yours. Indeed what you propose roughly maps to (a subset of) context-sensitive languages in particular.
Defining new primitived isn’t really essential. What matters is what you can express with the existing primitives and grammar rules. And sheet music has been quite successful at expressing incredibly complex musical concepts just fine.
(Also there’s the fact that sheet music can contain arbitrarily complex instructions to the performer in natural language, and define new notations too. But composers usually refrain from doing that for the same reason that people don’t go around inventing new idiosynchratic words in English unless they’re SF authors.)
I love when people talk down to me as if I don't have a PhD in this shit lol. No actually what I'm talking about is Recursive languages.
> Then regex, HTML, YAML, and so on are not languages either according to your definition.
Do you see the M before the L there in both HTML and YAML? Do you know what it stands for? Markup. Markup is a funny word that colloquially means the same thing as annotate which bears a strong relationship to the word notation hmmmmmmmm.
Let me put it simply: if the force of the original comment is that context free languages can be 2d then I would say..... no duh.
written language isn't a language, it's a notation. it's just a concise way to represent a waveform (a spoken sentence). and it's certainly one dimensional because you either read forwards or backwards
Also I wonder if positional parameters would need to be replaced by named arguments.
The other meaning of "recto" is used only in medical literature or in mean jokes where you pretend to talk seriously.
I worked with teachers of other countries of Latam, sometimes in geometry problems for children. For example, it's usual "ángulo recto". I don't have it in my list of taboo or problematic words.
For example a kite-like cuadrilateral has a different names in each country, none in offensive, but you must be very cautios to ensure everyone understand the same meaning.
Also, ur kids dont understand am/pm that is usual in other countries. To avoid problems everything must be between 1:01 and 11:59.
When I look at Orca (https://100r.co/site/orca.html) I’m reminded of it, but it was definitely unique. Anyone happen to remember / have a link to a successor?
> 2003
> PATH is a programming language that is similar to Brainfuck. This intuitive language requires a simple grasp of two dimensional space, one requirement that almost no other programming languages have.
[1] https://sourceforge.net/projects/path/
[2] https://pathlang.sourceforge.net/
No languages captures time as a dimension, yet.
[1] https://esolangs.org/wiki/Esolang:Categorization#Dimensions
A time paradox from [2]:
[1] https://esolangs.org/wiki/EmiT, https://github.com/nimrag-b/emiT-C[2] https://www.reddit.com/r/ProgrammingLanguages/comments/1golf...
It's also worth checking out Extempore[1] by Andrew Sorensen and Ben Swift, which grants you have incredibly precise timing semantics at the sample level.
"Each extempore process has a scheduling engine built-in, allowing tasks to be scheduled for execution at a precise time in the future. Unlike threading constructs such as sleep() or wait(), which don’t provide strong guarantees about temporal accuracy (i.e. the time they’ll sleep/wait for), Extempore's scheduling engine is guaranteed to execute its tasks at the requested time (the number of audio samples since Extempore was started). This temporal guarantee is significant for time critical domains such as audio and graphic, and real-time systems programming."
What's cool about this is that you're able to modify the program while it's running, and only update sections of it at a time, using the editor as a scratchpad, and it supports networking so you can precisely synchronize a herd of non-local devices and do things you'd have an extremely hard time doing in other languages. The applications extend far beyond just audio and visual programming.
What both of these languages have in common is that they are designed for live coding, or as Sorensen says, cyberphysical programming. I am very interested in the marriage of these technologies and recent transformer models.
[0] https://100r.co/site/orca.html
[1] https://extemporelang.github.io/docs/overview/time/
https://www.i-programmer.info/babbages-bag/325-mcculloch-pit...
It does so by creating instant connection between events across large distances.
Its inerrant parallalelism makes it also possible to do pretty complex evaluation on large canvases.
Maybe not exactly, but there was one task[1] in ICFPc 2024[2] where you create programs that are laid out in 2D, and there is a special operator that causes the control flow to travel back in time. It was super fun.
[1] https://github.com/icfpcontest2024/icfpc2024/blob/main/stati...
[2] https://icfpcontest2024.github.io/
There are also experiments into going higher than that: https://esolangs.org/wiki/Category:Multi-dimensional_languag...
https://i.redd.it/tfd086olfoif1.jpeg
With the bandwidth left from parsing all that new information, all I can say is this is something. I know there's still a whole lot of figuring out to do.
(I imagine if there were peeps from other-than-earth, they'd probably communicate in a manner as this - depicted in the "Arrival" movie)
Thanks for sharing. I'll be donating a star on github and keeping watch-O