Fork me on GitHub
#graalvm
<
2022-01-20
>
David Pham16:01:45

Thanks a lot for https://github.com/clj-easy/graal-build-time :) I finally manage to build my first native non trivial app :) xD

David Pham16:01:58

I am so happy :smiling_face_with_3_hearts:

🎉 5
David Pham17:01:14

May I ask you where I could find a delay trick for applications? I have one dependencies (ring-defaults) that initialize time on call? :)

borkdude18:01:49

@neo2551 initialize time on call?

David Pham18:01:45

You could speak Ancient Greek it would be the same haha

David Pham18:01:43

Basically, I require a library and that library probably initialize something. How do you circumvent this problem?

borkdude18:01:22

@neo2551 Hack the library or make an issue/PR with the library

David Pham18:01:47

Thanks :) I hacked the library :) xD

David Pham18:01:58

I thought there would be some magic trick xD

David Pham18:01:04

Thanks a lot for your help!

borkdude18:01:34

an issue/PR would be the preferred long term solution. Glad you made it work. Do you care to tell us what you're making?

David Pham19:01:48

Sure, I am was just trying to make a simple http-kit server with reitit, so I found this example from @yogthos https://github.com/yogthos/graal-web-app-example and this blogpost https://www.redpill-linpro.com/techblog/2021/03/31/faster-clojure-with-graalvm.html which uses docker to make compile the jar into a native application. The challenge is that the examples uses lein (I prefer deps.edn) and also that [ring/ring-defaults "0.3.2"] has a joda initialization, so I had to hack the ring-defaults (basically removing the cookies and the session middleware).

David Pham19:01:34

I need to create a simple proxy server at work, but I was interested in compiling to native for a long time 🙂

borkdude19:01:15

cool. babashka also has web-app examples btw if performance is not so important

David Pham19:01:01

yes, that was also one of the options, but I suspect performance will be critical

David Pham19:01:28

I mean, I don't know how much performance I am loosing with babashka

borkdude19:01:08

I don't know you're requirements but if you use the same deps as the babashka web-app example, you can strip a lot of dependencies and binary size

borkdude19:01:50

> Requests per second: 14491.85 [#/sec] (mean)

borkdude19:01:47

Just extra info. No need to do anything. Your current approach works and you got your first native app, this is great, congrats :)

David Pham19:01:46

Thanks, I will take little victory over little victory 🙂 I feel like 2 years ago, after I released my first cljs webapp xD

🎉 2