cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
borkdude 2019-09-16T16:16:57.007800Z

made some enhancements to clj-kondo which utilizes type hints. it found this: > cljs/util.cljc:361:19: error: Expected: integer, received: nil. https://github.com/clojure/clojurescript/blob/a760439b5084937a556712d6ee056e95f4f075c7/src/main/clojure/cljs/util.cljc#L359 that begs the question if the type hint is correct when the value can also be nil.

2019-09-16T17:11:25.009400Z

That is a boxed Long. References can be nil, primitives cannot?

2019-09-16T17:11:58.009800Z

If you are referring to the ^Long type hint on the parameter n, that is.

2019-09-16T17:13:21.010700Z

If the type hint on n were ^long, I would wonder about the type hint, too, but I can't see a reason for ^Long being incorrect.

mfikes 2019-09-16T17:14:50.011400Z

Yeah, and there is that whole notion of ^long and ^double being type declarations (they are evidently special).

favila 2019-09-16T17:19:30.012800Z

I think they cause the compiler to emit an impl of one of these interfaces: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java#L97-L454

2019-09-16T17:20:26.014100Z

I was planning to make some fixes to the core.rrb-vector library, which has both Clojure/Java and ClojureScript implementations in the same repository. I wanted to set up automated running of ClojureScript tests for core.rrb-vector, which I think it does not right now. Alex Miller mentioned data.xml as an example of an existing library that does. I am starting to look into how that is set up, and noticed from the build logs that it is running the nashorn JavaScript runtime, and at least with JDK 11 it is starting to give deprecation warnings about nashorn maybe being removed in a future release.

2019-09-16T17:21:30.015500Z

If I was setting up running ClojureScript tests for core.rrb-vector, would you recommend I do it using nashorn so that it matches what data.xml is doing, and they can both be fixed if/when it is removed in the future? Or would you recommend I figure out how to set up a different runtime to run on the Hudson build box?

2019-09-16T17:21:53.015900Z

(or look at a different example than data.xml, that already uses a different JS runtime, if you know of such an example)

mfikes 2019-09-16T17:29:35.016Z

Ahh cool. This is consistent with where I got this from: Clojure Programming p. 439

borkdude 2019-09-16T17:32:52.016500Z

ah, so ^Long is nilable, gotcha

mfikes 2019-09-16T17:34:48.018100Z

@andy.fingerhut May be of interest: https://clojure.atlassian.net/browse/CLJS-3088 (removed Nashorn from ClojureScript's CI) https://clojure.atlassian.net/browse/CLJS-2927 (a patch to suppress that deprecation warning) IIRC, core.rrb-vector supports self-hosted, so if feasible, I'd incorporate self-hosted into its test suite.

mfikes 2019-09-16T17:37:00.018600Z

(As an additional thing, beyond regular JVM ClojureScript.)

2019-09-16T17:45:27.020700Z

Thanks for the links. I don't yet have a good working knowledge of what it means to run self-hosted tests vs. nashorn vs. some other option. My belief is that the http://build.clojure.org automated test results are all run on a machine running Hudson software, not using Travis, true?

2019-09-16T17:46:06.021100Z

Erm, or perhaps Jenkins, not Hudson, there.

mfikes 2019-09-16T17:48:35.021400Z

Oh, yeah, that's a world that I'm not familiar with.

2019-09-16T17:49:25.021900Z

Sure, and please don't dive into it unless it sounds like your world of fun, which seems unlikely 🙂

2019-09-16T17:50:15.022600Z

Is your guess that this nashorn warning thing might be "they will actually leave the deprecation warning around until JDK 15, when they actually get around to removing it?"

mfikes 2019-09-16T17:50:51.023600Z

That's a good question. I'm wondering / speculating if Graal.js is supposed to replace it. Dunno.

2019-09-16T17:50:53.023800Z

If it might be a ways off, I may be a bit lazy and just make core.rrb-vector as much like data.xml as I can, so easier to update them in a common way later.

mfikes 2019-09-16T17:50:59.024Z

Yeah

2019-09-16T17:51:47.024700Z

I was mainly looking for a reaction like "nashorn? Never, ever test with that any more -- it's too ancient to be of any use" vs. not that reaction 🙂

zane 2019-09-16T17:53:29.024900Z

> I'm wondering / speculating if Graal.js is supposed to replace it. That's my understanding.

danoyoung 2019-09-16T21:40:16.028Z

m

Ⓜ️ 1