Questions tagged [concatenative-language]

Concatenative-programming languages are those in which function composition is expressed as juxtaposition, are point-free, and all expressions denote functions. Well known examples of concatenative languages are PostScript, Forth, Factor and Joy.

A concatenative programming language is a point-free 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.

They have minimal syntax and simple semantics, tend to be concise, and put emphasis on code over values.

The term was coined by Manfred von Thun to describe his language Joy, but some consider Forth as the first concatenative language.

Most languages described as concatenative are stack-based languages such as Forth, Joy, PostScript or Factor. Some concatenative languages that are not stack-based exist too, such as Enchilada, Om, and XY.

Wikipedia page

concatenative.org

17 questions
28
votes
7 answers

Explain concatenative languages to me like I'm an 8-year-old

I've read the Wikipedia article on concatenative languages, and I am now more confused than I was when I started. :-) What is a concatenative language in stupid people terms?
Jason Baker
  • 171,942
  • 122
  • 354
  • 501
19
votes
8 answers

Real world usage of concatenative programming languages

What are some real-world projects done in concatenative languages like Forth, Factor, Joy, etc.?
Vijay Mathew
  • 25,329
  • 3
  • 54
  • 90
14
votes
2 answers

Role of combinators in concatenative/tacit programming languages

What exact role do higher-order combinators (or function producers) hold in concatenative and tacit programming? Is there another way to implement a concatenative programming language rather than directly manipulating the stack? How tight is the…
Bubba88
  • 1,860
  • 19
  • 41
9
votes
2 answers

Row polymorphism in Haskell: trouble writing Forth DSL with "transformations"

I've been inspired by the recent Haskell blog activity1 to try my hand at writing a Forth-like DSL in Haskell. The approach I have taken is simultaneously straightforward and confusing: {-# LANGUAGE TypeOperators, RankNTypes, ImpredicativeTypes…
7
votes
3 answers

Lisp influence on on Factor programming language?

I have read (from Slava Pestov) that Factor was influenced by Lisp, but I am not sure that I can understand how? Are they not very difference programming languages?
Eli Schneider
  • 4,717
  • 3
  • 24
  • 50
6
votes
1 answer

callstack? retainstack? namestack?

This page of the Factor manual talks about these types of stacks stored in continuations: datastack retainstack callstack namestack catchstack What precisely do these stacks hold? The three most confusing for me are the callstack, retainstack and…
Pubby
  • 48,511
  • 12
  • 121
  • 172
5
votes
2 answers

Making a concatenative Haskell variant: precedence of application and composition

I'm learning the basics of concatenative languages, whose original idea is that function name concatenation is the same as function composition, instead of being function application as in Haskell. Joy, Forth or Factor are postfix, which means…
4
votes
0 answers

Could an Applicative Language use Postfix Notation?

I've always found postfix languages like Factor to be far more readable than prefix (Lispy languages) and infix/postfix languages (all C-style languages, if we include both operators and functions). Unlike prefix languages, you don't need for…
Louis
  • 2,216
  • 1
  • 15
  • 15
4
votes
3 answers

Concatenative language interpreter in Java

I'm interested in finding a concatenative language interpreter in Java. Ideally, it should satisfy the following conditions: It has an interpreter, not (only) a bytecode compiler for JVM. The language itself has decent documentation, not only a few…
Vojislav Stojkovic
  • 7,735
  • 4
  • 33
  • 47
4
votes
0 answers

Obtaining a Factor binary... still possible with the Factorcode.org website down?

UPDATE (12-Mar-2014): All sites are back: factorcode, planet-factor, builds.factorcode, and concatenative. Downloads are back. Looks like the sites were moved to a different host (Rackspace?) and quite significantly revamped. (This can question…
Assad Ebrahim
  • 5,768
  • 7
  • 39
  • 66
3
votes
4 answers

Could a concatenative language use prefix notation?

Concatenative languages have some very intriguing characteristics, such as being able to compose functions of different arity and being able to factor out any section of a function. However, many people dismiss them because of their use of postfix…
2
votes
1 answer

Partial Function Application in Concatenative Programming Languages

Say I have a haskell function f n l = filter (n<) l where it takes an integer n and list l and returns all of the integers in l greater then n. I'm trying to figure out how to best write this function in a language like Joy. I've generally had good…
Zylviij
  • 198
  • 3
  • 9
2
votes
2 answers

Can a Forth-like language be implemented with just one stack?

Forth has a stack and a return-stack. As far as I understand, the point of the return-stack is to store the previous values of the program counter. C programs put the previous value of program counter on the stack, and use no return stack. Does…
fadedbee
  • 37,386
  • 39
  • 142
  • 236
2
votes
2 answers

Input quotation to loop doesn't match expected effect

I'm trying to write a text editor to mimic the input format of ed. In ed, you write your input one line at a time and finish when you input a single . on a line. Here's what I came up with: 0 [ [ readln [ "." = not ] keep swap ] dip 1 + swap ]…
user1610406
  • 672
  • 1
  • 11
  • 23
2
votes
1 answer

How to represent a performant heterogenous stack in Julia

I would like to implement a simple concatenative language (aka Joy or Factor) as a DSL in Julia and I am troubled how to optimally represent the stack. The stack, which represents both data and program code, should be able to hold a sequence of…
Bernd
  • 227
  • 2
  • 5
1
2