Fork me on GitHub
#clojure
<
2019-07-08
>
emccue01:07:33

@andy.fingerhut and deep into the rabbit hole I go

andy.fingerhut01:07:51

Although it is entirely possible that #'generate-class does not create a class in the running JVM's memory, but only some byte sequence representing the byte code to be written to the file system.

emccue01:07:32

That would make sense, but also I should be able to write code to load that into the running jvm pretty easily

andy.fingerhut01:07:57

Um, that would be loading the .class file written to the file system, wouldn't it?

emccue01:07:45

I don't think that's requires touching the filesystem

emccue01:07:17

Deftype does it somehow

andy.fingerhut01:07:41

I see. You are thinking of perhaps creating a classloader that loads the class from whatever #'generate-class produces, instead of from reading the file system?

emccue01:07:33

deftype* is a compiler internal so it doesn't look like I can inspect that directly

andy.fingerhut01:07:48

Well, you can if you are willing to read Java source code.

emccue01:07:25

DynamicClassLoader seems to be the ticket

emccue01:07:30

(def class-loader @Compiler/LOADER)
(def gen-ed (clojure.core/generate-class {:name 'com.thing.TestClass}))
(.defineClass class-loader (.replace (name (first gen-ed)) "/" ".")
                           (second gen-ed)
                           nil)

emccue01:07:38

the dark arts are here

👍 4
macrobartfast16:07:09

wow... so lame how you have to have a paid plan to search for old messages... plus, my slack storage is apparently 'over the limit' and I have to pay to resolve that as well...

macrobartfast16:07:46

completely terrible that open source projects are now enmeshed with a monthly paid service and you have to pay to find useful information.

macrobartfast16:07:57

unless I don't understand how this channel works.

Graham Seyffert16:07:01

You don’t have to pay

dpsutton16:07:06

that's a workspace wide payment not a personal one. i think the bill for a slack this size is about $7,000 per month

Graham Seyffert16:07:06

The channel host would have to pay

macrobartfast16:07:22

well, lol, I mean, not sweet the channel host has to pay...

Graham Seyffert16:07:38

there used to be a service that would archive this slack workspace and make it searchable via google

Graham Seyffert16:07:44

But I believe that’s defunct now…

macrobartfast16:07:49

but it's a comprehension issue on my part maybe.

Graham Seyffert16:07:04

Yeah. It would be nice to have the extended chat history

macrobartfast16:07:21

I mean, it's really a huge part of the history of the language.

macrobartfast16:07:57

and a huge part of my history of troubleshooting my issues ;-D

macrobartfast16:07:19

getting 'Wrong type argument: stringp, nil' when trying to cider-connect (probably the wrong channel for that)...

Graham Seyffert16:07:00

oh so that’s not defunct??

macrobartfast16:07:21

I think @dpsutton may have sorted that stringp error out for me in the past.

Graham Seyffert16:07:22

or is that a reboot?

Graham Seyffert16:07:42

I was of the understanding that the Slack archive stopped working / went unmaintained at some point

Graham Seyffert16:07:04

yeah that is. Looks pretty nifty

Graham Seyffert16:07:19

It doesn’t appear to be googlebot-indexable like the old archive though 😕

Graham Seyffert16:07:15

That’s great to hear

macrobartfast16:07:41

I have vague memories of cider version/clojure version, something-or-other when trying to get docs and jump to declaration in emacs

macrobartfast16:07:39

but that was probably in #cider... I'll root around in there.