joker

Discuss all things joker, the Clojure interpreter/linter on top of Go. https://github.com/candid82/joker
Zoltan Kalmar 2019-12-02T10:09:26.135300Z

I have that latest joker on MacOS (installed via brew)

Zoltan Kalmar 2019-12-02T10:09:38.135500Z

$ cat h.joke 
(ns hu.evernode.test
  "Hiccup test" 
  (:use [joker.hiccup]))

(println (html [:span {:class "foo"} "bar"]))

Zoltan Kalmar 2019-12-02T10:09:54.135700Z

$ joker --lint h.joke 
h.joke:5:11: Parse error: Unable to resolve symbol: html

Zoltan Kalmar 2019-12-02T10:10:18.136100Z

however it works

Zoltan Kalmar 2019-12-02T10:10:31.136300Z

$ joker h.joke 
<span class="foo">bar</span>

Zoltan Kalmar 2019-12-02T10:11:05.136800Z

$ joker -v
v0.14.0

Zoltan Kalmar 2019-12-02T10:11:23.137Z

should I file an issue on github?

jcburley 2019-12-02T13:32:38.137100Z

Quoting from the README.md at https://github.com/candid82/joker:

If you use :refer :all Joker won't be able to properly resolve symbols because it doesn't know what vars are declared in the required namespace (i.e. clojure.test). There are generally three options here:
Since :use is similar to :refer :all, the advice pertains. Check out the three options listed in that file.

Zoltan Kalmar 2019-12-02T14:23:13.137400Z

oh, i forgot that. Thanks!

👍 1
hlship 2019-12-02T18:13:07.139300Z

When using ns-sources, why do you map a string for the namespace, rather than a symbol? Seems odd. Also, feels odd to put the ns-sources before the ns call, rather than inside it, ala :require, etc.

hlship 2019-12-02T18:59:52.140600Z

ANN: net.lewisship.multi v1.0.0 net.lewisship.multi is a complement to joker.tools.cli that allows a single tool, a Joker script, to contain multiple commands, each with its own command line options and arguments. https://github.com/hlship/multi

👍 1
hlship 2019-12-02T19:10:16.143100Z

I think the ns-sources mechanism is promising, but I think it could be a bit easier; for instance, a special case for libraries that are available from github; maybe

(ns-sources {"net.lewisship.multi" {:github "hlship/multi" :version "v1.0.0"}})
would expand to <https://raw.githubusercontent.com/hlship/multi/v1.0.0/src/net/lewisship/multi.joke>

2019-12-02T20:34:45.144300Z

Woah! That ns-sources looks awesome! > {:github "hlship/multi" :version "v1.0.0"} :version here is a ref/tag?

hlship 2019-12-02T21:01:00.145300Z

That was just a strawman; right now only :url is supported, not :github. Maybe :tag would be more be more accurate than :version?

2019-12-03T18:21:06.146700Z

Yeah I thought :tag / :sha would be good options for the github interface

👍 1
2019-12-03T18:21:55.146900Z

I had originally gone down that route, only to realize that it was challenging at best (I couldn't find a suitable solution) to get to private repos

2019-12-07T11:33:28.174200Z

I had debated how much to do in go vs joker, but maybe there's a path where the ns-sources could be extended through a multimethod so you could support external libs from any number of foreign source