babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
Jakub Holý 2020-09-14T06:36:40.213100Z

Thanks, Michiel! The problems with the Cognitect aws-api is the signing, which I believe somebody has at least partially reimplemented for ClojureScript (and could perhaps be ported to a GraalVM-friendly Clojure) and locking, which will likely need to wait for https://clojure.atlassian.net/browse/CLJ-1472 in (hopefully) the next release of Clojure, correct? I see @jeroenvandijk has published a fork of aws-api that can run the signing in cljs / graalvm. However the aws-api team does https://github.com/cognitect-labs/aws-api/pull/121#issuecomment-667414548 about this problem: > This is not a priority for us, and is not on any near or mid-term road map. We're not closed to the idea, but it would increase the maintenance burden, so we wouldn't pursue it without a very strong rationale.

borkdude 2020-09-14T06:46:56.214600Z

@holyjak 1472 is no longer a problem, released as 1.10.2-alpha1

1👌
2020-09-14T07:50:21.215800Z

@holyjak I’m not sure what the current status is of compiling the Cognitect aws-api with Graalvm. Might be worth to try again

borkdude 2020-09-14T07:51:59.216Z

Dynamic requires are usually the problem

borkdude 2020-09-14T07:52:07.216200Z

But those are pretty easy to patch

borkdude 2020-09-14T07:52:54.216500Z

I noticed that with babashka, when including some libraries, they yield a binary with 30mb added, only because they have a runtime require in them

borkdude 2020-09-14T07:52:58.216700Z

e.g. spec

2020-09-14T07:59:22.216900Z

How would you patch it?

borkdude 2020-09-14T07:59:52.217500Z

Copy the library and make requires static

borkdude 2020-09-14T08:21:03.217700Z

Sometimes alter-var-root also works

borkdude 2020-09-14T08:21:29.217900Z

But beware when using direct linking, all other places that use the patched var also have to be patched

Jakub Holý 2020-09-14T08:32:58.218400Z

is there any page with tips and tricks like these for porting a lib to graalvm?

borkdude 2020-09-14T08:33:21.218600Z

there sure is

borkdude 2020-09-14T08:33:29.218800Z

https://github.com/lread/clj-graal-docs

1❤️
borkdude 2020-09-14T07:28:52.215700Z

@holyjak If it's just s3 you could also consider shelling out to the aws cli

1👍
2020-09-14T07:50:21.215800Z

@holyjak I’m not sure what the current status is of compiling the Cognitect aws-api with Graalvm. Might be worth to try again

borkdude 2020-09-14T07:51:59.216Z

Dynamic requires are usually the problem

borkdude 2020-09-14T07:52:07.216200Z

But those are pretty easy to patch

borkdude 2020-09-14T07:52:54.216500Z

I noticed that with babashka, when including some libraries, they yield a binary with 30mb added, only because they have a runtime require in them

borkdude 2020-09-14T07:52:58.216700Z

e.g. spec

2020-09-14T07:59:22.216900Z

How would you patch it?

borkdude 2020-09-14T07:59:52.217500Z

Copy the library and make requires static

borkdude 2020-09-14T08:21:03.217700Z

Sometimes alter-var-root also works

borkdude 2020-09-14T08:21:29.217900Z

But beware when using direct linking, all other places that use the patched var also have to be patched

Jakub Holý 2020-09-14T08:31:55.218300Z

good idea, thanks!

Jakub Holý 2020-09-14T08:32:58.218400Z

is there any page with tips and tricks like these for porting a lib to graalvm?

borkdude 2020-09-14T08:33:21.218600Z

there sure is

borkdude 2020-09-14T08:33:29.218800Z

https://github.com/lread/clj-graal-docs

1❤️
borkdude 2020-09-14T12:31:16.219300Z

Could be both. If you're going with the JVM library and make it GraalVM compatible, it could also be wrapped in a pod

lukasz 2020-09-14T13:37:47.219500Z

True! I'll keep you updated and bug you with questions ;-)

borkdude 2020-09-14T13:44:53.219700Z

:thumbsup:

borkdude 2020-09-14T19:19:23.220700Z

Just shared a new cool project in #sci

borkdude 2020-09-14T20:07:52.220900Z

(https://babashka.org/xterm-sci/)

4❤️