Fork me on GitHub
#klipse
<
2017-01-31
>
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

moxaj14:01:41

I've eliminated all ^:const metadata temporarily

moxaj14:01:12

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

moxaj14:01:16

it seems so

moxaj14:01:32

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

Yehonathan Sharvit14:01:50

Nothing printed in the console?

moxaj14:01:40

only 404 GET requests

moxaj14:01:53

after the initial klipse related stuff

Yehonathan Sharvit14:01:53

Try to add verbose=1 url param

moxaj14:01:26

also, the timing on those requests is strange:

Yehonathan Sharvit14:01:30

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

moxaj14:01:46

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)

moxaj14:01:41

meh, cannot copy from the alert

moxaj14:01:48

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

moxaj14:01:59

mikron.core

moxaj14:01:02

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

moxaj15:01:06

wait, still requires clojure.core

moxaj15:01:14

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])))

moxaj15:01:52

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

Yehonathan Sharvit15:01:03

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

moxaj15:01:35

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

moxaj15:01:45

but the require-macros is inside the reader conditional

moxaj15:01:27

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

moxaj15:01:02

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

moxaj15:01:48

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

moxaj15:01:30

I guess that makes an entry for your list of differences

moxaj15:01:34

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

moxaj15:01:00

updated the page, take a look

Yehonathan Sharvit15:01:10

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

moxaj15:01:17

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

moxaj15:01:13

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

moxaj15:01:25

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)

moxaj22:01:59

@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?

moxaj22:01:53

just had a discussion in the cljs channel

moxaj22:01:04

turns out the self-require trick works after all

moxaj22:01:25

but it failed for me with lumo < 1.1

moxaj22:01:46

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

moxaj22:01:54

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

moxaj22:01:52

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