cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
dpsutton 2020-06-27T19:22:25.308900Z

would love eyes on the comments for the following ticket. I think i'm on the right track just wondering if there would be some useful insight from the cljs dev side: https://clojure.atlassian.net/projects/ASYNC/issues/ASYNC-91?filter=allopenissues&orderby=priority%20DESC

dnolen 2020-06-27T19:33:32.309300Z

@dpsutton I think you're suggesting changing ClojureScript but that's not really desirable

dnolen 2020-06-27T19:33:40.309600Z

the bug is most certainly in core.async

dnolen 2020-06-27T19:33:55.309900Z

(but maybe I'm misunderstanding)

dpsutton 2020-06-27T19:40:29.312Z

Core async works on the macro expanded form. “and” has an optimization that if it could be suppressed, everything works fine. The hope was there’s an easy way to prevent the optimization

dpsutton 2020-06-27T19:41:05.312600Z

And I was hoping someone here might know of an easy way to prevent it

dnolen 2020-06-27T19:41:32.313Z

there are probably easy ways but I would say not really interested in that

dnolen 2020-06-27T19:41:54.313500Z

would rather fix core.async fundamental issues than to continue to play whack-a-mole

dnolen 2020-06-27T19:42:09.313900Z

we may do other optimizations

dnolen 2020-06-27T19:42:17.314100Z

anyways no changes to ClojureScript

dnolen 2020-06-27T19:42:33.314500Z

that said - there's nothing wrong with intercepting at core.async

dnolen 2020-06-27T19:43:14.315200Z

optimizations are kind of meaningless in a go block

dpsutton 2020-06-27T19:43:53.316200Z

Yeah agreed

dnolen 2020-06-27T19:43:55.316300Z

that is optimizations that ClojureScript would do, since the go block is going to rewrite everything in case you might park

dnolen 2020-06-27T19:45:47.317200Z

so probably you could do something such that or and and have a core.async specific macroexpand

dnolen 2020-06-27T19:46:13.318200Z

another alternative that I would accept that's less hacky that does involve changes to ClojureScript

dpsutton 2020-06-27T19:46:17.318600Z

Ohh. I hadn’t considered that. And that’s what I guess I was fundamentally trying to do

dnolen 2020-06-27T19:46:25.318800Z

is a optimization pass instead of doing it via macros

dnolen 2020-06-27T19:46:45.319100Z

this is probably the most "correct" option

dnolen 2020-06-27T19:47:37.319700Z

an interesting side benefit would be that nested if could always be optimized

dnolen 2020-06-27T19:47:46.320Z

versus the hard coding at and or

dnolen 2020-06-27T19:48:04.320400Z

then core.async and ClojureScript wouldn't interact at all really

dnolen 2020-06-27T19:48:20.320800Z

because the go block obviously won't optimize, but normal code would

dnolen 2020-06-27T19:49:12.321200Z

it's probably easier than it may sounds since this is Clojure

dnolen 2020-06-27T19:49:45.322Z

if you have a '`if` case you can check the test, check the branches

dnolen 2020-06-27T19:49:51.322200Z

and collapse the AST if possible

dnolen 2020-06-27T19:50:29.322500Z

at which point you can restore the old and or macros

dnolen 2020-06-27T19:50:36.322700Z

and this core.async problem goes away

dnolen 2020-06-27T19:52:02.323800Z

but definitely not interested in meta flag here for ignoring stuff - yes it's an expedient pattern you'll find in ClojureScript implementation - but I think not well suited for this problem

dpsutton 2020-06-27T19:57:31.324Z

can i make a jira ticket about this?

dnolen 2020-06-27T19:58:33.324800Z

please do!

dpsutton 2020-06-27T19:59:01.325300Z

also, as a temporary measure before the ast-based passes can be implemented, what would "or and and have a core.async specific macroexpand" look like? Do i update in the environment passed to macroexpand?

dpsutton 2020-06-27T19:59:15.325800Z

i can't tell if that's hacky or using the exposed API as intended

dnolen 2020-06-27T19:59:23.326100Z

to be honest I really do think the last option is the right way to go

dpsutton 2020-06-27T19:59:33.326500Z

the changes to cljs?

dnolen 2020-06-27T19:59:38.326700Z

meta flag and core.async special casing are both complecting options

dpsutton 2020-06-27T19:59:53.327400Z

i agree. and i suppose with the workarounds listed in the ticket it can wait a bit for that

dnolen 2020-06-27T19:59:54.327500Z

where one has to know about the other

dpsutton 2020-06-27T20:00:12.328200Z

thanks for your insights on a saturday

dnolen 2020-06-27T20:00:14.328300Z

whereas a optmizing pass just gets rid of the problem

dnolen 2020-06-27T20:00:51.328900Z

but also optimizes more stuff

dnolen 2020-06-27T20:01:41.329600Z

and also sets a better precedent, there a couple other hard coded optimization cases that could either reuse the above or be based on it

dnolen 2020-06-27T21:49:47.330900Z

made some headway w/ GH action based testing - basics should be done by tomorrow - this definitely simplifies some things I've long wanted to do

👍 4
1
dnolen 2020-06-27T21:50:42.332100Z

it would be nice to run tests against the most critical tooling, Figwheel, Shadow, Reagent, etc. so pondering that

dnolen 2020-06-27T21:51:30.333Z

but we can also do some browser based testing (REPL testing) to get some sense of coming breakage from Closure and Closure Library

dnolen 2020-06-27T21:51:59.333700Z

other thing is we could now easily collect performance metrics for runtime and compile time and collect that somewhere

dnolen 2020-06-27T21:52:20.334200Z

will do some of these, but also very interested in contributions for the above

dnolen 2020-06-27T21:54:49.335200Z

re: testing N JS runtimes it does seem we can maintain our JS VM matrix approach w/o worrying about super long build times thanks to GH Action caching

bhauman 2020-06-27T23:39:55.335600Z

Very cool