TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why concatenative programming matters (2012)

76 pointsby codewithcheesealmost 3 years ago

11 comments

layer8almost 3 years ago
The ergonomic drawback of concatenative languages is that when you see `a b c d e`, you don’t know whether it means `e(d(c(b(a))))`, or `e(b(a), d(c))`, or `e(a, b, c, d)`, or `b(a), e(c, d)`, etc. The answer depends on the types of a, b, c, d, and e. The syntax `a b c d e` is a linearization of the call tree, whose node structure can be recovered from the types of the symbols (assuming the language is statically typed). As a human reader, it means you have to know the types to understand the structure of the expression. This imposes a cognitive load that other types of languages don’t.<p>It also removes redundancy that can be helpful to prevent programming errors. While the type checker verifies that the types match <i>a</i> structuring of the expression, that derived structure is not directly visible to the human programmer, and the programmer cannot easily see whether it actually matches the programmer’s understanding.
评论 #32127154 未加载
评论 #32127886 未加载
评论 #32126581 未加载
评论 #32126374 未加载
评论 #32127390 未加载
BaseballPhysicsalmost 3 years ago
I completely disagree with this analysis:<p>&gt; The reason “Why Functional Programming Matters” was necessary in the first place was that functional programming had been mischaracterised as a paradigm of negatives—no mutation, no side-effects—so everybody knew what you couldn’t do, but few people grasped what you could.<p>The issue with functional programming, and the reason for that referenced piece, aren&#x27;t because people don&#x27;t know what you can do with functional programming languages.<p>It&#x27;s because people don&#x27;t know why they should <i>care</i>.<p>Things like &quot;immutability, referential transparency, mathematical purity&quot; are pretty, and it&#x27;s neat to see the machinery applied in practice, but in the end people pick their tools because they help them get their jobs done more effectively, and it&#x27;s exceedingly difficult to explain to a working programmer why &quot;referential transparency&quot; is gonna meaningfully improve their lives.<p>This piece, then, starts from this basic misunderstanding and proceeds to make precisely the same mistake.<p>Yes, what the author demonstrates in this piece is pretty neat. But why should I <i>care</i>? What would motivate me to move off of the imperative languages I&#x27;m already familiar with?
评论 #32127406 未加载
评论 #32128618 未加载
moominalmost 3 years ago
I can understand why people get excited about the concatenative paradigm, but I’ll concede that my personal take is “Sounds like some bits of LISP married to the point free obsession of some Haskell programmers”
评论 #32125794 未加载
评论 #32129680 未加载
zetalyraealmost 3 years ago
If you&#x27;re interested, this article by Henry Baker draws a connection between permutation stack machines and linear types&#x2F;GC-free memory management: &quot;Linear Logic and Permutation Stacks--The Forth Shall Be First&quot;<p><a href="https:&#x2F;&#x2F;www.plover.com&#x2F;~mjd&#x2F;misc&#x2F;hbaker-archive&#x2F;ForthStack.html" rel="nofollow">https:&#x2F;&#x2F;www.plover.com&#x2F;~mjd&#x2F;misc&#x2F;hbaker-archive&#x2F;ForthStack.h...</a>
carapacealmost 3 years ago
I didn&#x27;t see it linked from the article, Jon Purdy has a great talk about this too: &quot;Concatenative Programming: From Ivory to Metal&quot; (2017) <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_IgqJr8jG8M" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_IgqJr8jG8M</a><p>There&#x27;s also &quot;A Conversation with Manfred von Thun&quot; <a href="http:&#x2F;&#x2F;archive.vector.org.uk&#x2F;art10000350" rel="nofollow">http:&#x2F;&#x2F;archive.vector.org.uk&#x2F;art10000350</a> which is worth reading (IMO) if you&#x27;re interested in concatenative languages. He&#x27;s the creator of Joy.<p>I&#x27;ve been working with Joy over the last few years now and I really think there&#x27;s something there. It seems to combine the best features of both Forth and Lisp.
评论 #32129513 未加载
avgcorrectionalmost 3 years ago
Author ended up doing a lot of work on Kitten <a href="https:&#x2F;&#x2F;github.com&#x2F;evincarofautumn&#x2F;kitten" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;evincarofautumn&#x2F;kitten</a>
vitiralalmost 3 years ago
I&#x27;m writing a concatenative language with a C-similar syntax. As a first language (to write) I&#x27;ve found it very pleasant. Following the forth models, I start with an extremely lean (~2000 lines of C) VM and assembly and that builds a macro-based language in a few thousand lines -- all in a single build+execute step.<p>I&#x27;m currently implementing function syntax, and the type system will be next (also C like with a bit of interface-like &quot;Role&quot; objects and type extension)<p>GitHub.com&#x2F;civboot&#x2F;fngi
iostream25almost 3 years ago
<a href="https:&#x2F;&#x2F;www.concatenative.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.concatenative.org&#x2F;</a> might be interesting for some folks
ameliusalmost 3 years ago
Sounds like something you&#x27;d rather not work in directly, but could be useful as an intermediate representation for a compiler (?)
评论 #32126188 未加载
iostream25almost 3 years ago
Great stuff, this is a different approach than the FORTH books provide, and I suspect it may open other doors.
adastra22almost 3 years ago
2012