<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/spatial-languages-writing-code-in-2d-0snsdjawk" -->

---
title: Spatial languages: writing code in 2D | daily.dev
description: An exploration of 2D spatial programming languages, introducing a custom operator `@@` (andFlip) that uses vertical operands to express true 3-arity infix...
canonical: https://daily.dev/posts/spatial-languages-writing-code-in-2d-0snsdjawk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Spatial languages: writing code in 2D | daily.dev
og:description: An exploration of 2D spatial programming languages, introducing a custom operator `@@` (andFlip) that uses vertical operands to express true 3-arity infix...
og:url: https://daily.dev/posts/spatial-languages-writing-code-in-2d-0snsdjawk
og:image: https://api.daily.dev/og/posts/0SNSDJawK.png
og:image:alt: Spatial languages: writing code in 2D
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Spatial languages: writing code in 2D

**[Hacker News](https://daily.dev/sources/hn)** · 10 min read · 0 upvotes · 0 comments

## Summary

An exploration of 2D spatial programming languages, introducing a custom operator `@@` (andFlip) that uses vertical operands to express true 3-arity infix notation. The post walks through quantum computing concepts like uncomputation and borrowed ancilla qubits, showing how a 3-bit ripple-carry adder can be expressed as a single self-cleaning 2D expression. It also surveys existing 2D languages including Befunge, Orca, Racket's #2dcond, Hexagony, and ladder logic, arguing that expanding code into two dimensions unlocks cleaner representations for certain computational patterns.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://shukla.io/blog/2026-07/cccx.html>

## Community take

How the wider developer community reacted, aggregated from 2 discussions and 65 comments across hackernews, lobsters (as of 2026-07-25).

**TL;DR:** The community finds the 2D expression idea intellectually playful but largely impractical, with most commenters arguing that text is already richer than '1D' and that 2D layouts introduce more constraints than they solve. A minority are genuinely intrigued and point to real precedents like Befunge, Orca, and visual/dataflow languages.

**Sentiment:** 35% positive · 45% mixed · 20% skeptical

**The case for**

- Precedents like Befunge, Orca, and FPGA/dataflow environments show 2D code can work in constrained domains.
- Agda's mixfix operators and Epigram's natural-deduction syntax demonstrate that higher-arity, multi-dimensional notation has real academic traction.
- The exercise is a useful 'see the world differently' prompt even if it doesn't scale.

**The pushback**

- Text is already effectively n-dimensional (lines, indentation, files, modules), so calling it '1D' is a false premise.
- 2D layout introduces O(n²) constraints around positioning, line crossings, and screen real estate that grow faster than the expressiveness gained.
- The demo examples are trivially simple and commenters doubt it would survive contact with real algorithms like quicksort.
- The Sapir-Whorf justification is seen as a stretch since that hypothesis concerns vocabulary/concepts, not spatial layout.

**By community**

- hackernews (mixed): Dominated by a substantive debate over whether text is truly '1D' and whether 2D layouts add or remove expressive power, with skeptics slightly outnumbering enthusiasts.
- lobsters (positive): Smaller, more constructive thread; commenters engage with specific technical details (ternary operators, Agda mixfix, Befunge) and the author participates, keeping the tone collegial.

**Hottest debate:** Whether text is genuinely '1D' and therefore limiting, or already encodes multiple dimensions through indentation, line structure, and modularity — making '2D code' a step backward rather than forward.

**Open questions**

- Can a 2D syntax scale to non-trivial algorithms (e.g., quicksort) without becoming a layout nightmare?
- Is there a formal grammar/parser story for 2D languages that matches the maturity of 1D parsers?
- How would 2D code be spoken aloud or navigated by tooling (search, refactoring, version control)?

**Highlights**

> "All this time we’ve been writing expressions in 1D space, but what happens when we unlock an extra dimension?" Text is a serialization of an n-dimensional work space. "N-dimensional" doesn't have a formal definition I'm aware of but the major characteristic of it is that a new dimension can pop up anywhere. If you feel like you want to double-click on that, you can see my earlier comment here: https://news.ycombinator.com/item?id=35096647 A conventional textual language can represent everything mentioned there, whereas 2D layouts struggle almost immediately to represent things that textual layouts represent quite easily. It can still be a useful "see the world differently" exercise, but it's the opposite of "freeing your mind"... it's stepping into a fairly small subset of functionality, albeit an unconventional one, and seeing what you can still manage to do even so. Rather than "unlocking a new dimension" it's actually throwing away n-2 of them. The experience of using this for any period of time would reveal this, as it would be a constant struggle to represent even very simple algorithms in this format. I post this mostly because of the "familiarity breeds contempt" effect that programmers seem to get hit with for text. There is a reason we use text and it's not lack of imagination or being stuck in our ways... it is actually an incredibly rich and powerful format that poses a serious challenge for any alternative to overcome because of the astonishing combination of compactness combined with representational power.
> — [jerf on hackernews · 4 comments](https://news.ycombinator.com/item?id=49048016)

> The problem with a "2D" text is that you think in your head that there's all these amazing possibilities that you're creating, when in fact you're taking on vastly more constraints. For a sort of simple analog to that, observe the number and nature of the Platonic Solids in various dimensions, and observe that despite the fact that the increasing number of dimensions might strike you as making it obvious that higher dimensions should have more and more Platonic solids, the number of constraints increases faster than the degrees of freedom do, and instead you get the same degenerate set of solids in 5+ dimensions, forever. Visual programming, another ever-recurring supposed replacement for text that is just obviously so much better and programmers are just stupid for sticking to plain and boring text, has a similar problem, where in return for whatever visual organization it makes possible (but does not force, since you can still make stupid visual programs) it is countered by the annoyance of suddenly having so many more constraints on the program, like, having to worry about layout, and how the lines cross each other, and whether some part of the program is literally overlapping another, and how all these concerns tend to grow as O(n^2) on the number of elements if not confined somehow. This one has led to some modest success in certain limited environments, but as a replacement for textual programming it fundamentally flounders on the fact that its additional constraints creates problems significantly faster than it can solve problems.
> — [jerf on hackernews](https://news.ycombinator.com/item?id=49051595)

> Agda supports [mixfix operators/functions](https://agda.readthedocs.io/en/latest/language/mixfix-operators.html) using _ as a place-holder for argument positions like `if_then_else_`. They wrote a paper about [parsing mixfix operators](https://www.cse.chalmers.se/~nad/publications/danielsson-norell-mixfix.pdf). There’s what Guy Steele called “[computer science metanotation](https://www.youtube.com/watch?v=7HKbjYqqPPQ)” which has a more two-dimensional flavour than normal programming, especially when it uses Gentzen-style natural deduction. The dependently typed language Epigram uses natural deduction horizontal lines in its syntax, which looks quite fun in published papers but it didn’t catch on.
> — [fanf on lobsters · 3 points](https://lobste.rs/s/gb2xwu/spatial_languages_writing_code_2d#c_oimywm)

> This is cute, and it’s fine and fun to play around, but I don’t know, takes itself way too seriously or something. I apologize for being negative, but blowing my mind? No, not exactly. The attempt at the end to justify isn’t compelling to me and feels pretentious or something; the so-called Sapir-Whorf hypothesis (a misnomer according to the link) is about words and concepts, not about layout. This article fails to consider how to say or to read 2D code, or even think about why text is normally 1D. Language is expressed in one dimension because of time. We don’t speak in 2D, because we can’t, therefore we don’t write in 2D. We do visualize parse trees as trees (2D pictures) all the time, which isn’t mentioned. Also not mentioned are all the massive downsides of trying to write & edit & maintain 2D code, as well as the fact that we have good ways to write 3+ argument functions in 1D. Nitpick - the andFlip function is wasting a whole dimension with unnecessary lines, and also modifying its input argument unnecessarily (yuck!), and it takes 3 arguments as an array for no good reason. Better: andFlip = lambda a,b,c : not c if (a and b) else c Except this is really just a normal 2 argument ternary, it does nothing interesting with a or b individually, it treats them as a unit, so I’d argue this shouldn’t even be a function.
> — [dahart on hackernews](https://news.ycombinator.com/item?id=49048524)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=49007018) · 58 points · 57 comments
- [lobsters](https://lobste.rs/s/gb2xwu/spatial_languages_writing_code_2d) · 15 points · 8 comments

## Similar posts on daily.dev

- [Why 2D Trapped-Ion Quantum Computers Could Be Easier to Scale Than 1D Architectures](https://daily.dev/posts/why-2d-trapped-ion-quantum-computers-could-be-easier-to-scale-than-1d-architectures-ecesjub0z) · freeCodeCamp · 0 upvotes · 0 comments
- [Fault-tolerant quantum computation without distillation on a 2D device](https://daily.dev/posts/fault-tolerant-quantum-computation-without-distillation-on-a-2d-device-yjk6vahxj) · Nature · 0 upvotes · 0 comments
- [Inverse Sapir-Whorf and programming languages](https://daily.dev/posts/inverse-sapir-whorf-and-programming-languages-kncou0ijt) · Planet Python · 0 upvotes · 0 comments
- [Things I want in a modern relational query language](https://daily.dev/posts/things-i-want-in-a-modern-relational-query-language-y0qgepv3u) · Lobsters · 1 upvotes · 0 comments
- [A Neighborhood of Infinity: Self-referential logic via self-referential circuits](https://daily.dev/posts/a-neighborhood-of-infinity-self-referential-logic-via-self-referential-circuits-vo8lxmeip) · Planet Haskell · 0 upvotes · 0 comments

---

Tags: [#quantum-computing](https://daily.dev/tags/quantum-computing), [#qiskit](https://daily.dev/tags/qiskit)

[View this post on daily.dev](https://daily.dev/posts/spatial-languages-writing-code-in-2d-0snsdjawk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Spatial languages: writing code in 2D","url":"https://daily.dev/posts/spatial-languages-writing-code-in-2d-0snsdjawk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/spatial-languages-writing-code-in-2d-0snsdjawk"},"datePublished":"2026-07-25T15:46:29.242Z","dateModified":"2026-07-25T21:28:47.859Z","description":"An exploration of 2D spatial programming languages, introducing a custom operator `@@` (andFlip) that uses vertical operands to express true 3-arity infix...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ab5512113075f20dca9f0d31198a706a?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ab5512113075f20dca9f0d31198a706a?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/spatial-languages-writing-code-in-2d-0snsdjawk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"quantum-computing,qiskit","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Spatial languages: writing code in 2D"}]}
```

