Concatenative Programming

95 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

Primarily Concatenative

Somewhat Concatenative


Cheat Sheets & Tutorials

Discord

IRC

Wikis

Wikipedia Topics

Subreddits

GitHub Topics

Blogs

Practice

founded 1 year ago
MODERATORS
1
 
 

I don't have the OS to play with this, but it looks fun!

From Wikipedia:

Prograph is a visual, object-oriented, dataflow, multiparadigm programming language that uses iconic symbols to represent actions to be taken on data. Commercial Prograph software development environments such as Prograph Classic and Prograph CPX were available for the Apple Macintosh and Windows platforms for many years but were eventually withdrawn from the market in the late 1990s. Support for the Prograph language on macOS has recently reappeared with the release of the Marten software development environment.

link

2
 
 

I think pipeline-oriented tooling is relevant enough for this community (is this thing on?).

A PRQL query is a linear pipeline of transformations

It compiles to plain SQL, but queries generally start with a table.

Each line of the query is a transformation of the previous line’s result. This makes it easy to read, and simple to write.

PRQL consists of a curated set of orthogonal transformations, which are combined together to form a pipeline. That makes it easy to compose and extend queries. The language also benefits from modern features, such syntax for dates, ranges and f-strings as well as functions, type checking and better null handling.

link

3
4
 
 

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

5
6
7
 
 
8
 
 

...

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. ...

...

9
10
 
 

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

11
12
13
14
15
16
17
18
19
20
 
 

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

21
 
 

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

22
 
 

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.

23
 
 

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.

24
 
 

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.

25
 
 

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.

view more: next ›