This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-29
Channels
- # babashka (30)
- # beginners (207)
- # biff (3)
- # calva (10)
- # cljs-dev (3)
- # clojure (34)
- # clojure-austin (3)
- # clojure-bay-area (1)
- # clojure-dev (3)
- # clojure-europe (31)
- # clojure-nl (1)
- # clojure-norway (37)
- # clojure-uk (8)
- # community-development (3)
- # core-async (4)
- # data-science (1)
- # dev-tooling (2)
- # emacs (4)
- # etaoin (12)
- # fulcro (7)
- # gratitude (1)
- # hyperfiddle (7)
- # jobs-discuss (191)
- # lsp (15)
- # malli (1)
- # other-languages (11)
- # overtone (1)
- # pathom (3)
- # pedestal (1)
- # polylith (21)
- # releases (1)
- # squint (5)
- # yamlscript (5)
Is there any example code of using external libraries in yamlscript?
I have an example of using a babashka Pod from YS. I'll see if I can find it.
Here's an example of using a bb Pod in ys:
$ cat pod-test.ys
!yamlscript/v0
use-pod: \'org::babashka/go-sqlite3 "0.2.3"
require pod::babashka::go-sqlite3: => sqlite
say:
sqlite/query:
.":memory:"
["SELECT 41 + 1 AS sum"]
The pod is autoinstalled on first run:
$ ys pod-test.ys
Downloading pod org.babashka/go-sqlite3 (0.2.3)
Successfully installed pod org.babashka/go-sqlite3 (0.2.3)
[{:sum 42}]
And then subsequently:
$ time ys pod-test.ys
[{:sum 42}]
real 0m0.040s
user 0m0.014s
sys 0m0.028s
I want to spend more time on making it even easier to use external libraries and pods. @USDPTD3FY if you (or anyone) has specific needs, let me know. It's always good to have a "customer" driving implementation.... 🙂
replied to a thread:Is there any example code of using external libraries in yamlscript?
Here's an example of using a bb Pod in ys:
$ cat pod-test.ys
!yamlscript/v0
use-pod: \'org::babashka/go-sqlite3 "0.2.3"
require pod::babashka::go-sqlite3: => sqlite
say:
sqlite/query:
.":memory:"
["SELECT 41 + 1 AS sum"]
The pod is autoinstalled on first run:
$ ys pod-test.ys
Downloading pod org.babashka/go-sqlite3 (0.2.3)
Successfully installed pod org.babashka/go-sqlite3 (0.2.3)
[{:sum 42}]
And then subsequently:
$ time ys pod-test.ys
[{:sum 42}]
real 0m0.040s
user 0m0.014s
sys 0m0.028s