clojure-dev

Issues: https://clojure.atlassian.net/browse/CLJ | Guide: https://insideclojure.org/2015/05/01/contributing-clojure/
devn 2020-11-25T04:04:39.257700Z

Ever possible that defrecord would support namespaced keys? I hope the answer is no.

2020-11-25T16:26:13.275300Z

it allows them, but not as fields, only as keys

(ins)user=> (defrecord Foo [a b])
user.Foo
(ins)user=> (-> (->Foo 1 2) (assoc :bar/baz 'x))
#user.Foo{:a 1, :b 2, :bar/baz x}
but I'm sure that's what you meant

dominicm 2020-11-25T06:01:52.257800Z

@devn I think it's been raised as an idea before.

Ben Sless 2020-11-25T08:03:03.261600Z

Question regarding :inline meta and definline I recall reading Alex's comment in one Reddit discussion where he mentioned inlining should not be used or relied upon, and should be considered experimental. • Why? It's been around forever by now. Has any feature been deprecated after so long? • Are there some plans for the future of inlining?

2020-11-25T09:11:36.263400Z

The docstring for it has said it is experimental since it was added, the experiment may end

2020-11-25T09:14:53.267100Z

I don't know anything about plans, but rich has fiddled with a number of different "optimized linking" approaches over the years, which you could sort of kind of categorize definline with

2020-11-25T09:17:02.268100Z

definline, const, static, and direct

2020-11-25T09:17:41.269200Z

const is basically definline for values instead of functions

2020-11-25T09:18:31.270500Z

Static linking is, I think, completely disabled in the compiler, but the annotations for it are still in core.clj

2020-11-25T09:19:03.271200Z

Direct linking is the replacement for static linking

2020-11-25T09:20:09.272500Z

And this is all stuff at the clojure compiler level, which outputs jvm byte code, which then the jit compiles

2020-11-25T09:21:12.274Z

The jit is where all the real inlining happens, the clojure compiler just tries make its job easier

Ben Sless 2020-11-25T09:30:26.274100Z

That's for definline, I don't recall seeing that mentioned for inline meta

➕ 1
alexmiller 2020-11-25T14:24:06.275Z

Rich does have some ideas on an alternative to definline but it has never risen up to a high enough priority to explore it