Concatenative Programming
![Animated preview](https://lemm.ee/api/v3/image_proxy?url=https%3A%2F%2Fgithub.com%2Fmarcopaganini%2Frpn%2Fraw%2Fmaster%2Fassets%2Frpn.gif) This is not my own project!
Discussion on [HackerNews](https://news.ycombinator.com/item?id=41769275)
Slint is a GUI toolkit, and is largely not relevant to concatenative programming. But the latest release adds a touch of postfix to the mix, which is nice to see. From the blog post: > ## Math Gains Postfix Support > > A subtle but profound change to the language. Traditional syntax: > > Math.max(20, Math.abs(value.x)) > > New postfix syntax: > > value.x.abs().max(20) > > The new syntax improves readability by making the transformation steps more explicit. It works well for many operations but has limitations: > > Effective for simple transformations (e.g., abs, max) Less intuitive for operations like clamp or atan2. > > pos.y.atan2(pos.x) // Less clear than atan2(pos.y, pos.x) > > So for now you cannot use postfix for all functions in the Math namespace. We may revisit these cases later, so give them a try and let us know your thoughts.
[Discussion on lobsters](https://lobste.rs/s/z1yw0e/postscript_1_0_code_study)
Explanation: https://gist.github.com/Dobiasd/bb9d38a027cf3164e66996dd9e955481 I am not the author.
PDF: https://storage.googleapis.com/gweb-research2023-media/pubtools/1004848.pdf
I wanted to map over a nested array in factor so I created a helper function: `: nested-map ( a quote -- a' ) swap [ over map ] map nip ;` which i then called with `{ { 1 2 } { 3 4 } } [ 1 + ] nested-map` But when I call it I get the error from the title. If I just paste the body of the function it works as intended: `{ { 1 2 } { 3 4 } } [ 1 + ] swap [ over map ] map nip` So I guess I have two questions: is there a better way to achieve the original goal, but also how am I supposed to create higher order functions without getting this error?
Discussion on hacker news: https://news.ycombinator.com/item?id=40804122
I'm posting this mostly for the new hacker news discussion: https://news.ycombinator.com/item?id=40736174
> F is a pure functional concatenative language originally designed as an extension of False. F contains the list-operations of K3 and the dip combinator of Joy. Floating-point and symbolic datatypes are supported. One-time assignment is enforced in syntax. A theory of function-valence and -charge is outlined. F also contains a general continuation primitive $, and the pattern sublanguage of XY. G is a variant of F in which the K3 adverbs are implemented as primitives. Discussion on lobsters: https://lobste.rs/s/m9xv5y/f_functional_false
Factor gains a quit function (and preserves history)!
This is already in the sidebar, but now there's a fresh post on Lobsters, so maybe some good discussion will come of it.
Discussion on lobsters: https://lobste.rs/s/mwbsed/first_class_contexts
- Discussion on lobsters: https://lobste.rs/s/l8o4j8/forsp_forth_lisp_hybrid_lambda_calculus - Repo: https://github.com/xorvoid/forsp/
Discussion on lobsters: https://lobste.rs/s/fxkhfk/failing_at_combinatorics_with_haskell
Discussion on lobsters: https://lobste.rs/s/oxjvv0/0_1_0_2 > It's not that Roc *only* supports base-10 arithmetic. It also supports the typical base-2 floating-point numbers, because in many situations the performance benefits are absolutely worth the cost of precision loss. What sets Roc apart is its choice of default; when you write decimal literals like 0.1 or 0.2 in Roc, by default they're represented by a 128-bit fixed-point base-10 number that never loses precision, making it reasonable to use for calculations involving money. > In Roc, floats are opt-in rather than opt-out.
lobsters discussion: https://lobste.rs/s/mnuhwc/go_s_concurrency_dynamic_language_rye