Re: Invalid-token when dereferencing namespaced keywords.

2019-01-30 Thread Thomas Heller
To expand on what Alex already mentioned. There is no such thing as double-colon keywords. Double-colon is a reader alias mechanism that let the reader resolve them so you can type less. (ns foo.bar.xyz) ::hello this is resolved at read-time and identical to actually writing :foo.bar.xyz/hell

Building out a Clojure Team?

2019-01-30 Thread Alex Mesropians
Hey All, Are you looking to build out or hire clojure developers? If so check out Functional Works to advertise your latest roles and target a pure FP market place : ) thanks! -- You received this message because you are subscribed to the Google Groups "Clojure" gro

Re: (gen/sample (s/gen #{'nil})): Couldn't satisfy such-that predicate

2019-01-30 Thread Rostislav Svoboda
Hi Alex, > You can see the special cases of nil, false, and true in the LispReader here > if you're curious: > https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L393-L413 I think it's not the special case of nil, false and true what's causing me headache. I'm ha

Re: (gen/sample (s/gen #{'nil})): Couldn't satisfy such-that predicate

2019-01-30 Thread Alex Miller
On Wed, Jan 30, 2019 at 11:42 AM Rostislav Svoboda < rostislav.svob...@gmail.com> wrote: > Hi Alex, > > > You can see the special cases of nil, false, and true in the LispReader > here if you're curious: > > > https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L393

Re: Invalid-token when dereferencing namespaced keywords.

2019-01-30 Thread Philip Markgraf
Thank you Justin, Andy, Alex and Thomas. I now understand both the root of my issue (leading digits in keyword names is not allowed) and have a greater understanding of how keywords work, especially the reader's role in expanding double-colon keywords. On Wednesday, January 30, 2019 at 2:53:1

Re: Inside Clojure Journal

2019-01-30 Thread Mark Engelberg
+1. I can't seem to subscribe my email to Alex's blog using the form at the bottom of the blog. Clicking the button does nothing. Anyone else having that problem? On Tue, Jan 29, 2019 at 9:03 PM Shaun Parker wrote: > I just wanted to say thanks to Alex for taking the time to journal all the > C

Re: Inside Clojure Journal

2019-01-30 Thread Alex Miller
That's never actually worked. I keep meaning to remove it. :) On Wednesday, January 30, 2019 at 1:41:16 PM UTC-6, puzzler wrote: > > +1. > > I can't seem to subscribe my email to Alex's blog using the form at the > bottom of the blog. Clicking the button does nothing. Anyone else having > that p

[ANN] Learn ClojureScript and re-frame - Video Course

2019-01-30 Thread jacek . schae
Hello, I'm the guy who tries to push ClojureScript for more adoption in Web Development by creating high quality video courses. My first course, very well recieved (https://www.learnreagent.com/#community), was released around 6 months ago. Now I'm working on a new one and it's all about re-fr

[ANN] io.aviso/pretty 0.1.37

2019-01-30 Thread Howard Lewis Ship
https://github.com/AvisoNovate/pretty > Sometimes, neatness counts io.aviso/pretty is a library and Leiningen plugin that adds well formatted, readable output of Clojure exceptions. It's pretty indispensable to the tune of 1.9 million downloads, and is integrated into the Ultra plugin as well as

avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
Profiling is showing a lot of time spent in RT.longCast, in places like this: (aget flat-dict (bit-and 0xff (aget arr j))) arr is hinted as ^bytes, and flat-dict as ^objects. which compiles to this: Object code2 = RT.aget((Object[])flat_dict, RT.intCast(0xFFL & RT.longCast((Object)RT.aget((by

Re: avoiding casts with aget & friends

2019-01-30 Thread Chris Nuernberger
does doing an unchecked cast of the return value of the aget on the byte array change things? (defn test-fn [] (let [obj-ary (object-array 10) byte-data (byte-array (range 10))] (doseq [idx (range 10)] (let [idx (int idx)] (aget obj

Re: avoiding casts with aget & friends

2019-01-30 Thread Alex Miller
What have you tried? And how are you getting that Java? I would prefer to look at bytecode (via javap) to verify what you're saying. Have you tried an explicit long cast? (aget flat-dict (bit-and 0xff (long (aget arr j Are you running this hot enough for the JIT to kick in? Usually this is

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
I haven't tried much. I'm getting the java via clj-java-decompiler.core 'decompile' macro. A long cast does drop the cast (which is really counter-intuitive: explicitly invoke 'long', which calls longCast, in order to avoid calling longCast). Amusingly this doesn't reduce the total run-time, t

Re: State of Clojure 2019 Survey!

2019-01-30 Thread Matching Socks
Clojure is to be commended for keeping the survey short. StackOverflow's (which is still open) is longer. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members

Re: avoiding casts with aget & friends

2019-01-30 Thread Alex Miller
Sometimes the insertion of profiling instrumentation magnifies the cost of things in a hot loop or provides misleading hot spot info. If you're using a tracing profiler, you might try sampling instead as it's less prone to this. Or, this sounds silly, but you can manually sample by just doing a fe

Re: avoiding casts with aget & friends

2019-01-30 Thread Chris Nuernberger
That is why I used 'unchecked-long' instead of 'long'. (unchecked-long (unchecked-byte 5)) Not (long (byte 5)) On Wed, Jan 30, 2019, 5:55 PM Brian Craft I haven't tried much. I'm getting the java via clj-java-decompiler.core > 'decompile' macro. > > A long cast does drop the cast (which is re

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
If there is unnecessary casting or boxing, how do you avoid it? hinting and casting affect it, but not in ways I understand, or can predict. On Wednesday, January 30, 2019 at 6:06:37 PM UTC-8, Alex Miller wrote: > > Sometimes the insertion of profiling instrumentation magnifies the cost of > thi

Re: avoiding casts with aget & friends

2019-01-30 Thread Alex Miller
It would really help to see a full function of code context. From that I could probably talk a little more about what I would expect the compiler to understand and how you might be able to influence it. On Wed, Jan 30, 2019 at 8:50 PM Brian Craft wrote: > If there is unnecessary casting or boxin

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
The full context is large. But, for example, in this code: (let [a 1 b (:foo {:foo 3}) c (if (< a b) a b)]) b and c are Object (if the disassembly is to be believed) which leads to casts where c is used later. Also, the compare is calling Numbers.lt, which is going to do a bun

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
With much experimentation, I ended up with this: (let [a 1 b (.longValue ^Long (:foo {:foo 3})) c (if (< a b) a b)]) which seems to avoid the longCast call: Object o; if (_thunk__0__ == (o = _thunk__0__.get(const__3))) { o = (__thunk__0__ = __site__0

Re: avoiding casts with aget & friends

2019-01-30 Thread Alex Miller
On Wed, Jan 30, 2019 at 11:07 PM Brian Craft wrote: > With much experimentation, I ended up with this: > > (let [a 1 > b (.longValue ^Long (:foo {:foo 3})) > c (if (< a b) a b)]) > > which seems to avoid the longCast call: > > Object o; > if (_thunk__0__ == (o =