cljs-dev

souenzzo 2024-03-19T12:29:35.279839Z

Will cljs support some kind of the new method syntax? Something like this: (-> (js/fetch ...) (Promise/then (fn ...))?

borkdude 2024-03-19T12:46:17.547999Z

I guess for this to work (like in JVM Clojure 1.12) CLJS would have to have some runtime analysis to decide whether to compile to .then() or Promise.then() which it currently doesn't have (I believe, correct me if I'm wrong). One other thing here is that Promise is a global object, so you have write something like (js/Promise.then ..) or so, for it to resolve to something meaningful?

souenzzo 2024-03-19T13:00:56.070369Z

Not sure. I was just thinking about what release 1.12 would be like It may make sense in some scenarios: (js/Array.map arr inc) may generate some code like: Array.prototype.map.call(arr, inc) I don't know if it would be useful. It would probably need some runtime info...

borkdude 2024-03-19T13:02:38.042749Z

(js/Promise.prototype.then.call (js/Promise.resolve 1) prn)
#object[Promise [object Promise]]
1
That's a lot more code though? ;)

thheller 2024-03-19T13:17:59.812859Z

IMHO most of the stuff is not needed, given that JS is much more dynamic than Java you can pretty much go without any type info whatsoever

👍 1
dnolen 2024-03-19T19:49:55.362039Z

@thheller I saw they cut new GCC, any change for shadow?

👀 1
thheller 2024-03-19T19:50:25.185419Z

oh missed that. will check later and let you know.

thheller 2024-03-21T18:09:52.074459Z

I just tested the release and it seems ok. the npm packages that have been previously reported as failing now compiled without issues. can't say if they actually worked, but at least no compiler errors anymore. pushed a new shadow-cljs version using it.

dnolen 2024-03-21T23:15:42.873389Z

Ok cool!