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
76
 
 

I'm adding it to the sidebar under practice.

I was alerted to it via this nice blog post with a solution in Factor.

I'll put up at least a few Factor solutions of my own at a tiny repo, and am happy to answer any questions or take any advice about them.

Here's another link to the challenges

77
2
submitted 11 months ago by Andy to c/concatenative
78
79
4
A Forth Vocabulary for Iteration (blog.information-superhighway.net)
submitted 11 months ago by Andy to c/concatenative
 
 
80
4
submitted 11 months ago by Andy to c/concatenative
 
 

...

Factor ... scales horribly both with respect to lines of code per word (function) and the amount of local state (number of variables). This is because local state is manipulated on a stack which you have to keep track of in your head. ...

So instead you're constantly having to come up with neat composable abstractions to fold up the state. This is the sort of thing that makes code elegant, loosely coupled and small in any language. ...

...

81
82
7
Advent of Code 2023 (programming.dev)
submitted 1 year ago by Andy to c/concatenative
 
 

It's just about time! Huzzah!

I'll collect links and resources here:

I'll probably only last the first few days, optimistically a week, but plan on submitting my solutions in Factor to the AoC community, and I'll link any of those here in the comments.

silly dino picture 1

silly dino picture 2

silly dino picture 3

silly dino picture 4

83
84
2
submitted 1 year ago by Andy to c/concatenative
85
86
87
2
submitted 1 year ago by Andy to c/concatenative
88
89
2
submitted 1 year ago by Andy to c/concatenative
90
91
92
 
 

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

93
 
 

Hello everyone,

I’m excited to introduce the alpha release of kcats, a fresh take on stack-based programming languages, inspired by the language Joy, designed with simplicity, learnability, and functionality in mind.

Our aim with kcats is to make it easier for anyone to write short programs for personal automation tasks. We believe that existing languages require learning too many specialized functions and concepts. Kcats addresses these issues by offering a streamlined alternative. Originally conceived as a scripting language for a forthcoming messaging protocol, it’s useful for general programming as well.

Key features of kcats:

Simplicity: kcats emphasizes fewer, general-purpose tools instead of a complex array of specialized ones. Its syntax uses words and bracket quotation marks [ and ], and no other symbols. It uses a few simple programming concepts including stacks, lists, functions, and pipes.

Introspective: The documentation, examples, and even the entire state of a running program, are data that can be queried and processed with the language itself. Kcats is its own debugger.

Powerful and Versatile: Despite its simplicity, kcats is designed to be a powerful tool capable of handling a wide range of programming tasks. The tools programmers use in other languages are there, and built from simple primitives - closures, error handling, metaprogramming, multithreading, channels, generators, i/o, and serialization.

A Focus on Tooling: kcats intends to make tool development, including IDEs and debuggers, as easy as possible.

As this is the alpha release, we eagerly welcome all feedback, contributions, and constructive criticisms from the community. We’re especially interested in improving the documentation and learning experience.

Join us in exploring this new language and contribute to making programming more accessible to everyone. Your feedback is essential to making it intuitive and easy to use!

Please check out our docs and alpha release here: https://github.com/skyrod-vactai/kcats

Happy coding!

Best, Skyrod

94
 
 

I personally can't stand Discord, but for now it's getting some concatenative action, so I've signed up again.

When I'm at a computer I'll add this to the sidebar.

95
 
 

In case that link changes, the main site is https://inet.run/

I just started reading and don't yet know about the advantages and trade-offs of a design like this.

96
8
Factor 0.99 Released! (re.factorcode.org)
submitted 1 year ago by Andy to c/concatenative
 
 

It's been a long time coming, and here it is: a new stable Factor release with years of improvements to enjoy.

For those who don't know:

Factor is a concatenative, stack-based programming language with high-level features including dynamic types, extensible syntax, macros, and garbage collection. On a practical side, Factor has a full-featured library, supports many different platforms, and has been extensively documented.

The implementation is fully compiled for performance, while still supporting interactive development. Factor applications are portable between all common platforms. Factor can deploy stand-alone applications on all platforms. Full source code for the Factor project is available under a BSD license.

97
 
 

The first challenge from programming.dev's new challenges community has been posted (and so has my amateur Factor solution).

I hope to see more concatenative solutions posted, and welcome any critical feedback on any of the Factor bits I submit there.

98
 
 

Forth, too.

Unfortunately it uses the stable Factor release 0.98 which is a bit old, but I know Factor is heading toward a new release soon, which is probably a prerequisite to updating the runtime on Codewars.

Anyway the little exercises help me get to know the language, and then when I see others' solutions I get to see how badly I've done things and what cool library words I should learn next.

Anyone else using a concatenative language on an exercises-type site like this, especially where other solutions in the same language can be shared?

99
 
 

Hello!

I requested the creation of this space because I have a real interest in (and ignorance of) concatenative programming, both the programming languages and tools that fundamentally require that pattern as well as the ones that enable it (or something similar, like ARG1 FUNC ARG2 syntax) in big or small ways here and there.

Examples of the former category include:

Examples of the latter include:


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


This space is meant for sharing news, experiences, announcements, questions, showcases, etc. regarding these topics and tools.


Related: