Fork me on GitHub
#clojure-uk
<
2019-05-21
>
3Jane08:05:52

Thank you, I needed this today 😄

3Jane08:05:55

(hi guys)

otfrom08:05:15

I like how pretty much every baddy in Scooby doo was some kind of capitalist rent seeker

jasonbell08:05:36

And usually in receipt of a funfair.

alexlynham08:05:24

it’s a good way of teaching kids that the villain is likely to be the local petty gentry

✔️ 4
🛠️ 4
guy09:05:00

Morning!

dharrigan09:05:26

Anyone here got experience with clojure and aws lambda (in production?)

guy09:05:36

Yeah a little

guy09:05:41

they were p slow

dharrigan09:05:52

kk, I thought that might be the case

guy09:05:53

I did mine of s3 events

guy09:05:46

somethings added to s3, it triggers a put event, goes to sqs which triggers a lambda. I found it to be ok-ish, you had to implement some java method to have it running, i think it was a handler or something. Also you had to be careful about the deps for the project as well, as theres a soft 20mb limit iirc for the jar. It basically made me feel like you should write the lambda in python or something else.

guy09:05:05

However once it was set up etc, it was fine 🤷

guy09:05:38

anyways just ping if u have any questions :thumbsup:

dharrigan09:05:08

Thank you. The team has started to look to use lambda heavily, and they're taking about doing it in python

dharrigan09:05:14

I just thought perhaps to present an alternative

dharrigan09:05:38

But, since I'm the only "lisp-er" here, then I don't think they would be interested in my ramblings about clojure 😉

😄 4
guy09:05:44

I would still recommend trying it once though

guy09:05:15

for example if you are just doign some data transformations etc, its worth just giving it a go, for your own personal knowledge

guy09:05:21

its not trivial but its not exactly hard

guy09:05:11

- have some sort of transformation function - create lambda handler - have some validation - test on aws The hard part is really testing locally and all the config set up, theres localstack i think? which is like aws but emulated locally

dharrigan09:05:41

thank you for the helpful insight! 🙂

👍 4
alexlynham09:05:02

@dharrigan for lambda, use cljs

alexlynham09:05:24

quicker runs

alexlynham09:05:45

you get that sellotaped together vibe that a lot of cljs has, especially server side

alexlynham09:05:56

and I hope you like promises and node interop

alexlynham09:05:20

honestly I’d be hard pressed making the argument against doing it in python

alexlynham09:05:43

for the largest serverless project I did, it was functional python in a very lispy style

dharrigan09:05:13

Yes, that's the thoughts. Right tool for the job. I think the team will use Python 😉

dharrigan09:05:19

nothing wrong in that 🙂

alexlynham09:05:23

most AWS APIs return lists, so the pattern of functions that operate over a single item comp’d together into list functions makes sense

alexlynham09:05:33

^ you can get v functional with it and then the unit testing is ace, you can test yr individual functions as well as all the compositions

alexlynham09:05:51

then the only thing you need to integration test is the lamda handler itself

alexlynham09:05:11

which is kind of like an i/o form, or a main function

alexlynham09:05:22

that just sequentially executes yr fns

alexlynham09:05:57

(aside - probably you can tell from this how much I miss the threading macro when I write python lol)

👍 4
dominicm09:05:31

I've done java clojure on lambda, that was slow. But I'd strongly consider graalvm if I was doing it today.

👍 4
💯 4
alexlynham09:05:45

^ this is also a fair point

alexlynham09:05:58

you could look into lambda layers if you’re on AWS

guy09:05:03

I’ve not looked at graalvm before, but heard it was fast yeah

alexlynham09:05:13

(tbf there’s also a lambda layer for haskell)

guy09:05:26

How does that work for lambda? can u just specify to use graalvm instead of jvm? :thinking_face:

rickmoynihan13:05:58

not tried it so YMMV but you’d just compile it into a native executable and run that as the lambda

rickmoynihan13:05:40

biggest compatibility with graal native code is it can’t use reflection. So you wouldn’t be able to use amazonica.

alexlynham09:05:56

and haskell’s monadic i/o actually makes a lot of sense when composing together AWS lambdas, but I digress…

alexlynham09:05:22

https://github.com/envoylabs/cljs-serverless-workshop <-- here’s the code for the workshop I ran last night if you want something to poke

alexlynham09:05:31

aaand here’s the instructor notes. Shouldn’t take more than a few mins to have something deployed if you have AWS creds configured https://gist.github.com/the-frey/767a9c403e691df9915e3ecf04f05594

alexlynham09:05:21

but like I say you might have a tough time arguing against python 🙂

dominicm10:05:10

https://github.com/FieryCod/holy-lambda this looked pretty cool (haven't used) builds on the above ^

benedek10:05:08

had good experience with cljs lambdas

alexlynham10:05:26

that’s a nice project by the look of it

alexlynham10:05:02

portkey is quite cool as well, if you haven’t seen it

dominicm10:05:22

portkey is awesome

dominicm10:05:39

a repl in a lambda

alexlynham10:05:57

yeah it’s wild

thomas10:05:35

here is a video from last years Dutch Clojure Days from someone who used Lambda and clojure https://www.youtube.com/watch?v=kXb1DHw632s

Ben Hammond10:05:33

is it possible to use REBL with a cljs repl?

Ben Hammond10:05:32

anyone done this??

thomas13:05:37

no idea, but maybe ask in #rebl ?