this post was submitted on 19 Sep 2023
4 points (100.0% liked)

Concatenative Programming

147 readers
2 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
 

It also supports Forth and Nim, which can be written in a somewhat concatenative style, too.

you are viewing a single comment's thread
view the rest of the comments
[–] Andy 2 points 1 year ago

To celebrate, here's my crappy Fizz Buzz solution!

USING: io kernel math.functions math.parser ranges sequences ;

100 [1..b] [ 
  dup [ 3 divisor? ] [ 5 divisor? ] bi 2dup or [ 
    [ drop ] 2dip 
    [ "Fizz" "" ? ] [ "Buzz" "" ? ] bi* append 
  ] [ 2drop number>string ] if
  print 
] each

And for comparison: a Fizz Buzz walkthrough post from Factor dev John B.