Concatenative Programming

144 readers
4 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
51
 
 

Just because Exercism doesn't offer your favorite language as an official track, it doesn't mean we can't play at all. Post some solutions to the weekly challenges in the language of your choice!

52
 
 

Copied from the project's readme:


Introduction

Scale is a procedual and object oriented concatenative stack oriented compiled programming language inspired by Lua and Porth.

The Compiler is a source-to-source compiler, as it converts your source code to valid C code, that is then compiled by Clang.

Scale supports both 32-bit and 64-bit systems, but 64-bit is strongly recommended.

Examples

Examples can be found in the examples directory.

Installation

Run the following commands:

$ clang++ install-sclc.cpp -o install-sclc -std=gnu++17
$ ./install-sclc

Documentation

A list of all features can be found here.

The Scale Framework documentation can be viewed by running the following command:

$ sclc -doc-for Scale
53
 
 

Copied from the project's readme:


  • blacklight is a programming language which is concurrent, stack-based, and concatenative (BLPL)

  • blacklight is a virtual machine for implementing highly concurrent languages (BLVM)

  • blacklight is a data interchange format for communicating between processes and across networks (BLBC)

Features

blacklight (BLVM) is awesome, here's a few reasons why:

  • easy to use builtin parallelism through native concurrency primatives
  • threadsafe communication between concurrency units
  • rich datatype primitives
  • an easy to use homoiconic Forth-like assembly language (BLPL)
  • runtime bytecode manipulation and generation
  • UTF-8 native datatypes
  • multi-architecture and cross-platform (currently: x86_64, ARM, macos, linux, windows)
  • (in progress) highly optimized vector operations on supported CPUs
  • (planned) security contexts and permissions

Documentation

BLPOC

The current implementation of blacklight is a proof-of-concept. It's functional but intended primarily for proving out features, strategies, and specifications. Once The ABI is stable it will be reimplemented with optimization and compatibility in mind against a full test suite. As is, there is very little about blacklight that isn't subject to change to better reflect the results of research and experimentation.

54
 
 

A new wiki page has been started to show case example programs in various catlangs.

55
 
 

From the homepage:

Rye is a high level, homoiconic dynamic programming language based on ideas from Rebol, flavored by Factor, Linux shell and Go. It's still in development, but we are focused on making it useful as soon as possible.

It's written in Go and could also be seen as Go's scripting companion as Go's libraries are very easy to integrate, and Rye can be embedded into Go programs as a scripting or a config language.

I believe that as a language becomes higher level it starts bridging the gap towards user interfaces. Rye has great emphasis on interactive use (Rye console) where we intend to also explore that.

56
 
 
57
58
59
60
 
 

Hey that's me! No, not the amazing Factor dev that authored this post. No, not the contributor who jumped in and saved the day. I'm the

one of the members of the Factor Discord server

who complained about numbers! Woohoo!

61
62
 
 
63
 
 

Parsing!

64
65
66
 
 

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

67
 
 

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

68
69
 
 

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

70
71
72
 
 
73
 
 

...

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

...

74
75
 
 

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

view more: ‹ prev next ›