clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
thomas 2020-12-12T11:55:52.142300Z

morning

2020-12-12T12:37:16.142500Z

Morning

dominicm 2020-12-12T13:30:10.142600Z

g'morrow

jiriknesl 2020-12-12T20:22:50.145700Z

Hi guys, for some reason, we are going to do mob programming in Forth next week. Everyone seems excited to do so. Do you have any idea why would Forth be interesting for Clojure dev? I have just tried to hack in it for an hour. It is stateful, nothing is immutable, it seems to be very very low level and the whole concept of reusability is way different from any other functional language. What exactly is that attractive on Forth?

jiriknesl 2020-12-12T20:25:29.148Z

In the past, I have read Color Forth book. Twice. I bought the idea behind until today when I have finally tried to work in Forth. It is exactly the opposite of functional programming. Stack = state is everything. It is even worse than SQL database procedures. They at least have a schema. With Forth, you just have a bunch of data that can be basically anything and you have to somehow believe, you will end up with the right stack in the right time.

jiriknesl 2020-12-12T20:27:40.150Z

And also rearranging of stack seems so hacky to me. For the same reason I don’t like point-free programming in Haskell. Theoretically, you could rearrange anything into a weird mixture of (.) . (.)-ies. The same goes with Forth fith dups, swaps, overs, etc. but without any typing, variable naming, or anything in place.

seancorfield 2020-12-12T20:32:24.150400Z

Forth is a fascinating language but it isn't to everyone's taste.

seancorfield 2020-12-12T20:33:18.150700Z

If you want a modern take on Forth, look at https://factorcode.org/

👍 1
seancorfield 2020-12-12T20:36:43.152700Z

There's an interesting hybrid of Clojure and Forth-like coding in Gershwin https://github.com/gershwin/gershwin (unfortunately its doc site is no longer accessible). It uses an old fork of Clojure and hasn't been maintained for years but back when we were using that old version of Clojure, I actually converted some of our code at work to Gershwin to see how it worked. It's pretty cool.

jiriknesl 2020-12-12T20:37:42.153600Z

The thing is - I thought Forth is fascinating. This is why I read Color Forth book twice. It was all until I have tried to work in it.

jiriknesl 2020-12-12T20:38:11.153900Z

Now, it doesn’t seem practical to me at all.

seancorfield 2020-12-12T20:38:49.154100Z

Ah, here's the Gershwin docs https://gershwin.github.io/

seancorfield 2020-12-12T20:40:15.155100Z

Learning radically different languages can make you a better programmer (per Pragmatic Programmer advice) but you need to actually build stuff using it, not just read a book.

jiriknesl 2020-12-12T20:42:45.157400Z

I know that learning absolutely different paradigm can make me a better programmer. This is why I learn about Forth, Prolog, APL & J, Datomic, lambda calculus, etc. But catching an “idea behind” from the book is different from using the thing. What if your experience from Macromedia with CF was more useful than my experience with Forth even when CF is more mainstream just because Forth is innovative, but also unnecessarily weird?

jiriknesl 2020-12-12T20:43:18.158300Z

Before Clojure, I have tried working in Erlang and I have abandoned the language just because of its weirdness.

seancorfield 2020-12-12T20:44:02.159700Z

I only meant that you can't really internalize the concepts in a language without building something a bit more than a toy with it. And, yea, APL and Prolog would be other languages I'd recommend (I've built stuff in both).

jiriknesl 2020-12-12T20:44:16.160100Z

Maybe it’s just me, but I somehow need to lower the cognitive load of the language. I need true to be true. I need a function to look like a function. So I can absorb new ideas in usable way.

seancorfield 2020-12-12T20:47:07.161400Z

Like I said, not to everyone's tastes. I love APL (but dislike J -- using ascii loses the elegance of APL), I love Prolog too -- and I had fun learning Erlang because it reminded me of Prolog so much.

jiriknesl 2020-12-12T20:51:32.163Z

I love APL - in theory. I have never tried to develop anything in it. Even when I have spent a lot of time thinking how to turn all my code into a mixture of comp-s, partial-s and how to treat values the same way as vectors and matrixes. But the thing is - is it really practical once you run into a real world scenario?

jiriknesl 2020-12-12T20:53:08.164100Z

And the same goes for Forth. Building bottom up language seems attractive. It is similar promise one gets with Lisp languages. But in fact, I usually end up with 1-2 macros in the whole project.

jiriknesl 2020-12-12T20:54:36.165700Z

And in fact, 1-2 macros are just syntactic sugar just because I don’t want to wrap my code in (fn …) for aesthetic reasons and lots of cases for macros are prevented by lazy collections or by reusing existing fns and macros.

seancorfield 2020-12-12T20:54:49.166Z

I learned APL at an insurance company where it was in very heavy usage.

seancorfield 2020-12-12T20:55:21.166700Z

I originally learned Prolog at university but later worked at an actuarial company that did a lot of work in Prolog.

seancorfield 2020-12-12T21:02:19.167400Z

As for Forth in commercial usage: https://www.forth.com/resources/who-uses-forth/ -- although it's hard to know how many of those companies still use Forth (or even still exist?).

jiriknesl 2020-12-12T21:12:07.169400Z

I am sure there are lots of people working in Forth and they would speak happily about it. It is also the reason we do it - one of us was speaking about Forth so much we have decided to do a mob programming coding dojo in it. But as I am preparing for it, it doesn’t seem so good as my expectations.

seancorfield 2020-12-12T21:18:17.170400Z

Perhaps I liked it better because I'd used a reverse-polish programmable calculator at school and I used dc on Unix a lot...?

😺 1