Fork me on GitHub
#vim
<
2019-05-08
>
Olical09:05:16

Got Conjure injecting Compliment upon connection last night 😄 so autocomplete works out the box now. I do wonder if also injecting tools.namespaces is a step too far though :thinking_face: looks like I'd only need to inject like 2-3 files to get namespace reloading working, nice!

dominicm09:05:59

@olical are you vendoring your dependencies?

Olical09:05:36

I've added compliment as a git submodule and I do some string replacement as it's loaded so as not to conflict with anything already loaded.

Olical09:05:41

For better or worse...

Olical09:05:50

it works ¯\(ツ)/¯

dominicm09:05:25

@olical are you familiar with Mr. Anderson? @benedek I'm sure would be very happy to make sure your use case is handled by it.

Olical09:05:49

Yarp, I think that requires Mr. Anderson being inside the target env though?

dominicm09:05:05

Not at all :) Mr. Anderson just rewrites your dependencies with a prefix.

benedek09:05:06

👋

😱 4
Olical09:05:20

I'm essentially doing Macgyver / budget Mr. Anderson from files on disk.

Olical09:05:32

I'll take a gander.

dominicm09:05:40

@olical hopefully this makes it cheaper for you to adopt Orchard as well. cider has invested a lot of time into making orchard so that a nrepl-less tool can be created. I particularly think the stacktrace parsing is top-class.

Olical09:05:40

I don't think I need it because my deps are a known small set. I'm simply resolving dependency order by hand and firing code over a socket. If it was a more general case or a more complex dep I would.

benedek09:05:53

mranderson is all about macgyvering i suppose so you are on the right track 😉

benedek09:05:00

i am trying to read back to get a bit of context here. what is the project you are hacking on @olical?

Olical09:05:31

prepl tooling for neovim basically where everything you need is fired over the prepl as you connect

Olical09:05:53

So no deps in your project, you just open a prepl (which is built in) and go. Autocomplete etc should just work.

Olical09:05:03

I do need to check out Orchard at some point I guess. Right now I'm happy with how errors and things are working. I quite like just hand rolling stuff as minimal as possible.

benedek09:05:29

i am a bit out of context in a vim channel 😉

dominicm09:05:35

@olical the problem with hand rolling is that well-trodden edge-cases get missed, for example javadocs is a nightmare that orchard has resolved.

dominicm09:05:12

or finding the file/line/column of something, it's fine for simple vars, but gets complex when you throw protocols/records in there (one of those, I forget which)

Olical09:05:16

Yup, for sure. Definitely something I want to look into, just kinda getting my core features nailed first then I'll work on polishing each part I guess.

Olical09:05:30

I wrote my own go to def lookup for CLJS and CLJ 😅 it kinda works but not ideal.

Olical09:05:33

Including in JARs

dominicm09:05:07

I vaguely know how the one in orchard works, but ideally you would never need to know in order to build something cool like Conjure :)

Olical09:05:38

(none of this is final tbh)

benedek09:05:36

i love how the metaprogramming bits are floating around nowadays on slack 😄

Olical09:05:24

Building Conjure with Conjure has been a fun experience. If I break eval I can't fix it 😆

Olical09:05:34

(although load-file still works sooo)

Olical09:05:31

I think I'll try to adopt things like orchard at some point, I've just been only adding dependencies when it's an absolute requirement. If I can get by without then yay.

benedek09:05:37

this is where mranderson helps to relax really

Olical09:05:19

Can I use it in one JVM and send code over the wire to another though? Like does it work with static code?

Olical09:05:31

I kinda need to operate with strings 😬

benedek09:05:07

hm… at the moment it spits out files really. dependency definitions and the project’s own files using those deps in

benedek09:05:15

and modified files out

dominicm09:05:48

https://github.com/clojure-emacs/orchard/blob/master/src/orchard/info.clj#L20-L32 this is all the ways you can get metadata in orchard. special symbols are another annoying one :)

dominicm09:05:29

@olical orchard is mostly dynamic, not static.

benedek09:05:00

so i guess you could run mranderson and slurp the modified files

dominicm09:05:02

you would inject it into namespaces in the target JVM, then call those functions and process the results :)

Olical09:05:11

WRT Mr Anderson, that could work. I'd just do it ahead of time in my project. Sounds pretty good and similar to what I'm doing anyway. WRT Orchard: Sounds good and what I'd expect! I will definitely have a dig. Can probably replace a lot of my code with that. I do worry if I load too much on connection I'll be sending a LOT of code over that prepl. I'll have to make sure it doesn't get too sluggish.

Olical09:05:21

(I do sometimes prepl into staging etc)

Olical09:05:08

Orchard only works in Clojure though, not ClojureScript?

dominicm09:05:45

cljs-tooling is still seeing active work atm though (a few months ago) so is still usable. And probably has covered some edge cases itself too :)

Olical09:05:00

Ah, sweet.

dominicm09:05:08

For example, cljs-tooling has a completion namespace, might be handy for you ;)

Olical09:05:32

Still need to work out how to set the source file and maybe the current line when evaluating CLJS. I don't know if it's possible like it is with Clojure.

Olical09:05:38

Without self-hosting.

dominicm09:05:50

The piggieback code will definitely contain the answer to that :)

dominicm09:05:37

or, maybe just asking @bhauman / @cichli directly. They're pretty knowledgable on that stuff.

dominicm09:05:13

I'm pretty sure that fireplace solves this for line number by sending a bunch of newlines :)

Olical09:05:23

Piggieback executes within Clojure, prepls fire directly into ClojureScript so you don't have access to the parent context AFAIK.

dominicm09:05:23

ooh, I see. You're using a cljs prepl, not an in-clojure prepl with access to the compiler. Interesting.

Olical09:05:48

Yup. So even more restricted. I was thinking maybe I can do some weird things with #=...

dominicm09:05:26

heh :) cljs-tooling appears to be all cljc, so may well work.

Olical10:05:47

Thanks for the discussion today, all. Added Orchard, cljs-tooling and Mr. Anderson to my list. I've found ways to do most things without them but they'll definitely make things work better.

dominicm10:05:02

I hope so! If they don't, please complain loudly in the issue tracker

dominicm10:05:08

The intention is that they make your life more fruitful.