babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
2020-12-14T11:00:54.267800Z

@borkdude how much do you think would it cost you to build bigger binaries?

2020-12-14T11:01:15.268300Z

(I am referring to your study on the survey).

borkdude 2020-12-14T11:04:57.268400Z

Depends. What do you have in mind?

2020-12-14T11:49:52.269200Z

Well, I was curious how much it would cost you if you had to leave the free tier of CI.

borkdude 2020-12-14T11:52:17.269400Z

I think somewhere between 150-300 dollars a month based on current usage on CircleCI. But maybe it would be possible to setup some AWS/other cloud stuff as well. Not sure.

Calum Boal 2020-12-14T17:26:30.270500Z

Any tips on emacs integration with babashka?

borkdude 2020-12-14T17:27:10.271Z

Do you mean like interacting with a REPL? Or doing fun things from emacs with babashka?

Calum Boal 2020-12-14T17:29:14.271800Z

Yeah, repl for one, also the linter i have doesn't like some of the implicitely included libs

borkdude 2020-12-14T17:30:28.272600Z

@cgboal521 For the linter, read this: https://book.babashka.org/#style For running a REPL, read this: https://book.babashka.org/#repl

Calum Boal 2020-12-14T17:31:53.273300Z

Ah okay nice one, so just include the stuff you want to use to shut up the linter

noprompt 2020-12-14T20:12:19.273600Z

Tips on fixing this one?

(ns babashka-test
  (:refer-clojure :exclude [list]))

(defn list [& args])

(defn void [& args])

(defmacro * [& args]
  `(void (list ~@args)))

(prn (macroexpand '(* 1 2 3)))
;; =>
(babashka-test/void (clojure.core/list 1 2 3))

noprompt 2020-12-14T20:12:52.274300Z

list is resolving to the wrong thing.

borkdude 2020-12-14T20:13:29.274500Z

hmm, that seems like a bug

borkdude 2020-12-14T20:13:36.274900Z

let me check

noprompt 2020-12-14T20:13:57.275300Z

I can work around it for now.

noprompt 2020-12-14T20:14:19.276Z

If you file a ticket can you tag me on it?

borkdude 2020-12-14T20:14:41.276400Z

yes please.

noprompt 2020-12-14T20:15:00.276800Z

OK I’ll file the ticket. 🙂

borkdude 2020-12-14T20:15:39.277Z

https://github.com/borkdude/babashka/issues/682

borkdude 2020-12-14T20:15:47.277400Z

I misread it, but then I correctly read it ;)

noprompt 2020-12-14T20:17:51.277800Z

OH LOL I just filed it. 😂

noprompt 2020-12-14T20:18:23.278100Z

I closed mine 🙂

borkdude 2020-12-14T20:20:08.279100Z

I know where to fix it, it's not hard. If you think it's fun to fix, I can point you to it, but else I'll fix it soon

noprompt 2020-12-14T20:20:12.279300Z

Looks like its a general problem with exclusion

noprompt 2020-12-14T20:20:24.279700Z

I tried with vector and noticed the same

borkdude 2020-12-14T20:20:27.279900Z

yes

noprompt 2020-12-14T20:20:48.280400Z

Point me to the source

borkdude 2020-12-14T20:20:55.280600Z

it's a problem in syntax quote resolving syms. it doesn't look at exclusions

borkdude 2020-12-14T20:21:23.280900Z

@noprompt here it should be fixable: https://github.com/borkdude/sci/blob/master/src/sci/impl/parser.cljc#L23

noprompt 2020-12-14T20:22:14.281600Z

Am I able to REPL this project?

noprompt 2020-12-14T20:22:50.282400Z

Asked another way, can I solve this from the REPL and then run the tests in the shell?

borkdude 2020-12-14T20:24:05.282800Z

Yes. you clone the sci project. and then:

$ clj
Clojure 1.10.1
user=> (require '[sci.core :as sci] :reload-all)
nil
user=> (sci/eval-string "(ns foo (:refer-clojure :exclude [inc])) (defn inc []) `inc")
clojure.core/inc
user=>

borkdude 2020-12-14T20:26:10.283400Z

@noprompt if you stick this in fully-qualify:

_ (prn the-current-ns)
you will see:
user=> (sci/eval-string "(ns foo (:refer-clojure :exclude [inc])) (defn inc []) `inc")
{:obj #object[sci.impl.vars.SciNamespace 0x699e81db "foo"], :refer {clojure.core {:exclude #{inc}}}, inc #'foo/inc}
clojure.core/inc

borkdude 2020-12-14T20:26:14.283600Z

that should be a good hint how to fix it

noprompt 2020-12-14T20:32:27.283900Z

Thanks!

borkdude 2020-12-14T20:32:58.284300Z

In the analyzer.cljc I have this:

(when-not (contains?
                     (get-in the-current-ns [:refer 'clojure.core :exclude]) sym-name)
...

borkdude 2020-12-14T20:36:26.285200Z

(we could probably avoid the contains call if there is no :exclude)