portkey

Portkey: from REPL to Serverless in one call
baptiste-from-paris 2017-10-03T06:37:26.000008Z

do you understand the error message ?

viesti 2017-10-03T06:57:46.000138Z

the java.security.SecureRandom kryo serialization issue is probably separate from clj-http/request var serialization

baptiste-from-paris 2017-10-03T06:58:49.000018Z

maybe I do things wrong, but do I need to upload my #‘var everytime it changes ?

baptiste-from-paris 2017-10-03T06:59:14.000205Z

It slow down my feedback loop, it’s okay but I am just asking ^^

viesti 2017-10-03T06:59:46.000107Z

mount! has :live true

viesti 2017-10-03T07:00:03.000150Z

but haven’t gotten to putting that into mount-ring!

viesti 2017-10-03T07:00:36.000275Z

thinking about lifting common pieces from mount! for use in mount-ring

viesti 2017-10-03T07:00:52.000406Z

ultimately these things are related, mount! is just a special case of proxy

baptiste-from-paris 2017-10-03T07:00:55.000213Z

does it upload everything ? * :live true

viesti 2017-10-03T07:01:23.000259Z

yes, but only on change of the mounted var, not on change in dependencies

baptiste-from-paris 2017-10-03T07:01:51.000031Z

ok, nice

viesti 2017-10-03T07:02:01.000051Z

one can “batch” changes that way 🙂

baptiste-from-paris 2017-10-03T07:02:16.000262Z

have you looked at my keep stuff, totally wrong ?

viesti 2017-10-03T07:02:26.000039Z

haven’t yet have time

baptiste-from-paris 2017-10-03T07:02:50.000253Z

ok ok

baptiste-from-paris 2017-10-03T07:03:46.000287Z

I have few mini-websites that are going to massively use portkey

baptiste-from-paris 2017-10-03T07:03:53.000036Z

at least I am going to try hard

baptiste-from-paris 2017-10-03T07:04:40.000140Z

this tool can be life changing for prototyping

🙏 1
viesti 2017-10-03T07:04:40.000248Z

🙂

viesti 2017-10-03T07:04:44.000270Z

yes

baptiste-from-paris 2017-10-03T07:05:18.000265Z

it’s even better than lambda with regular java/node

viesti 2017-10-03T07:06:02.000203Z

repl makes a difference

baptiste-from-paris 2017-10-03T07:06:55.000297Z

indeed

cgrand 2017-10-03T07:17:33.000023Z

we will have to get rid of carbonite at some point

baptiste-from-paris 2017-10-03T07:23:42.000156Z

why that ? it’s just a kryo wrapper for clojure datastructures right ?

cgrand 2017-10-03T07:25:06.000228Z

because for some clojure stuff we need our own custom serializer and in such cases we clash with carb

baptiste-from-paris 2017-10-03T07:25:22.000113Z

ok ok

cgrand 2017-10-03T07:46:42.000043Z

@baptiste-from-paris I’m rather bad at faces, have we ever met at the paris clojure group?

cgrand 2017-10-03T07:51:27.000313Z

so the issue with clj-http.core/request is a kryo one, and trying to fix it (by working around carb) I trigger another one...

baptiste-from-paris 2017-10-03T08:07:18.000316Z

nope, I discovered clojure 1 year ago

baptiste-from-paris 2017-10-03T08:07:32.000056Z

but i am part of the clojure paris group

baptiste-from-paris 2017-10-03T08:07:52.000003Z

we just had a brainstorming to 3 weeks ago

baptiste-from-paris 2017-10-03T08:08:10.000189Z

trying to make Clojure just a little more popular in france !

baptiste-from-paris 2017-10-03T08:09:03.000254Z

by the way if one of you want to come to paris to talk about portkey it would be awesome

baptiste-from-paris 2017-10-03T08:09:44.000139Z

I am sure we can make it all inclusive with the Clojure user group

cgrand 2017-10-03T08:11:29.000204Z

back in july (iirc) I chatted with @hmadelaine about “monter à la capitale” (going to the big town) to talk about either portkey or unrepl

baptiste-from-paris 2017-10-03T08:12:08.000221Z

when ever you want, we plan to make 6 events this year

cgrand 2017-10-03T08:12:35.000080Z

monthly was too much of a strain?

baptiste-from-paris 2017-10-03T08:12:38.000136Z

which is quite hard, there are not a lot of people willing to talk ^^

baptiste-from-paris 2017-10-03T08:12:51.000023Z

yes, not enough speakers

baptiste-from-paris 2017-10-03T08:13:21.000125Z

and lot’s of people who are really new to the language

baptiste-from-paris 2017-10-03T08:13:48.000005Z

I bet there are less than 5 companies using clojure in France

baptiste-from-paris 2017-10-03T08:14:57.000152Z

I really want to increase this number

cgrand 2017-10-03T08:15:41.000259Z

we need to put parens in tap water like they do in Finland 😉

🤘 1
baptiste-from-paris 2017-10-03T08:16:40.000121Z

parens means ^^ ?

cgrand 2017-10-03T08:16:46.000249Z

parenthesis

baptiste-from-paris 2017-10-03T08:17:18.000191Z

oh

baptiste-from-paris 2017-10-03T08:17:26.000157Z

lol

cgrand 2017-10-03T08:18:06.000240Z

the uptake of Clojure there is phenomenal

baptiste-from-paris 2017-10-03T08:19:27.000264Z

sometimes it’s only a matter of few people/companies that make other people choose a tech

baptiste-from-paris 2017-10-03T08:19:55.000280Z

it really amaze me how tech companies choose their stack

baptiste-from-paris 2017-10-03T08:20:28.000179Z

I worked for Meetic (Match group); we always did what competition were doing

baptiste-from-paris 2017-10-03T08:20:31.000036Z

and vice/verca

cgrand 2017-10-03T08:22:15.000205Z

Imitation and belief in magic bullet/pixie dust.

😂 1
cgrand 2017-10-03T08:22:53.000270Z

However we (collectively as devs) don’t always make rational choices

baptiste-from-paris 2017-10-03T08:23:10.000112Z

Offcourse! We are humains ^^

baptiste-from-paris 2017-10-03T08:24:15.000013Z

But I think it can be great to have more clojure enthousiast in France

baptiste-from-paris 2017-10-03T08:24:31.000369Z

At least just to inject more money in the clojure ecosystem

baptiste-from-paris 2017-10-03T08:26:07.000088Z

So that a 28/30 young dev can work on a project like portkey because he already "master" clojure

baptiste-from-paris 2017-10-03T08:48:15.000199Z

do you often come to paris @cgrand?

cgrand 2017-10-03T08:51:32.000149Z

no — for 1.5 year I contracted for SACEM and was in Paris 2 days a week, this ended 2 years ago and since then I didn’t have the opportunity to go to Paris. It has been too long of a time, I should plan a visit to the user group.

baptiste-from-paris 2017-10-03T08:51:52.000294Z

nice 🙂

cgrand 2017-10-03T08:53:27.000344Z

but currently I’m looking into going further in the country side, maybe I should open a (clojure) hackers retreat 🙂

baptiste-from-paris 2017-10-03T08:54:54.000143Z

lol

baptiste-from-paris 2017-10-03T08:54:59.000069Z

saint etienne right ?

✅ 1
viesti 2017-10-03T09:00:39.000101Z

the uptake on Clojure in Finland is probably most visible in ClojuTre, this year and last year attendees in the ~300 range

baptiste-from-paris 2017-10-03T09:02:24.000231Z

And how many from Finland itself ?

cgrand 2017-10-03T09:06:49.000055Z

350 this year, 2/3 Finns I guess

cgrand 2017-10-03T09:21:50.000187Z

to put it in perspective: same size as EuroClojure

cgrand 2017-10-03T09:24:32.000113Z

it’s a free conference

viesti 2017-10-03T10:07:16.000194Z

this year there was a voluntary 50e patron fee

viesti 2017-10-03T10:07:26.000286Z

but there are quite many sponsors

viesti 2017-10-03T10:07:46.000366Z

which tells the story of Clojure being commercially in use

viesti 2017-10-03T10:22:27.000074Z

and we have sauna 🙂

3
baptiste-from-paris 2017-10-03T10:39:16.000025Z

we have great wine 😉 🍷

2
baptiste-from-paris 2017-10-03T10:46:09.000210Z

UCInterpreter transform clj to .class right ?

baptiste-from-paris 2017-10-03T10:54:08.000322Z

I don’t understand also why use vars & classes in here =>

(defn freeze [x]
  (let [classes (atom #{})
        vars (atom #{})
        kryo (mk-kryo)
        baos (java.io.ByteArrayOutputStream.)]
    (with-open [out (com.esotericsoftware.kryo.io.Output. baos)]
      (.writeClassAndObject kryo out x))
    (.toByteArray baos)))

baptiste-from-paris 2017-10-03T11:09:13.000062Z

and from what I understand, it might cause problem according to kryo doc

[com.esotericsoftware/kryo "4.0.0"]
                 [com.twitter/carbonite "1.4.0"
                 :exclusions [com.esotericsoftware.kryo/kryo]]
because carbonite use kryo 3.*

cgrand 2017-10-03T11:27:57.000312Z

carbonite will be gone by the end of the week

baptiste-from-paris 2017-10-03T11:30:02.000287Z

thx

cgrand 2017-10-03T11:30:20.000311Z

Deps tracing/tree-shaking

cgrand 2017-10-03T11:31:41.000253Z

One starts from a value (a closure), we serialize it with kryo.

cgrand 2017-10-03T11:32:06.000168Z

To serialize, Kryo performs a traversal of the object graph rooted at our initial value.

cgrand 2017-10-03T11:32:55.000294Z

As kryo walks the graph we log all classes and vars found. (that’s what you see in freeze)

cgrand 2017-10-03T11:33:28.000204Z

so now with have bytes (the frozen value) and some deps (classes and vars)

baptiste-from-paris 2017-10-03T11:33:48.000195Z

log-dep ?

cgrand 2017-10-03T11:34:48.000278Z

we add the classes to the package (and we add also deps of deps, that’s UCInterpreter/analysis job, vars and resources may be found too)

cgrand 2017-10-03T11:34:55.000025Z

then we add resources

cgrand 2017-10-03T11:35:18.000196Z

then we deref all vars encountered, and we serialize their values

cgrand 2017-10-03T11:35:26.000243Z

(with kryo)

cgrand 2017-10-03T11:35:48.000401Z

serialization produces more classes and vars

cgrand 2017-10-03T11:35:59.000096Z

etc. etc. until nothing new is found

cgrand 2017-10-03T11:36:10.000029Z

FIN

baptiste-from-paris 2017-10-03T11:36:30.000070Z

how did you come with this strategy ^^ ?

baptiste-from-paris 2017-10-03T11:37:36.000350Z

and in which phase asm generates .class ?

cgrand 2017-10-03T11:37:41.000113Z

never

cgrand 2017-10-03T11:38:13.000100Z

when you eval code at the repl clojure does generate classes (in memory)

cgrand 2017-10-03T11:38:44.000397Z

we use ouroboros to retrieve them (or any other) from the JVM

baptiste-from-paris 2017-10-03T11:41:02.000170Z

let me summarize the problem(s) portkey is trying to solve 1) bring clojure repl to lambda 2) minify/deploy clojure code -> bytecode -> package -> aws lambda

cgrand 2017-10-03T11:43:30.000178Z

that’s correct but 2) is somehow necessary to make 1) useful

baptiste-from-paris 2017-10-03T11:44:42.000153Z

and I guess the hard part is serialization and handling clojure’s data structure ?

cgrand 2017-10-03T11:46:58.000065Z

not that much, the hard part is class inspection

baptiste-from-paris 2017-10-03T11:53:28.000174Z

ok