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
jiriknesl 2020-12-17T06:31:05.201200Z

Good morning

dharrigan 2020-12-17T07:06:32.201400Z

Good Morning!

mccraigmccraig 2020-12-17T07:59:37.202100Z

i often use type-specific suffixes like -fn or -p for promises, -ch for channels, -s for streams...

mccraigmccraig 2020-12-17T08:06:22.204200Z

we're using juxt/bidi for our router atm, and i really like the extra abilities you get for free when your routes are a datastructure - to add interceptors to all handlers below some node in the route tree for example

mccraigmccraig 2020-12-17T08:08:41.204500Z

+måning!

thomas 2020-12-17T08:32:20.204900Z

mogge

alexlynham 2020-12-17T08:48:38.205Z

morning

alexlynham 2020-12-17T08:50:30.205100Z

my main concern is getting docs for free, whether that's openapi/swagger or whatnot

alexlynham 2020-12-17T08:51:03.205200Z

but you can do that with both specc'd functions or datastructures for your router so that's about where i get off the strong opinion bus

2020-12-17T09:16:46.205400Z

Morn'

2020-12-17T12:10:39.205600Z

Morning

jiriknesl 2020-12-17T22:06:15.209400Z

I have used bidi too. Now, for some reason try to get every flow problem into monadic form. But my Clojure have always been Haskell-ish. Anyway, I have been in touch with a big part of my team, also people here and everyone seems to prefer maps over functions for routing. My thinking was that action must be represented by code, immutable truths by data. Routing is often quite dynamic (I have developed routes that were translated to various languages; read from SQL; cached in Redis) and pure regex-like approach is something I see as leaky abstraction.

dominicm 2020-12-17T22:10:03.212700Z

I'm still really confused :). Bidi is basically a linear prefix matching system, with defined meanings for interpreting data as a prefix match. I'd bet that functions can be used with bidi, but it's more convenient to match with a string. But I don't know why I'd want to use functions, that's very unfamiliar to me. Reitits benchmarks from optimizing pure data into a trie are impressive.

jiriknesl 2020-12-17T22:31:47.214200Z

As I say, most people prefer maps over functions. In fact, I am the only Clj dev I know who prefers fns over data for that.

dominicm 2020-12-17T22:34:18.216500Z

I don't like the word prefer. I get a few benefits from data route matching. I don't feel the need for functions.

jiriknesl 2020-12-17T22:34:30.216800Z

We had interesting discussion connected with that. Lisps blur line between data and code. Does it mean we should represent more code-like (things representing action) as data, or should we represent state of the world (data) as code?

jiriknesl 2020-12-17T22:34:44.217400Z

Lisps have

dominicm 2020-12-17T22:35:06.218100Z

I have used the bidi protocols for a few esoteric things, which reitit couldn't have done so I appreciate that fallback.

jiriknesl 2020-12-17T22:38:16.219400Z

All lisps (and overall functional languages) have awesome capabilities to work with data structures. This is a strong case for them. But if devs overreach in this, they will end up implementing own Lisp in data structures.