sci

borkdude 2023-11-24T11:08:23.879499Z

🙌 1
Ingy döt Net 2023-11-24T16:00:02.596949Z

Is there something like *sci-version* ?

Ingy döt Net 2023-11-24T16:02:22.994359Z

I'm having issues with the new sci release that I've included in my build and I thought it would be useful to show empirically which SCI is being used.

Ingy döt Net 2023-11-24T16:02:58.063379Z

Seems like it would be nice in bb too

borkdude 2023-11-24T16:03:01.693539Z

it might be present in *clojure-version*

Ingy döt Net 2023-11-24T16:03:08.970139Z

isn't

Ingy döt Net 2023-11-24T16:03:22.159489Z

well not from bb

borkdude 2023-11-24T16:03:50.281049Z

you can obtain the SCI version using (slurp (io/resource "SCI_VERSION"))

borkdude 2023-11-24T16:03:57.126929Z

in your host

Ingy döt Net 2023-11-24T16:05:16.226089Z

bb repl gives

user=> (slurp (io/resource "SCI_VERSION"))
(slurp (io/resource "SCI_VERSION"))
java.lang.IllegalArgumentException: Cannot open <nil> as a Reader. [at <repl>:2:1]

borkdude 2023-11-24T16:05:24.705069Z

in your host

Ingy döt Net 2023-11-24T16:05:38.288919Z

not sure what that means then

borkdude 2023-11-24T16:05:51.582309Z

not in the SCI program but outside of the SCI program

borkdude 2023-11-24T16:06:00.543759Z

it's part of the SCI library

Ingy döt Net 2023-11-24T16:06:59.664549Z

I see, so I could make my own *sci-version* is what you are implying?

borkdude 2023-11-24T16:07:17.173859Z

yes

Ingy döt Net 2023-11-24T16:08:20.431279Z

will do. I think this would be useful when reporting SCI issues...

borkdude 2023-11-24T16:08:56.224519Z

most of the time I use SCI as a git dependency so it's not as useful in that case

borkdude 2023-11-24T16:09:20.175389Z

just tag your releases so people can find out what deps.edn you're using in the version they use

Ingy döt Net 2023-11-24T16:10:27.717119Z

well at this point I would be reporting issues with current local builds

borkdude 2023-11-24T16:10:56.792879Z

ok

borkdude 2023-11-24T16:10:59.837379Z

makes sense

borkdude 2023-11-24T16:11:27.653549Z

I've also got an option in bb called: bb describe which prints a map with dependencies used

borkdude 2023-11-24T16:11:36.508389Z

or rather, what features are used

borkdude 2023-11-24T16:11:43.185509Z

and bb print-deps prints dependencies used

🙌 1
borkdude 2023-11-24T16:11:57.483449Z

but SCI isn't in there I think

borkdude 2023-11-24T16:12:07.111839Z

maybe it should be in there though

borkdude 2023-11-24T16:12:21.351059Z

since SCI itself is also exposed in bb

borkdude 2023-11-24T16:12:32.274689Z

anyway, this is something you could do as well

Ingy döt Net 2023-11-24T16:12:48.904559Z

(I'm having an issue with the latest sci, and anticipating you wanting to see I really am using a specific version...)

Ingy döt Net 2023-11-24T16:13:02.398719Z

I will add those to my todo!

borkdude 2023-11-24T16:13:37.060189Z

it would be useful if you could use deps.edn in this case, even if only for running a development version so you can find out what commit caused the issue for you

borkdude 2023-11-24T16:13:40.932609Z

what SCI commit

borkdude 2023-11-24T16:13:46.319289Z

I use both lein and deps.edn in bb

borkdude 2023-11-24T16:13:50.216359Z

deps.edn for development

Ingy döt Net 2023-11-24T16:13:53.634579Z

me too

borkdude 2023-11-24T16:13:56.440429Z

ah ok

Ingy döt Net 2023-11-24T16:14:12.337899Z

well I generate a deps.edn using your thinger

borkdude 2023-11-24T16:14:19.483289Z

oh yeah haha

🙂 1
Ingy döt Net 2023-11-24T16:16:04.039589Z

I'm only using releases for deps (not git deps) at this point.

borkdude 2023-11-24T16:16:33.018889Z

org.babashka/sci {:git/url " :git/sha "<commit-sha>"}

borkdude 2023-11-24T16:16:48.677159Z

what kind of issue are you facing? perhaps it rings a bell

Ingy döt Net 2023-11-24T16:17:25.090659Z

I'll mention it elsewhere in a few mins

borkdude 2023-11-24T16:17:33.259639Z

👍

Ingy döt Net 2023-11-24T16:49:39.266699Z

$ ys -pC '*sci-version*'
{:major 0, :minor 8, :incremental 41}

👍 1
Ingy döt Net 2023-11-24T16:50:52.471609Z

using

(def sci-version
  (sci/new-var '*sci-version*
    (->>
      (io/resource "SCI_VERSION")
      slurp
      str/trim-newline
      (#(str/split % #"\."))
      (map #(if (re-matches #"\d+" %) (parse-long %) %))
      (zipmap [:major :minor :incremental :qualifier]))))

👍 1
Ingy döt Net 2023-11-24T20:58:17.692659Z

FWIW, I noticed these are not available in sci by default.

cast unquote-splicing update-keys update-vals
will those be added?

Ingy döt Net 2023-11-24T20:59:38.436949Z

Many others too, but the others seemed very esoteric to me. TBH I've never use the 4 above, but they seemed possibly useful.

borkdude 2023-11-24T21:01:44.194229Z

SCI should work with older versions of clojure so for now it's better if you add those manually

borkdude 2023-11-24T21:01:51.139829Z

with sci/copy-var

Ingy döt Net 2023-11-24T21:02:04.859429Z

aha, that makes sense

Ingy döt Net 2023-11-24T21:02:24.203079Z

so they would work if added as far as you know?

borkdude 2023-11-24T21:02:55.746829Z

unquote-splicing isn't really used in programs. I've never come across a program that used cast

Ingy döt Net 2023-11-24T21:03:08.444549Z

check

Ingy döt Net 2023-11-24T21:03:44.109839Z

I also noticed dosync but transactions is probably a big can of worms

borkdude 2023-11-24T21:04:13.619429Z

check bb which has that

borkdude 2023-11-24T21:04:25.813489Z

but most people never use it

Ingy döt Net 2023-11-24T21:04:56.500969Z

sci is pretty amazing. was it a lot of work?

borkdude 2023-11-24T21:05:39.662199Z

yes

😆 1
Ingy döt Net 2023-11-24T21:06:04.021919Z

how long was it from conception to birth?

borkdude 2023-11-24T21:06:53.183279Z

Well, it was quite useful already from the beginning but a lot has happened in the last 4 years to improve performance etc

Ingy döt Net 2023-11-24T21:09:10.507389Z

lingy (my perl platform for clojure) would take a lot to get fully bootstrapped. but sci+graal makes getting yamlscript bootstrapped trivial. even though "trivial" is turning into 6+ months.

Ingy döt Net 2023-11-24T21:10:24.463609Z

it's always the little things that slow me down... but the overall picture hasn't changed since when I learned about sci/graal in July

Ingy döt Net 2023-11-24T21:11:08.926599Z

Every week I thought, I'll get it done this week. 😄 And I haven't taken barely a day off

😆 2