Fork me on GitHub
#clojure-uk
<
2020-08-27
>
dharrigan06:08:36

Good Morning

djm06:08:40

๐Ÿ‘‹

mccraigmccraig07:08:29

!mรฅningยก

yogidevbear07:08:53

Morning ๐Ÿ˜„

alexlynham07:08:02

@mccraigmccraig yeah that's one thing that's irking me about typescript atm

alexlynham07:08:16

the fact i have to write types, then data validation and maintain both

alexlynham07:08:42

makes the language feel toy-like since a lot of errors/ user data issues are ofc runtime

alexlynham07:08:19

and both typescript and purescript (the latter to a lesser extent) have this problem big time cos at runtime, it's just minified JS so all bets are off if you don't have any runtime checking

mccraigmccraig07:08:14

last time i looked, lux had a nice typesafe library for automatically producing encoders/decoders from types ... not sure whether that's something that can be replicated in other hm-typed langs, or if it depends on some features of lux, like types being expressed as regular datastructures or the full compiler state also being a regular datastructure and available to macros https://github.com/LuxLang/lux/blob/master/stdlib/source/poly/lux/data/format/json.lux

mccraigmccraig08:08:18

and the decoders return an error-handling type, so runtime errors are catered for

alexlynham09:08:22

ah I thought lux was dead

alexlynham09:08:51

but it looks moderately active

alexlynham09:08:28

i think i'm back to my regular 'why don't people just use lisp' or at least a data oriented lang frustration

alexlynham09:08:56

all we do with line of business apps is shuffle around data, so why do we spend so much time messing around with things that aren't that

alexlynham09:08:58

viva la revolucion

alexlynham09:08:10

very noticeable that that's not an issue i have when working in clj

mccraigmccraig09:08:53

i don't think lux is dead, eduardo still seems to be pretty focused on it, and from the look of it he's achieved quite a lot - but it's also been changing massively (which may be a good thing), so i wouldn't try writing any real code on it yet

mccraigmccraig09:08:03

also @bronsa has some quite strong opinions about lux syntax ๐Ÿ™‰

alexlynham10:08:16

strong opinions... negatively?

mccraigmccraig10:08:47

negatively, but about the aesthetics of the syntax rather than anything functional i think...

mccraigmccraig10:08:27

and the lux syntax certainly looks very different to other lisps

bronsa10:08:27

:) It's been too many years since I last looked at lux to remember much about what I thought about it

Rachel Westmacott10:08:19

Does anyone have an opinion on core.async these days?

Rachel Westmacott10:08:48

prediction: at least one person prefers manifold streams

mccraigmccraig10:08:21

lol, i have my issues with both core.async and manifold, although i've used manifold a lot more heavily

๐Ÿ‘ 3
Rachel Westmacott10:08:41

we're considering using callbacks for an internal API as it will probably be sufficient and simpler, but core.async is also being considered

mccraigmccraig10:08:52

i think core.async makes for a poor promise abstraction, but is good for co-ordinating streams of things

mccraigmccraig10:08:22

for an API call returning a single result a promise is a better fit i think

mccraigmccraig10:08:49

for an API returning streams of things (like a websocket) then core.async is a good fit

mccraigmccraig10:08:37

i prefer the promise for the API because [1] promises compose easily and [2] error-handling is built in and also composes well

Ben Hammond10:08:00

core async's killer feature is backpressure If you need backpressure then its a good choice If not, then it isnt

๐Ÿ‘ 3
Ben Hammond10:08:54

er, or if you are using cljs in a browser, thats a killer feature too (might be out of date on that one)

mccraigmccraig10:08:25

for cljs api calls from a browser i'd go with promises over core.async too - funcool/promesa wraps them nicely

๐Ÿ‘ 6
mccraigmccraig10:08:15

but for websocket messages and streams of events in the browser - core.async is a good fit there

alexlynham12:08:35

also if you do have a thing that core.async does work well with, combining abstractions like transducers etc is a breeze

alexlynham12:08:38

imo a little easier to handle lotsa stuff using that (like you say w/ the example of a stream) vs promises/promise chains

alexlynham12:08:01

unless you get deep into craig's world of streams & monads