Fork me on GitHub

If you have been using to infer Malli schemas for your Clojure code, a complementary tool was released,;ssr=false#overview ( This extension leverages information that you produced when inferred the schemas, allowing you to visualize data at your VSCode environment. It works with the web version of VSCode (, the main use case is that you have committed Pitoco schema files generated by pitoco.instrument/store-instrumented-vars! (locally or from your CI) and, for example, when you are reviewing a PR, you press . and then you can hover over your var anywhere and have schema + examples right away without the need to specify any of them beforehand, everything is collected from runtime. It's simple and rough right now, but take a look, report an issue, open a PR o/ See a short video about it at

clojure-spin 10
🎉 5
😻 1
malli 1

@U5R6XUARE That's awesome! I've been thinking about something like this for clj-kondo as well. It could generate an HTML view or overlay for code with references to other vars, etc.

❤️ 4

Similar to how github has some navigation features for some popular languages, but unfortunately not clojure

👍 1

Yes, exactly!! I was thinking in creating some web view first, but hover was simpler. Clj-kondo could benefit a lot from it, I like the idea!! The extension is made in cljs, I have missed the REPL ahahaha


I mean, the clj-kondo analysis can be exported to JSON and then be shown in this JS extension or so


I have asked Github on Twitter once if they would support something like this for their UI: just some files in the repo with information about the code which can be used by their navigation,etc feature


But they were adamant that everything was implemented in terms of treesitter


Yes yes, it would be great! One issue I was having is where to store this information, at the moment it reads locally from a committed file, but I am thinking in adding supported for S3 so people can have their commits clean (no generated file with megabytes of information committed).


yeah, s3 or google cloud


whatever, could be configurable as long as you have a URL with a file to download


nice! Malli itself can do some basic inferring of schemas based on malli schemas or arglists. Maybe that could be plugged in too?

(defn kikka
  ([a] [a])
  ([a b & cs] [a b cs]))

(md/infer #'kikka)
; [:=> [:cat :any] :any] 
; [:=> [:cat :any :any [:* :any]] :any]]


(mx/defn kukka :- [:vector :int]
  ([a :- :int] [a])
  ([a :- :int, b :- :int, & cs :- [:* :int]] [a b cs]))

(md/infer #'kukka)
; [:=> [:cat :int] [:vector :int]] 
; [:=> [:cat :int :int [:* :int]] [:vector :int]]]


Yes, I'm using the wonderful malli.destructure ns in the extension, it works pretty well :)


oh, didn’t notice, cool 😎


living in the future!

🚀 1

Hi folks! One day I found out a tool that converts JS to ClojureScript, but unfortunately it didn't support most of JS features. I decided to hack on it, found out that it was written in JS, could not find my way around the code, so I decided to do a rewrite: This is the live version:

🎉 12
🔥 10

BTW, I accept help from people that know more about UI design to make it better :rolling_on_the_floor_laughing:

😄 1

Cool! Why do you need this out of interest? To be nice to your eyes when reading JS?

trollface 1

i was looking for something like this when reading js documentation that I wanted to copy to cljs. so good to know it exists the specific case was copying jsx logic to cljs, which may be more difficult to support given various ways it could be written 😅




@U3Y18N0UC I tried what it would make for class Foo {}

(modern/defclass Foo (constructor [this]))


Yeah, that's the [shadow.cljs.modern :as modern] require that I'm not importing yet 😅


@UPH6EL9DH the problem with JSX is that it's not really Javascript, so... you need to Babel first 😞


you can find online JSX translators as well, but I would find that a nice bonus for the online version


JSX -> Reagent


Yeah, I intend to add some configs in the future, like, "convert all objects to CLJS" (right now it tries to keep JS structures intact for example)


That's why JS destructuring becomes so weird 😄


I've actually pondered if I should support some kind of JS like language for babashka for people who want to use the libraries/Java classes, but can't write Clojure. So far the answer has been no every time, but with this as front-end, it could be fun ;)


But I guess you would soon run into issues like Thread.sleep(1000) -> (Thread/sleep 1000) vs (.sleep Thread 1000)


what’s a use case for people who know only JS wanting to use Java classes?


JS/Java-ish syntax may be more familiar to them


BTW, thanks for multiple comments, I found and fixed some bugs :D


It would be really handy for me if we could make it work both ways, as a Clojurist dabbling in JS from time to time 🙂


@U04V5VAUN CLJS already translates clojure into JS ;)

😆 1

This is awesome!

Chris McCormick09:02:51

@U04V5VAUN you might be interested in which outputs JS from clojure-like lisp.


Cool! This is probably outside of the scope but this

String(count) + " times"
is formated as
(+ (String count) " times")
It would be nice to get
(str count " times")