Fork me on GitHub
Yehonathan Sharvit07:01:04

I’ve deployed a fix to clojure.spec just now

Yehonathan Sharvit07:01:15

Please make sure you get klipse version 6.6.2


I've eliminated all ^:const metadata temporarily


but now the repl pretty much freezes when I tried to load my ns 😕


it seems so


I've been waiting for minutes in both a chrome and an edge tab

Yehonathan Sharvit14:01:50

Nothing printed in the console?


only 404 GET requests


after the initial klipse related stuff

Yehonathan Sharvit14:01:53

Try to add verbose=1 url param


also, the timing on those requests is strange:

Yehonathan Sharvit14:01:30

Can u send me the url for your code in klipse repl?


this just in:

Yehonathan Sharvit14:01:41

If you press ctr-s you will get a url that contains your source code

Yehonathan Sharvit14:01:09

(the error you got is ok. No clojure. Spec but cljs.spec The compiler tries clojure.spec and then cljs.spec)


meh, cannot copy from the alert


this is all I enter: (ns mikron.codox (:require [clojure.core]))




i'll edit

Yehonathan Sharvit14:01:07

I think it is also on the console

Yehonathan Sharvit14:01:22

And also you can do ctrl-r


wait, still requires clojure.core


edited my link

Yehonathan Sharvit15:01:56

There is an infinite loop

Yehonathan Sharvit15:01:05

Loading mikron.compile-util macros namespace

Yehonathan Sharvit15:01:18

I think that this is the problem

Yehonathan Sharvit15:01:23

(ns mikron.compile-util
  "Compile time utility functions."
  #?(:cljs (:require-macros [mikron.compile-util])))


oh well, didn't know that fails on self hosted 😮

Yehonathan Sharvit15:01:03

In self-host cljs, reader conditionals always branch to :cljs


I think regular cljs will use that branch as well

Yehonathan Sharvit15:01:13

because when you require-macros in regular cljs, it will branch to :clj


but the require-macros is inside the reader conditional


when the reader selects the branch, I don't think it cares what's inside of it

Yehonathan Sharvit15:01:58

What I meant is a bit different


but still YOU are right, since apparently this does not work in self hosted

Yehonathan Sharvit15:01:34

1. (require mikron.compile-util) => loads the code with :cljs branch

Yehonathan Sharvit15:01:56

2. in the :cljs branch there is a (:require-macros [mikron.compile-util])

Yehonathan Sharvit15:01:22

3. (:require-macros [mikron.compile-util]) => loads the code with :clj branch in regular clojure and :cljs branch in self-host


yeah, it seems like a circular dep, but it works in regular cljs

Yehonathan Sharvit15:01:20

because require-macros in regular cljs takes the :clj branch


I guess that makes an entry for your list of differences


between regular and self hosted

Yehonathan Sharvit15:01:55

You’re welcome to add it

Yehonathan Sharvit15:01:23

I think that the simples solution is to use a namespace with a slighly different name for the macros

Yehonathan Sharvit15:01:37

something like mikron.compile-util.macros

Yehonathan Sharvit15:01:08

and put it in a .clj file with no reader conditionals

Yehonathan Sharvit15:01:46

This is the trick that is done in cljs.spec and cljs.core.async I think

Yehonathan Sharvit15:01:10

But I agree with you that should be more emphasized

Yehonathan Sharvit15:01:23

Feel free to edit the wiki page to make it 100% clear


updated the page, take a look

Yehonathan Sharvit15:01:10

I would even say explicitely that it will cause an infinite loop


also, another option would be to use :require-macros and ditch this trick


if I remove the self-`require-macros` and use require-macros explicitly in the dependent namespaces, it would work

Yehonathan Sharvit15:01:44

that sounds like a good idea


I already have a few separate -macro namespaces, but that's only for the case when I'd like to use a macro in the same namespace (which I cannot do)


@viebel let me ask, does klipse use lumo < 1.1 or clojurescript < 1.9.456 for the compilation?

Yehonathan Sharvit22:01:28

klipse uses lumo 1.1.0 for generating the analysis cache

Yehonathan Sharvit22:01:00

at least this is how it is supposed to be

Yehonathan Sharvit22:01:17

but maybe a couple of namespaces have not been properly recompiled

Yehonathan Sharvit22:01:26

when I upgraded lumo

Yehonathan Sharvit22:01:35

Why are u asking this question?


just had a discussion in the cljs channel


turns out the self-require trick works after all


but it failed for me with lumo < 1.1


so now i'll load my project in lumo, and if it works, then you are probably using outdated deps


if it doesn't work, then I screwed up somewhere else 😄

Yehonathan Sharvit22:01:26

But I have to go to sleep now

Yehonathan Sharvit22:01:40

Feel free to write all your discoveries in this channel


alright, I hope i'm not bothering you too much

Yehonathan Sharvit22:01:55

I’ll read them - with pleasure - when I wake up

Yehonathan Sharvit22:01:32

I’m really happy that you don’t give up on the way to make your (cool) lib self-host compatible

Yehonathan Sharvit22:01:41

When you’ll be done you will be very happy