top | item 25186872

(no title)

thinbeige | 5 years ago

Congrats, this looks very nice. I played a bit around and headed then to Wikipedia's entry of Forth to learn more about the og language. Please elaborate more about why you did this project and decide for Forth from your perspective.

discuss

order

Skinney|5 years ago

I realised that the code I found most readable were always in a pipeline, regardless of language (java: `one().two().three()`, lisp: `(-> one two three)`, Elm: `one |> two |> three`, etc) and I wondered what it would be like to program in a language were pipelines were not only easy, but required.

Forth-based languages was the closest I could come to that experience, but most of those languages did not have all the niceties I've come to enjoy, like strong static typing and purity.

I also wanted a language which would work equally well on the backend as the frontend, and with wasm this seemed possible.

So those were the initial ideas behind the project.

dkersten|5 years ago

> I realised that the code I found most readable were always in a pipeline, regardless of language

I'm in a similar boat, I find the pipeline-style code to be the most pleasant and use ->, ->>, cond->, some-> very heavily in my Clojure code and I actually spent a few months with Factor before I got into Clojure.

For large chunks of my code, I find the concatenative style an excellent fit, but the remaining parts where I have to juggle the stack ruins the experience for me. I really don't want to drop, dup, rot or whatnot.

I've always wondered if there wasn't some way of making a concatenative language that naturally didn't require stack operations like that, but I haven't tried too hard to figure it out (or check if anyone else has). I guess something that might work is to combine concatenative "statements" with something like let bindings and destructuring, so you can destructure your stack to extract the stuff you need, binding them to names to be used elsewhere.