klipse

Yehonathan Sharvit 2017-01-31T07:05:52.000573Z

Hey @moxaj

Yehonathan Sharvit 2017-01-31T07:06:04.000574Z

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

Yehonathan Sharvit 2017-01-31T07:06:15.000575Z

Please make sure you get klipse version 6.6.2

moxaj 2017-01-31T14:41:21.000578Z

@viebel hey

moxaj 2017-01-31T14:41:41.000579Z

I've eliminated all ^:const metadata temporarily

moxaj 2017-01-31T14:45:12.000580Z

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

Yehonathan Sharvit 2017-01-31T14:47:03.000581Z

Freezes forever?

moxaj 2017-01-31T14:47:16.000582Z

it seems so

Yehonathan Sharvit 2017-01-31T14:47:25.000583Z

😢

moxaj 2017-01-31T14:47:32.000584Z

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

Yehonathan Sharvit 2017-01-31T14:47:50.000585Z

Nothing printed in the console?

moxaj 2017-01-31T14:49:40.000586Z

only 404 GET requests

moxaj 2017-01-31T14:49:53.000587Z

after the initial klipse related stuff

Yehonathan Sharvit 2017-01-31T14:50:53.000588Z

Try to add verbose=1 url param

moxaj 2017-01-31T14:51:26.000589Z

also, the timing on those requests is strange:

Yehonathan Sharvit 2017-01-31T14:52:30.000591Z

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

moxaj 2017-01-31T14:53:46.000592Z

this just in:

Yehonathan Sharvit 2017-01-31T14:54:41.000595Z

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

Yehonathan Sharvit 2017-01-31T14:56:09.000596Z

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

moxaj 2017-01-31T14:58:41.000597Z

meh, cannot copy from the alert

moxaj 2017-01-31T14:58:48.000598Z

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

moxaj 2017-01-31T14:58:57.000599Z

oh

moxaj 2017-01-31T14:58:59.000600Z

mikron.core

moxaj 2017-01-31T14:59:02.000601Z

i'll edit

Yehonathan Sharvit 2017-01-31T14:59:07.000602Z

I think it is also on the console

Yehonathan Sharvit 2017-01-31T14:59:22.000603Z

And also you can do ctrl-r

Yehonathan Sharvit 2017-01-31T14:59:59.000605Z

Thx

moxaj 2017-01-31T15:00:06.000606Z

wait, still requires clojure.core

moxaj 2017-01-31T15:01:14.000608Z

edited my link

Yehonathan Sharvit 2017-01-31T15:06:56.000609Z

There is an infinite loop

Yehonathan Sharvit 2017-01-31T15:07:05.000610Z

Loading mikron.compile-util macros namespace

Yehonathan Sharvit 2017-01-31T15:07:11.000611Z

Any idea why?

Yehonathan Sharvit 2017-01-31T15:08:18.000612Z

I think that this is the problem

Yehonathan Sharvit 2017-01-31T15:08:23.000613Z

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

moxaj 2017-01-31T15:08:52.000615Z

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

Yehonathan Sharvit 2017-01-31T15:09:03.000616Z

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

moxaj 2017-01-31T15:09:35.000618Z

I think regular cljs will use that branch as well

Yehonathan Sharvit 2017-01-31T15:09:45.000619Z

No

Yehonathan Sharvit 2017-01-31T15:10:13.000620Z

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

moxaj 2017-01-31T15:10:45.000621Z

but the require-macros is inside the reader conditional

moxaj 2017-01-31T15:11:27.000622Z

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

Yehonathan Sharvit 2017-01-31T15:11:47.000623Z

You’re right

Yehonathan Sharvit 2017-01-31T15:11:58.000624Z

What I meant is a bit different

moxaj 2017-01-31T15:12:02.000625Z

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

Yehonathan Sharvit 2017-01-31T15:12:34.000626Z

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

Yehonathan Sharvit 2017-01-31T15:12:56.000627Z

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

Yehonathan Sharvit 2017-01-31T15:13:22.000628Z

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

Yehonathan Sharvit 2017-01-31T15:13:24.000629Z

makes sense?

moxaj 2017-01-31T15:13:48.000630Z

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

Yehonathan Sharvit 2017-01-31T15:14:20.000631Z

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

moxaj 2017-01-31T15:15:30.000632Z

I guess that makes an entry for your list of differences

moxaj 2017-01-31T15:15:34.000633Z

between regular and self hosted

Yehonathan Sharvit 2017-01-31T15:15:55.000635Z

You’re welcome to add it

Yehonathan Sharvit 2017-01-31T15:15:56.000636Z

🙂

Yehonathan Sharvit 2017-01-31T15:16:23.000637Z

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

Yehonathan Sharvit 2017-01-31T15:16:37.000638Z

something like mikron.compile-util.macros

Yehonathan Sharvit 2017-01-31T15:17:08.000640Z

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

Yehonathan Sharvit 2017-01-31T15:17:46.000641Z

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

Yehonathan Sharvit 2017-01-31T15:18:13.000642Z

And also this might help: https://github.com/cgrand/macrovich

Yehonathan Sharvit 2017-01-31T15:19:49.000644Z

(Actually there is a word about it in the wiki page: https://github.com/viebel/klipse/wiki/How-to-make-a-clojure-library-self-host-compatible#reader-conditionals

Yehonathan Sharvit 2017-01-31T15:20:10.000647Z

But I agree with you that should be more emphasized

Yehonathan Sharvit 2017-01-31T15:20:23.000648Z

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

moxaj 2017-01-31T15:24:00.000649Z

updated the page, take a look

Yehonathan Sharvit 2017-01-31T15:26:57.000650Z

Thx

Yehonathan Sharvit 2017-01-31T15:27:10.000651Z

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

moxaj 2017-01-31T15:27:18.000652Z

alright

moxaj 2017-01-31T15:29:17.000653Z

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

Yehonathan Sharvit 2017-01-31T15:31:17.000654Z

what do u mean?

moxaj 2017-01-31T15:33:13.000655Z

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

Yehonathan Sharvit 2017-01-31T15:33:44.000656Z

that sounds like a good idea

moxaj 2017-01-31T15:34:25.000657Z

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)

moxaj 2017-01-31T22:14:59.000659Z

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

Yehonathan Sharvit 2017-01-31T22:16:28.000662Z

klipse uses lumo 1.1.0 for generating the analysis cache

Yehonathan Sharvit 2017-01-31T22:17:00.000663Z

at least this is how it is supposed to be

Yehonathan Sharvit 2017-01-31T22:17:17.000664Z

but maybe a couple of namespaces have not been properly recompiled

Yehonathan Sharvit 2017-01-31T22:17:26.000665Z

when I upgraded lumo

Yehonathan Sharvit 2017-01-31T22:17:35.000666Z

Why are u asking this question?

moxaj 2017-01-31T22:17:53.000667Z

just had a discussion in the cljs channel

moxaj 2017-01-31T22:18:04.000668Z

turns out the self-require trick works after all

moxaj 2017-01-31T22:18:25.000669Z

but it failed for me with lumo < 1.1

moxaj 2017-01-31T22:18:46.000670Z

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

moxaj 2017-01-31T22:18:54.000671Z

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

Yehonathan Sharvit 2017-01-31T22:20:12.000672Z

I cannot wait...

Yehonathan Sharvit 2017-01-31T22:20:26.000673Z

But I have to go to sleep now

Yehonathan Sharvit 2017-01-31T22:20:40.000674Z

Feel free to write all your discoveries in this channel

moxaj 2017-01-31T22:20:52.000675Z

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

Yehonathan Sharvit 2017-01-31T22:20:55.000676Z

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

Yehonathan Sharvit 2017-01-31T22:21:06.000677Z

Not at all @moxaj

Yehonathan Sharvit 2017-01-31T22:21:32.000678Z

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

Yehonathan Sharvit 2017-01-31T22:21:41.000679Z

When you’ll be done you will be very happy

moxaj 2017-01-31T22:33:17.000680Z

@viebel it works!