This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-18
Channels
- # aleph (4)
- # announcements (2)
- # babashka (48)
- # beginners (59)
- # calva (5)
- # cider (14)
- # clj-kondo (4)
- # cljs-dev (3)
- # clojure (77)
- # clojure-europe (6)
- # clojure-italy (6)
- # clojure-nl (5)
- # clojure-spec (4)
- # clojure-uk (67)
- # clojurescript (19)
- # clr (3)
- # cursive (7)
- # datomic (36)
- # duct (33)
- # events (3)
- # figwheel (1)
- # fulcro (4)
- # funcool (2)
- # graalvm (3)
- # jobs (1)
- # joker (25)
- # kaocha (1)
- # leiningen (45)
- # malli (17)
- # off-topic (103)
- # quil (1)
- # re-frame (16)
- # reitit (1)
- # rewrite-clj (27)
- # shadow-cljs (39)
- # spacemacs (3)
- # sql (11)
- # tools-deps (14)
- # vim (41)
Did someone already thought of using babashka in the AWS Lambda context?
Like this but many more applications https://dev.solita.fi/2018/12/07/fast-starting-clojure-lambdas-using-graalvm.html
I think you would have to create a layer https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html
I was trying to use ex-info
's, ex-message
and`ex-data`. I see that these are not implemented yet. I'm looking into this, but it seems it is not very straightforward as it involves isInstance
(https://github.com/clojure/clojure/blob/clojure-1.9.0/src/clj/clojure/core.clj#L144). Did someone already consider using ex-data etc?
Should be added to sci here: https://github.com/borkdude/sci/blob/29c6ab20416b8662296f64f3ce92fdbd826bc286/src/sci/impl/namespaces.cljc#L184 And then bump babashka to use the newest sci.
ex-info
en ex-data
do work indeed (had to update babashka)
Made the change. Locally I can use ex-message
now
so maybe paste the definition of ex-message
at the top of the namespaces.cljc
file and define it if it doesn't exist yet
Found an issue with newlines I think (I can work around it for now) https://github.com/borkdude/babashka/issues/116
@jeroenvandijk pushed a CLJS fix to your branch: https://github.com/borkdude/sci/pull/159
@borkdude Thanks! (apologies for the extra work!)
nice! I'm a bit lost in the magic of all the difference versions now. And I thought this was any easy addition 🙈
Thank you!
btw, there is also ex-cause
😛 But I didn't need it yet (so I'm not a good tester)
user=> (apropos "ex-")
(clojure.core/ex-cause clojure.core/ex-data clojure.core/ex-info clojure.core/ex-message clojure.main/ex-str clojure.main/ex-triage clojure.spec.alpha/regex-spec-impl clojure.string/index-of clojure.string/last-index-of)
@borkdude Weird thing, I upgraded to bb
0.0.30 and connect to its socket repl from Chlorine. When I try to send to it the first form, (def dry-run? true)
it fails with
> Could not resolve symbol: tooling$eval-res [at line 6, column 963]
(the location clearly does not match my code)
Probably this can be a bug on Chlorine too. I'll upgrade bb and see what's happening
Also, when I tried to run my script as a whole it executed for a short while and then exited with unhelpful (the first string is obviously the path of f
in the code)
> ./asc/posts/1111-11-11-why-clojure-talk-transcript.asc [at line 47, column 22]
This is my code, starting with line 47:
(with-open [rdr (io/reader f)
wrt (io/writer (.getPath f'))]
(binding [*out* wrt]
(run!
#(println %)
(line-seq rdr))))
(Removing binding
and using .write wrt
does not help)Hm, I see now I get the same error with bb .28
@holyjak yes, it was working on version 0.0.24 and it is not working right now.
The line numbers, unfortunately, will not match (yet? is there a way to tell bb
what's the file name and line number of the current evaluation?)
FYI I have Chlorine 0.3.2. I did run brew upgrade
recently but it would surprise me (a little) if it did upgrade Chlorine...
A few days ago I used this w/o any issue
I'm on Chlorine 0.3.4. Somehow, the "blob" I send to capture the evaluation results is not being recognized on the newer version of bb
. I'm seeing if I can come to the issue
@borkdude this code isn't working anymore: (try ['tooling$eval-res (+ 1 2)])
Even if I rename to (try ['a-symbol (+ 1 2)])
, for example, it fails with Could not resolve symbol: a-symbol
@mauricio.szabo It isn't Chlorine issue. When I downgrade to bb 0.0.28-SNAPSHOT then evaluation in Chl. works. When I try again 0.0.30 it again does not.
OK, --verbose
helps a little to troubleshoot https://clojurians.slack.com/archives/CLX41ASCS/p1574106906330500 but still does not tell me why it failed:
> ExceptionInfo: ./2018-12-21-aws-rds-find-out-login-credentials.asc [at line 47, column 22]
@mauricio.szabo Fixed in v0.0.31:
$ bb "(try 'hello)"
hello
@borkdude Great, it works! @holyjak Just tested with Chlorine's last version, and I can evaluate commands again 🙂