Fork me on GitHub

Would a PR adding clojure.core.memoize`` to Babashka be of interest? Found myself needing it a couple of times now, and been manually copy-pasting the code to my projects so far


Let's elaborate in a Github Discussion

ūüĎć 1

I meant, you're welcome to create a Github Discussion for this, so we can discuss and see if more people are interested


babashka v0.6.4 - a fast starting Clojure scripting environment babashka ‚ÄĘ Add¬†``¬†and¬†``. This adds compatibility with¬† ‚ÄĘ Fix mapping for¬†`babashka.fs/unzip`¬† ‚ÄĘ Pods: support metadata in pod vars, like docstrings ( ‚ÄĘ babashka.curl: support¬†`:follow-redirects false`¬†( ‚ÄĘ Add support for¬†`--init`¬†as a file to be loaded before evaluation actions¬†¬†( ‚ÄĘ Bump rewrite-clj to v1.0.699-alpha ( ‚ÄĘ Fix¬†`BABASHKA_FEATURE_POSTGRESQL`¬†feature flag, initialize¬†`java.sql.SQLException`¬†build time¬† ‚ÄĘ Deps.clj: upgrade to tools version¬†``¬†and include new¬†`DEPS_CLJ_TOOLS_VERSION`¬†environment variable to use older or newer tools jar.

ūüĎŹ 1

already upgraded ūüôā

ūüöÄ 3
Krishan V17:10:39

Hey everyone, is there a pod for working with datomic?


Currently not, I think.


Datomic does support a REST API too does it?


Note that there is a pod for datalevin, if you're looking for a light-weight datalog-database with babashka


@krishanvj Ah, it seems there is a JS client for Datomic, although I'm not sure how reliable it is, but perhaps you can try it with #nbb

ūüĎÄ 1
Karol Wójcik19:10:10

Is the new babashka version compiled with GraalVM native-image 21.3.0?


why? I don't think so yet

Karol Wójcik19:10:20

I'm thinking how much babashka would shrink by the compilation with new release of GraalVM native-image. For most users this is not important, but for me is ūüėĄ Lower binary size = lower AWS Lambda cold start


I have posted this before in the #graalvm channel: it shrinks with about 10mb but this 10mb is regained once you upgrade to java 17

Karol Wójcik19:10:22

Do you want to upgrade to 17? Why not to stick to 11 for now?


not sure yet.


btw lower binary size doesn't mean faster start of the binary on my local machine. why does this matter for lambda?

Karol Wójcik19:10:27

Because, before the code is executed for the first time it has to be downloaded from s3, then unpacked ūüėĄ

Karol Wójcik19:10:09

That's why I once told you the cold start for babashka is much higher than for native-compiled binary for hello world example ūüėĄ

Karol Wójcik19:10:50

It's nothing wrong with the bb itself ūüėĄ It's just the architecture of AWS Lambda.


I don't think it will be a very significant difference either way, it's not more than 10-15% or so


@UJ1339K2B I just saw this: Could it be interesting to make this compatible with #nbb?

Karol Wójcik19:10:26

Maybe some #nbb users would like it, but frankly I used pulumi only once (same for aws-cdk) (to only show it's possible to integrate it with HL), so I dunno how much this is important.

Karol Wójcik19:10:48

I use Terraform and I'm rather against any CDK alike solutions

Karol Wójcik19:10:54

Also this looks like only a subset of pulumi.


you can use the pulumi nodejs library directly in nbb, no compilation required, which could be useful for this kind of scripting stuff


assuming that someone finds pulumi itself interesting

Karol Wójcik19:10:17

Hmm. If I were you I would not bother making it compatible with #nbb yet.


> which means you can now develop lambdas on M1 Hmm, don't you need graalvm m1 support for this?


Congrats on the release btw :)

‚̧ԳŹ 1
Karol Wójcik20:10:24

> Hmm, don't you need graalvm m1 support for this? Nope. ūüėĄ GraalVM native-image already supports AMD64 linux. AWS Lambda now also support ARM64 (This is new. Like few weeks old).

Karol Wójcik20:10:51

ARM64 AWS Lambda is on linux obviously, and that's why it works.


then I guess I don't get the M1 reference

Karol Wójcik20:10:23

The reason M1 users were having troubles with using HL is because docker emulation is extremely slow when on M1 when using AMD64 docker images.

Karol Wójcik21:10:07

When I created HL, there was no ARM64 support for AWS Lambda, and using the emulation was the only choice.


oh I see :)


do you mean arm64?

Karol Wójcik21:10:50

Right. There was no ARM64 support.

Karol Wójcik21:10:58

isn't aarch64 == arm64?


oh so using arm64 docker images is faster on m1 than using amd64 images - is this what you mean?


yes it's the same, but I thought you made a typo


in amd64 -> arm64

Karol Wójcik21:10:03

It's not only faster, but also it works. Using AMD64 docker image with GraalVM on M1 tend to hang indefinitely.


ok, cool, all clear now

Karol Wójcik21:10:04

The new release also makes it possible to run babashka on ARM64 AWS Lambda. This is 100ms improvement in cold starts for simple hello world programs.


nice! btw, it is possible to trim down babashka using feature flags. there is one feature flag called BABASHKA_LEAN which leaves out most libraries, java.time, etc.


but then you have to compile it yourself

Karol Wójcik21:10:33

The problem with trimming it down is that you can never know what libraries one finds essential. I would have to release bunch of runtimes on AWS serverlessrepo. This is painful to mantain.


When you want to optimize and put in the time, that is when you go Clojure native with GraalVM I think

Karol Wójcik21:10:50

Exactly! Btw you can use to create a serverlessrepo of nbb layer ūüôā


Tell this to viesti or valterri :)


I mean valtteri


I want to experiment more with this myself, but my fear about AWS is that I will do something foolish which will empty my creditcard and make me go bankrupt

ūüėā 1

I wish there was some limit you could put on the money they can extract

Karol Wójcik21:10:27

See also here: Query for holy-lambda. All that has to be done on AWS console is to click "publish" on the pushed layer (for the first time). cc @U6N4HSMFW @U06QSF3BK

Karol Wójcik21:10:24

Hah. I can relate. I was afraid of this as well. You can set a cloudwatch rule when you cross some hard limit like (1$).


But what if I go to sleep and wake up to a 10k bill?


Cloudwatch doesn't help against this

Karol Wójcik21:10:06

The thing is that for AWS Lambda it's hard cross the free tier limit when doing either development or testing.

Karol Wójcik21:10:24

There is AWS budget or something like this, so you can specify a hard limit AFAIK.


I guess so. I think I used up my free tier long ago in 2014 or so

Karol Wójcik21:10:47

But AWS Lambda is lifetime free

Karol Wójcik21:10:56

for 1M of invocations per month


so I can crop 1M pictures a month on lambda for nothing?

Karol Wójcik21:10:40

Almost like nothing

Karol Wójcik21:10:58

Depends on what you use with Lambda

Karol Wójcik21:10:09

but yeah, regarding compute you pay nothing for invocations


so I think they want to make you use other services like s3, dynamodb etc right


and earn more money by making lambda attractive and get more users for the other services?


I guess I could write a lambda for a survey which stores the answers in dynamodb


but just making a 5$ VPS will also do the trick and limit my costs for sure


but I will try to do some lambda myself soon


hmm, what if you exposed your lambda via a route and it would get DDOS-ed? this could still cost you a lot of money I guess

Karol Wójcik06:10:42

1. All the services are protected via AWS Shield at no charge: 2. Actually AWS Lambda is cheap, and most of the serverless solutions are cheap for low usage. The biggest bill you will is by using VPC Gateway for private subnets (if you're using it). What AWS wants is to make you use only AWS, hence lifetime free tiers :D


ah neat, I had seen Luke's Pulumi cljs wrapper ( , but somehow missed the connection to nbb (nbb might not have existed that time)


I haven't used Pulumi myself but this colleague of mine, Kari, has used and I think Pulumi is valid and neat tech, just that I tend to prefer Terraform :)


Terraform also has CDK nowadays too, uses same magic as Cloudformation CDK


but yeah, nbb + Pulumi would be a neat thing I think :)

Karol Wójcik09:10:52

@U04V15CAJ I think you can try HL with Datalevin + Elastic Storage. :D you would not have to learn the dynamodb :)


sounds good


babashka also supports it as a pod

Karol Wójcik13:10:41

Btw does babashka supports some kind of server for ring specification?


@UJ1339K2B do you mean: does babashka support a web server that can serve a ring handler?

Karol Wójcik13:10:35

Yeah. Exactly that.



Karol Wójcik14:10:04

Cool. Tomorrow I will release an adapter between ring and HL. It's already used by Retailic, I have just polished it more. So you can develop locally on babashka with the ring handlers and HTTP-kit and deploy it on AWS Lambda with the single command ;D

ūüėÉ 1
Karol Wójcik14:10:34

I’m also transforming real world example from polylith to AWS Lambda + Polylith. The main change is just bb.edn and reflection configs for native backend. Everything else stays mostly the same. This is extremely cool, since at any point of time you can transition back to servers if you don't like AWS Lambda.

‚̧ԳŹ 1
ūüėÉ 1