Concatenative Programming

168 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 2 years ago
MODERATORS
1
 
 

I really don't know what to make of this.

Recent post on lobsters: https://lobste.rs/s/ctzngb/cosy

2
3
 
 

This popped up on Hacker News

https://news.ycombinator.com/item?id=43503897

4
5
6
7
8
 
 

Not my project, just sharing it.

demo

9
10
11
12
13
14
15
16
2
submitted 2 months ago* (last edited 1 month ago) by [email protected] to c/[email protected]
17
2
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]
 
 

Copied from the release notes:

We're starting with a new release approach, these files will stay available permanently in contrast to the latest nightly.

We now recommend most users to stick to 0.0.0-alpha releases instead of nightly-latest.

This current release is based on commit a089cf2 from the 6th of January 2025. These files are identical to nightly-latest published on the 7th of January 2025.


EDIT: A whole lot more detail in the new 0.0.0-alpha2-rolling release

18
19
 
 

Discussion on lobsters

20
21
22
23
24
25
14
submitted 4 months ago* (last edited 4 months ago) by [email protected] to c/[email protected]
 
 

Alright, show me I'm not the only one in this community, and show off some solutions!

Here's my Day 1 solution in Factor (minus imports):

spoiler

: get-input ( -- left-list right-list )
  "aoc-2024.01" "input.txt" vocab-file-lines
  [ split-words harvest ] map unzip
  [ [ string>number ] map ] bi@ ;

: part1 ( -- n )
  get-input
  [ sort ] bi@
  [ - abs ] 2map-sum ;

: part2 ( -- n )
  get-input
  histogram
  '[ dup _ at 0 or * ] map-sum ;

Sadly, Factor doesn't get highlighted properly here, so here it is again as an image:

spoiler

syntax-highlighted screenshot of the code above

I probably won't last the week, but what solutions I do have will be up on GitHub.

view more: next ›