Fork me on GitHub
#cljs-dev
<
2017-03-16
>
thheller09:03:28

@dnolen what are you current plans for using cljs.spec/fdefs for cljs internals? ie. (defn x :foo) throws a clojure.core.specs related error vs a {:tag :cljs/analysis-error ...} in CLJS

thheller09:03:51

currently looking into how I could possible leverage spec for the above tool stuff

thheller09:03:37

any plans to create something like clojure.core.specs for CLJS? maybe even use some of them?

thheller09:03:13

assuming we are waiting for things to finalize for CLJ first

dnolen13:03:49

@thheller happy to take a patch that either uses what Clojure has or copies them over

thheller14:03:40

ok cool, will look into that

thheller17:03:49

@anmonteiro good to know, thx

richiardiandrea19:03:26

@anmonteiro @mfikes have you ever noticed the following in self-host (happening in planck and lumo) ?

richiardiandrea19:03:34

cljs.user=> `(require 'speed-of-light.test-runner)
(cljs.core/require (quote speed-of-light/test-runner))

richiardiandrea19:03:44

(happening in replumb too)

mfikes19:03:09

Perhaps a bug in the compiler

richiardiandrea19:03:44

will open a Jira

thheller21:03:16

@dnolen can you tell me the reason why (def x foo) only emits a warning for CLJS but is a hard error in CLJ? I know that I can add a warning handler to turn it into an error, just trying to figure out why this behavior is different to clojure?

thheller21:03:36

assuming foo is undeclared of course

dnolen21:03:24

it doesn’t matter why it’s different now

dnolen21:03:28

it just is and we’re not going to change it

thheller21:03:00

don't mean to change it ... just curious if there is a reason I might be missing

dnolen21:03:17

I don’t recall that behavior is almost 5 years old

thheller21:03:21

JS being more dynamic and all

dnolen21:03:09

you can probably crawl through the git history to figure it out, but I really don’t remember

dnolen21:03:42

I suspect since we generate source files

dnolen21:03:58

if we errored then we’d have to clean up

dnolen21:03:56

in general though the philosophy has been if the issue doesn’t need to stop the compiler we just warn

dnolen21:03:42

this over following Clojure’s behavior closely

thheller21:03:42

yeah CLJ probably can't continue in this case, JS doesn't really care

thheller21:03:33

I'm just still trying to find the best strategy for the error reporting thing I posted yesterday

thheller21:03:46

CLJS is so much nicer to work with because of the rich metadata we have

thheller21:03:56

{:file "demo/warnings.cljs", :line 3, :column 1, :end-line 3, :end-column 13}

thheller21:03:11

CLJ I get :line and :column when I'm lucky 😛

dnolen21:03:38

the whole reason for tools.reader was to get line/column without waiting for Clojure

dnolen21:03:52

impossible to do source maps without good info

thheller21:03:48

yeah, warnings are also a lot better since they contain very useful things

thheller21:03:07

CLJ just throws very bare exceptions with minimal info

dnolen21:03:17

yep, another place we could just do more

thheller21:03:05

yeah I just threw together a little hack to get the form that caused the warning into the warning

thheller21:03:11

as its not always in there

dnolen21:03:30

happy to take patches that make it more consistent

thheller21:03:54

yeah will do if I have something concrete ... all just experimental for now