this post was submitted on 29 Jul 2024
5 points (100.0% liked)

Concatenative Programming

152 readers
1 users here now

Hello!

This space is for sharing news, experiences, announcements, questions, showcases, etc. regarding concatenative programming concepts and tools.

We'll also take any programming described as:


From Wikipedia:

A concatenative programming language is a point-free computer programming language in which all expressions denote functions, and the juxtaposition of expressions denotes function composition. Concatenative programming replaces function application, which is common in other programming styles, with function composition as the default way to build subroutines.

For example, a sequence of operations in an applicative language like the following:

y = foo(x)
z = bar(y)
w = baz(z)

...is written in a concatenative language as a sequence of functions:

x foo bar baz


Active Languages

Let me know if I've got any of these misplaced!

Primarily Concatenative

Concatenative-ish, Chain-y, Pipe-y, Uniform Function Call Syntax, etc.


Cheat Sheets & Tutorials

Discord

IRC

Wikis

Wikipedia Topics

Subreddits

GitHub Topics

Blogs

Practice

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] pkill 1 points 4 months ago (5 children)

how does that compare to Hy besides being more domain specific and the order of operations (prefix vs suffix notation)?

[–] Andy 1 points 4 months ago (1 children)

I've never used Hy. Does it offer any concatenative-style interaction?

[–] pkill 2 points 4 months ago (1 children)

it's uses standard lispy operator-operands order see https://learnxinyminutes.com/docs/hy

[–] Andy 1 points 4 months ago (1 children)

So it looks like a totally different data flow style, and (I think) geared toward writing then running programs, whereas Stacker is more for interactive stack-oriented calculator tasks.

[–] pkill 1 points 4 months ago (1 children)

lisps are very repl-driven too

[–] Andy 1 points 4 months ago

I'd say an important part of this calculator's interaction model is doing something, getting a result, then doing something else to that result. That's not too bad in the regular Python interpreter either.

For example, in Python:

>>> 5
5
>>> 4 + _
9
>>> 2 * _
18

In Stacker:

>>> 5
[5]
>>> 4 +
[9]
>>> 2 *
[18]

Does Hy have something like the Python interpreter's _?

load more comments (3 replies)