Clojurians
#cljs-dev
<
2016-05-28
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

bhauman17:05:20

@dnolen: just noting, that I swapped the args and updated the ticket

bhauman18:05:49

@mfikes: just wanted to let you know that it looks like you are assuming a 0 based column parameter in your error pointers

bhauman18:05:00

it's not 0 based

mfikes18:05:31

@bhauman: Yes, I know… I fudged it to make the pointer point at the symbol. Skating on thin ice.

bhauman18:05:51

oh gotcha :slightly_smiling_face:

bhauman18:05:01

I'm working on warnings now.

bhauman18:05:10

you can get a lot farther with them

bhauman18:05:49

A lot more info is available

bhauman18:05:14

@mfikes: I was just pointing it out because I was afraid that I was doing it wrong! :slightly_smiling_face:

mfikes18:05:32

Yep. I feel like I’ve committed a sin by adding one. :slightly_smiling_face:

bhauman18:05:54

yeah it's tough to work around

slipset18:05:53

@mfikes: I’ve added a patch to http://dev.clojure.org/jira/browse/CLJS-1593 but I’m having trouble testing it, in terms of making sure I run a nashornrepl on my code.

mfikes18:05:45

@slipset: Let me give it a spin…

slipset18:05:48

My hypothesis is that the munged symbols are exported somehow

slipset18:05:14

since (_PLUS_ 4 5) gives 9

slipset18:05:21

at least in Planck

mfikes18:05:15

@slipset: That patch doesn’t seem to fix CLJS-1593 for me. (The repro is still reproable.)

mfikes18:05:59

(I tried it in script/noderepljs and script/nashornrepljs.)

slipset18:05:09

ok, but for future reference, if I change something in core.cljs, how do I run a bootstrap repl on my newly changed code?

slipset18:05:31

as in which scripts in scripts do I need to run to get a fresh build?

mfikes18:05:33

@slipset: There is no bootstrap REPL that is part of the core ClojureScript tree. But, after making changes, generally they affect script/noderepljs and you can see them.

mfikes18:05:40

@slipset: There is script/test-self-parity which will run the test suite in a bootstrapped environment (in Node.js)

slipset19:05:45

but, I’m a bit slow, so just by starting eg script/noderepljs it will use my freshly edited core.cljs?

slipset19:05:24

or do I need to do some incantations to make that happen?

mfikes19:05:28

@slipset: Yes. That’s been my experience. Makes it real easy to change something in the ClojureScript codebase and check its effect.

slipset19:05:18

so, if you’ll pardon my ignorance, (_ 7 3) does not work in script/noderepljs, but that’s because noderepljs is not a bootstrapped repl?

mfikes19:05:50

@slipset: All I know about it is the what. I have no clue as to the why. But, right CLJS-1593 is a self-host issue (limited to that case).

slipset19:05:04

yes, since you can see in noderepljs

slipset19:05:16

cljs.user=> (cljs.js/eval-str (cljs.js/empty-state) "(_PLUS_ 7 3)" nil {:eval cljs.js/js-eval :context :expr} identity)
{:ns cljs.user, :value 10}

bhauman19:05:01

Darn there is no way for me to insert a warning handler in the piggieback REPL (piggieback calls cljs/repl for you, so you can re-bind cljs.analyzer/*cljs-warning-handlers*). Makes me think we should also have a :warning-handlers option on the cljs repl, another option. Maybe the ReplEnv can optionally implement another Protocol that perhaps has (-caught [_e]) and (-warn [warning-type env extra])

bhauman19:05:45

Or I can just modify piggieback.

mfikes19:05:26

@bhauman: But, if you pull it off, you are finding that your own warning handler is called with a treasure trove of diagnostic info?

bhauman19:05:29

@mfikes: yeah with the warning handler has a warning type key and often provides extra source info

bhauman19:05:20

so in some cases you can precisely underline the offending code

bhauman19:05:41

and also explain in more detail what the hell is going on.

mfikes19:05:43

To put things in perspective, when Piggieback and nREPL rose to prominence, ClojureScript didn’t even have *e nor (pst). Things were harsh back then. (I’m arguing that, since we are now onto a whole new slew of issues, in terms of refining the experience, Piggieback should continue to evolve.)

mfikes19:05:53

When *e was being added, we were adding fundamentals like mapped stack traces, having a def return a var, other things that make things feel civilized.

bhauman19:05:00

Absolutely, but we can now customize exception behavior with an option but we cannot customize, warning behavior with an option. Not a big deal at all, but ...., it still feels like its evolving.

bhauman19:05:24

And piggieback should move on as well.

bhauman19:05:25

And the pattern for piggieback, and figwheel is that it starts the REPL for you, and the options are what allow you to customize the behavior.

mfikes19:05:56

I suppose, with a lot of those previous “usability” / “dev experience” enhancements, it took changing things all through the tooling stack, even changing stuff down in the compiler. Perhaps there is nothing wrong with refinements like those continuing. (It is hard for tools at the edge of the stack to do it by themselves.)

bhauman19:05:16

and out of band behavior modifications that use bindings are difficult to forward through a call chain, and launch on a different thread.

bhauman19:05:57

right now, it feels like a :warning-handlers option kinda makes sense, and will be helpful for tooling

mfikes19:05:13

There’s a pattern employed here where the bound value for a dynamic var can be overridden via an explicitly passed option: https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/js.cljs#L826-L827

bhauman22:05:14

We could take some lessons from js.cljs and refactor repl.cljc a bit and provide a lower level api for repl building.

dnolen22:05:13

cljs.spec implemented in ClojureScript master

anmonteiro22:05:53

@dnolen: also planning on porting the tests? correct if I’m wrong, but I can’t seem to find them

dnolen22:05:16

yeah we need the tests as well as the REPL support

anmonteiro22:05:27

gotcha. anyways, awesome work, thanks for porting this goodness so hastily!

dnolen22:05:04

fortunately ClojureScript is so close to Clojure now it was a mostly boring affair

dnolen22:05:28

especially having simple support for reified vars already thanks to cljs.test

dnolen22:05:32

just added the REPL support

mfikes23:05:52

I’d second the sentiment for self-hosted ClojureScript. At least with what I’ve seen so far… it is just working. :slightly_smiling_face:

dnolen23:05:25

@mfikes: nice, I changed the .clj extensions to .cljc

dnolen23:05:36

but yeah I didn’t see anything that would make it not work in bootstrap

mfikes23:05:42

Thanks for that. That’s a good bit of … insurance.

mfikes23:05:08

The only thing I’m currently aware of is that alias. But will dig into it further.