Concatenative Programming

127 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 11 months ago
MODERATORS
1
2
3
4
4
submitted 2 weeks ago by Andy to c/concatenative
5
4
submitted 2 weeks ago by Andy to c/concatenative
6
4
submitted 3 weeks ago* (last edited 3 weeks ago) by Tushta to c/concatenative
 
 

I wanted to map over a nested array in factor so I created a helper function:

: nested-map ( a quote -- a' ) swap [ over map ] map nip ;

which i then called with

{ { 1 2 } { 3 4 } } [ 1 + ] nested-map

But when I call it I get the error from the title.

If I just paste the body of the function it works as intended:

{ { 1 2 } { 3 4 } } [ 1 + ] swap [ over map ] map nip

So I guess I have two questions: is there a better way to achieve the original goal, but also how am I supposed to create higher order functions without getting this error?

7
2
Magic Forest | Re: Factor (re.factorcode.org)
submitted 3 weeks ago by Andy to c/concatenative
8
 
 
9
7
Man or Boy | Re: Factor (re.factorcode.org)
submitted 1 month ago by Andy to c/concatenative
10
 
 

I'm posting this mostly for the new hacker news discussion: https://news.ycombinator.com/item?id=40736174

11
4
F: Functional False (www.nsl.com)
submitted 1 month ago* (last edited 1 month ago) by Andy to c/concatenative
 
 

F is a pure functional concatenative language originally designed as an extension of False. F contains the list-operations of K3 and the dip combinator of Joy. Floating-point and symbolic datatypes are supported. One-time assignment is enforced in syntax. A theory of function-valence and -charge is outlined. F also contains a general continuation primitive $, and the pattern sublanguage of XY. G is a variant of F in which the K3 adverbs are implemented as primitives.

Discussion on lobsters: https://lobste.rs/s/m9xv5y/f_functional_false

12
9
Quit | Re: Factor (re.factorcode.org)
submitted 1 month ago by Andy to c/concatenative
 
 

Factor gains a quit function (and preserves history)!

13
 
 

This is already in the sidebar, but now there's a fresh post on Lobsters, so maybe some good discussion will come of it.

14
 
 
15
16
17
6
Bend | Re: Factor (re.factorcode.org)
submitted 1 month ago by Andy to c/concatenative
18
19
4
Transducers | Re: Factor (re.factorcode.org)
submitted 1 month ago by Andy to c/concatenative
20
5
0.1 + 0.2 | Roc (rtfeldman.com)
submitted 1 month ago* (last edited 1 month ago) by Andy to c/concatenative
 
 

Discussion on lobsters: https://lobste.rs/s/oxjvv0/0_1_0_2

It's not that Roc only supports base-10 arithmetic. It also supports the typical base-2 floating-point numbers, because in many situations the performance benefits are absolutely worth the cost of precision loss. What sets Roc apart is its choice of default; when you write decimal literals like 0.1 or 0.2 in Roc, by default they're represented by a 128-bit fixed-point base-10 number that never loses precision, making it reasonable to use for calculations involving money.

In Roc, floats are opt-in rather than opt-out.

21
4
Deep Clone | Re: Factor (re.factorcode.org)
submitted 1 month ago by Andy to c/concatenative
22
7
submitted 2 months ago by Andy to c/concatenative
23
6
submitted 2 months ago by Andy to c/concatenative
24
5
Argument Parser | Re: Factor (re.factorcode.org)
submitted 2 months ago by Andy to c/concatenative
25
view more: next ›