cljs-dev

dnolen 2024-09-27T12:09:22.096439Z

I'm surprised no one has asked before, anyone have issues w/ being able to write Error instead of js/Error like we do for Math and String?

➕ 1
borkdude 2024-09-27T12:13:38.931249Z

to me, writing js/ isn't a problem

➕ 1
borkdude 2024-09-27T12:14:25.074749Z

I sometimes write:

#?(:cljs (def Exception js/Error))
in test code, so I don't have to use reader conditionals when I write (catch Exception e)

dnolen 2024-09-27T12:43:42.850379Z

I'm not thinking just of people who care about CLJC style stuff - it just seems a little inconsistent since Error is available in every JS environment

borkdude 2024-09-27T12:45:33.367159Z

Should every standard JS global be available without js/? To me it would have been fine if none of them were so I wouldn’t have to think about it

dnolen 2024-09-27T12:49:01.011289Z

The choice was already made - you don't need to qualify natives in many cases, Error is an outlier. So I'm not so interested in opinions about the past - but consistency moving forward

dnolen 2024-09-27T12:51:18.208619Z

part of the thinking here also - providing more pathways to eliminate js/

borkdude 2024-09-27T12:52:41.529809Z

sure. maybe it's a co-incidence that Math and String globally also work in the JVM, so this wasn't part of the original reason to do so? it makes sense to include Error then. But where do you stop, do you also include Boolean, Promise, etc?

borkdude 2024-09-27T12:53:43.398419Z

There's probably a dozen other things. Note that not all the java.lang.* are exposed as unqualified classes in JVM Clojure, it's a specific selection

dnolen 2024-09-27T12:54:01.753859Z

ECMA-262 is my opinion, the web stuff - no way

dnolen 2024-09-27T12:55:03.405879Z

3rd edition

borkdude 2024-09-27T12:56:30.131509Z

why that one, because that is the lowest common denominator google closure supports?

dnolen 2024-09-27T12:57:38.658069Z

because that's what CLJS originally targeted, and most decisions made align w/ that - only really minor tweaks over the years mostly around iterables / symbols

dnolen 2024-09-27T12:58:04.015719Z

but also means CLJS can run in older JS environments

dnolen 2024-09-27T12:41:04.881539Z

@fogus PR in progress here, still need to do the CLJS test / CI bit https://github.com/clojure/core.unify/pull/5 - will generate when I get everything working - probably next week

👍 1
dnolen 2024-09-27T13:37:07.102439Z

@alexmiller do you see a problem w/ forking Google Closure Library into a Clojure repo? We build it custom anyway and since it's not going to see any Google updates, we might want to just manage it ourselves?

👀 2
dnolen 2024-10-02T13:35:20.827829Z

ok, yeah I don't have permissions to do this myself

Alex Miller (Clojure team) 2024-10-02T14:19:37.612809Z

can you point me at the repo you want to fork?

dnolen 2024-10-02T16:29:21.973229Z

https://github.com/google/closure-library

Alex Miller (Clojure team) 2024-10-02T16:40:46.060439Z

https://github.com/clojure/closure-library

dnolen 2024-10-02T17:25:00.603409Z

thanks!

quoll 2024-10-01T19:41:24.666989Z

I'm happy to hear that you're interested in this David. I've been concerned about those libraries being essentially defunct, on top of already being frustrated that ClojureScript had no say in how some of the features operated. For instance, I opened an issue on one bug (and had an unsubmitted patch for it), but it was closed in preparation for archiving the project.

quoll 2024-10-01T19:42:05.214409Z

Have you set something up around this yet? Also, would you rather leave it as-is, or would you like to see it ported over to ClojureScript?

dnolen 2024-10-01T21:10:09.028019Z

Was just going to fork it this week, and I think we can continue development on it like any Clojure project

quoll 2024-10-01T21:11:14.828039Z

Sorry, I think I was unclear… would you rather keep it developed entirely in JS, or are you OK if parts of it were slowly converted to ClojureScript?

Alex Miller (Clojure team) 2024-10-01T22:05:04.209209Z

David, if you have any issues forking into clojure org, let me know and I can assist

Alex Miller (Clojure team) 2024-09-27T13:48:01.218829Z

Seems reasonable

👍🏽 1