This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-15
Channels
- # announcements (2)
- # babashka (41)
- # beginners (10)
- # calva (62)
- # chlorine-clover (70)
- # cider (19)
- # clara (2)
- # clj-http (1)
- # clj-kondo (1)
- # cljs-dev (3)
- # cljsrn (8)
- # clojure (168)
- # clojure-austin (1)
- # clojure-australia (2)
- # clojure-canada (1)
- # clojure-europe (15)
- # clojure-france (9)
- # clojure-nl (3)
- # clojure-serbia (5)
- # clojure-spec (14)
- # clojure-uk (8)
- # clojurescript (14)
- # community-development (30)
- # core-async (42)
- # core-typed (1)
- # datahike (2)
- # datalog (23)
- # datomic (4)
- # emacs (4)
- # figwheel-main (4)
- # fulcro (67)
- # ghostwheel (4)
- # girouette (1)
- # gorilla (7)
- # graalvm (11)
- # heroku (8)
- # integrant (42)
- # jobs (6)
- # jobs-discuss (47)
- # kaocha (7)
- # lambdaisland (2)
- # leiningen (5)
- # lsp (29)
- # off-topic (1)
- # pathom (9)
- # portal (6)
- # re-frame (5)
- # reagent (11)
- # releases (6)
- # remote-jobs (10)
- # shadow-cljs (112)
- # testing (55)
- # vrac (1)
$ bb '(fs/file-name (fs/real-path "."))'
"babashka"
file-name
just means the name part of a pathThis naming is also used by the java.nio.file package itself: https://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html#getFileName() The functions in babashka.fs are usually named after those
I have seen different implementations of basename
. Sometimes they do what fs/file-name
do, but sometimes they also strip the extension. I follow java.nio.file as much as possible in babashka.fs.
I’m looking for the equivalent to dirname
. Given a full path it returns the directory part of it:
$ dirname /Users/peter/Projects/my-proj/README.md
/Users/peter/Projects/my-proj
(Given a path to a directory it returns the parent directory. So seems like it uses the same semantics as babashka.fs/file-name
)
$ bb '(fs/parent (fs/real-path "."))'
#object[sun.nio.fs.UnixPath 0x27773e47 "/Users/borkdude/dre/DocSearch"]
@borkdude Thanks for getting all the things for https://github.com/babashka/babashka/issues/784 in so fast! I was about to add the aset-byte and related functions by myself but you were too quick. I was writing a few tests for them at the same time so could always submit that. But I guess testing stuff defined via copy-core-var
is fairly low value right? There are assumedly tests on the core functions which cover the logic
@slack1003 True. Unless you expect GraalVM to behavior potentially weird with these functions
Dunno the GraalVM limitations well at all. All its doing is calling setByte
(etc) on Array
which surely graal can handle alright.
@slack1003 In #babashka-circleci-builds you can test the newest build from master
@borkdude i’ll give it a quick run. so 76e2a241e767de2f38ac64c6f8a7e58be92fdd71 includes the latest sci changes then? Guess it gets triggered when sci updates?
@slack1003 it's triggered when I commit to babashka and I have committed the latest sci changes
@borkdude yup works for me! only tested aset-byte
on macos but all the others all go on the same principle
fs/parent
seems to be what I was looking for.
bb '(str (fs/parent "/Users/peter/Projects/my-proj/README.md"))'
"/Users/peter/Projects/my-proj"
hmm some funky behavior around combining print
and System/exit
.
This program produces no output on my machine:
#!/usr/bin/env bb
(print "hello world")
(System/exit 0)
I have a case where I am just calling bb on a subprocess script and dumping output, err, and then exiting with the returned exit code
@slack1003 This is expected behavior, it behaves the same in Clojure
how much would including of DONEjava.security.SecureRandom
add to a size of the babashka binary?
@ales.najmann I just added that in 0.3.5 :)
so hopefully, I'll have, in few days, an example of the partial homomorphic encryption scheme written for babashka
bb 0.3.5 somewhat simplified my work bb.edn, by allowing to invoke tasks in parallel using #{p1 p2}
, thanks @maxp
https://gist.github.com/borkdude/35bc0a20bd4c112dec2c5645f67250e3#file-bb-edn-L17
To be more precise, @borkdude added support for ByteBuffer
and all the typical classes that implement it. Hence this is more significant than just BinF. Just one example, @ericihli has recently announced a trie implementation that uses ByteBuffer
. Well now who knows, maybe that kind of code can run in BB without any adaptation.
It was worth a shot 😛 But point is, it probably opened the door for a new set of existing libs