June 19th, 2024

F (2006)

F is a functional concatenative language with K3 list operations and Joy's dip combinator. It enforces one-time assignment, supports floating-point and symbolic datatypes, and emphasizes function-valence and -charge theories. The language is purely functional, prohibiting side-effects and reassignment, with various primitives for arithmetic, logic, and list operations. F also provides interactive commands for debugging and manipulation, focusing on simplicity, efficiency, and functional programming paradigms.

Read original articleLink Icon
F (2006)

F is a pure functional concatenative language that extends False, incorporating K3 list operations and Joy's dip combinator. It supports floating-point and symbolic datatypes with one-time assignment enforced in syntax. The language emphasizes function-valence and -charge theories, featuring a general continuation primitive and a pattern sublanguage. F is concatenative and purely functional, prohibiting side-effects and reassignment. All K verbs are implemented, with primitives denoted by single symbols for mnemonic purposes. Datatypes in F involve an initial state with an environment, stack, and queue, processed iteratively until the queue is empty. The language includes various primitives for arithmetic, logic, and list operations, along with system functions and literals. F also offers interactive commands for debugging and manipulation, such as trace, load, and store. Stack and queue manipulation programs are available, allowing for efficient stack and queue operations. F's design emphasizes simplicity, efficiency, and functional programming paradigms.

Link Icon 8 comments
By @declan_roberts - 5 months
> All primitives are denoted by single symbols

Take an axe to the troubleshoot-ability of your language with this one weird trick that makes it impossible to google.

By @Duanemclemore - 5 months
Stevan Apter is awesome, I love "No Stinking Loops." His episode of the ArrayCast is great.

https://www.arraycast.com/episodes/episode26-stevan-apter

By @dang - 5 months
Related. Others?

F (2006) - https://news.ycombinator.com/item?id=24238846 - Aug 2020 (56 comments)

F – a pure functional concatenative language (2006) - https://news.ycombinator.com/item?id=10776314 - Dec 2015 (7 comments)

By @mrkeen - 5 months
> In F, everything is a function from triples of (environment;stack;queue) to triples of (environment;stack;queue).

I dabble with compiler-writing, and one of the techniques there is to program an abstract machine. It fills a nice niche - it's a bit more concrete than hacking together an interpreter over your AST, and a lot less concrete than writing out LLVM instructions.

Some examples are Krivine machines and SECD machines (which stands for Stack, Environment, Control, Dump).

They let you play around with ideas before you commit to a particular semantics of your language, for instance, whether you'll pass by value or reference, via the stack, or via the heap.

But exposing (e;s;q) directly to the programmer is a fascinating idea! If I'm thinking about it right, it means a programmer could write code to take a parameter which was passed in via the stack, and decide "No I think this should be on the heap instead" and then update all pointers in the program accordingly.

By @ithkuil - 5 months
Also interesting: https://www.uiua.org/

Concateniative APL-like (with Unicode symbols but with pragmatic input method)

By @pmarreck - 5 months
In the "simple and interesting language" front we also recently got a post about Forsp, a hybrid between a lisp and Forth: https://github.com/xorvoid/forsp

What is the simplest most interesting language?

By @encom - 5 months
This is the opposite of click bait.
By @mrgoldenbrown - 5 months
Unrelated to F# (Microsoft's functional .net language) as far as I can tell.