Okie doke. Taking a stab at that RT/Util refactor we talked about.
arrdem: Awesome, let me know how you get on
cfleming I may yet trouble you for a Skype call on this and there will definitely be a clj-dev post. What to do with vars and RT.var is not obvious and critical
arrdem: Sure, let me know when you’d like to call
arrdem: I’m in this timezone for another week and then I’m in Europe for a couple of months, so that’ll be your morning
Evening in CA works best for me... What Zulu offset are you on
This isn’t IRC any more - just click on my user
You’ll notice that Cursive is technology from the future
Colin is 1200 Zulu
Until Spain (?)
arrdem: What’s the issue with var?
arrdem: I guess if you move var, you have to move all the static vars too, right?
arrdem: Or not, RT can call Util.var
Right it can
The question is philosophical
I’ll get my pipe
Is all that mutable state stuck in RT and thus poisoning a bunch of other stuff that may not need a fully booted Clojure instance
Or can we move it as such alias it and spread the mutable mess somewhat for the loading consequences
Does that make sense?
You’re talking about data-readers etc?
I just don't want to write a bunch of code only to find that we didn't purify everything or have it shot down by alex
That should have earmuffs, obviously
Is that needed by anything in Util?
From my POV Util should be as small as humanly possible
To allow collections & EDN to work without RT, basically
No the problem is that the printing functions and the math class depend on earmuffs
And since some datastructures use the printing stuff
Unless we can move that it's not possible to do with this partition
Also math in lean Clojure
So you need to move them, then.
Is there an issue with doing that?
Var itself doesn’t contain anything too funky, right?
And those vars are initialised on creation, looks like - I guess there might be issues with missing init
If any of them are initialised later using set! during ns load or something
Right if you move those vars you now have this weird partially booted Clojure monster
But it doesn’t need any actual Clojure though, right?
Right it doesn't
My definition of purity is: does it load clojure.core?
We can do this without core
Core doesn't to my knowledge modify this stuff
Ok, I’d go for a totally minimal PoC and then worry about the purity later. I don’t think that initialising some Var objects with Java initial values is a huge deal.
And it’s not optional anyway, sounds like.
Okay. I have a refactored copy of rt in Dropbox...
I'll do the big move to util later tonight
cfleming: one complaint... when I did my big method move Cursive didn't catch the changes and rewrite clojure/core.clj
it's not hard to do by hand, I would just have expected you'd catch that
some of the stuff like Compiler.java and gen-class using class field accessors is totally excusable
arrdem: Yeah, support for the move refactorings is still a little patchy.
arrdem: You’re talking about moving RT.var not renaming RT/var to Util/var in Clojure code?
yeah so wen I did the "refactor > move" on RT.var it didn't see that RT/var == RT.var and rewrite that stuff
Yeah, sorry - renames catch all that stuff, moves not so much
Moves are more complicated since I’d also have to muck with imports and so on.
It’s on the list, but the list is long :simple_smile:
I’ll be working on Clojure moves before Java ones, too - I’d dearly love to be able to move functions to another namespace safely, get the namespaces updated and get warnings about cyclic dependencies
That’s some next level refactoring
In other news, I only have two cases to fix, and the whole Cursive codebase will typecheck correctly with the in-editor inference
okay I think I'm almost there...
thank god for Intellij refactoring automagically fixing most of Compiler.java for me
Sing it, brother
Where’s your CIDER now huh?
Using Emacs for Java development is basically professional negligence
On that note, I’m going for a beer
I cannot go into RT without wanting to light it on fire
way ahead of you there...
office beer 😄
How do I force intellij to synchronize buffers and fs?
Okay I think that's Compiler.java ported...
I guess I don't even need to rewrite the preamble of RT to use vars from Util thanks to the magic of intern...
cfleming: patch complete... tests clean so far
gents we have a 1.7 snapshot that breaks no behavior and enables lean AOT
I'm gonna go no not celebrate sleep yeah that's the other one.
I think there's still more to be done in terms of moving all the vars out to some common namespace...
but that's putting lipstick on a pig
also the vars that moved from RT to Util need to still occur in RT, they don't right now which is strictly a binary compatability break.
You shouldn't see load time improvements on non lean binaries because calling require or compilers hits RT which does the source load
But a lean compiler or a handcrafted binary should be able to do a bunch of keyword map and vector ops, print some stuff and exit without booting Clojure proper.
arrdem: That’s awesome
arrdem: I’ll take a look at at the patch sometime soon, hopefully tomorrow
but I don’t mind
I’m perfectly fine with everyone using Cursive instead of cider
most of you are Clojure users
I’m an Emacs user
and there lies the big difference
if you view your editor as something that puts into disadvantage
then I guess you’re not using the right tool
btw, on the subject of formatting
I really don’t know how Rich has written all the Clojure and Java code
pretty much everything is way off
tabs and spaces all over the place
makes the codebase look pretty messy to most people
every time I see Clojure’s Java code I get sick
@arrdem: I think Rich used intellij... but I could be wrong. at clojureExchange 2013 (?) he showed us a bit of the Java code.
you could go back and look at the videos and find out.
probably 2012 actually btw.
I think he even said this a few times
that he used Emacs for Clojure and IntelliJ for Java
although I’m not sure if this is the case anymore
He’s always used IntelliJ for Java
I think he’s using Cursive for Clojure now as well - he was planning to, but I haven’t heard how it’s going
Stu Halloway was going to switch as well
They were both waiting for the inferior-lisp equivalent REPL, which went in a while back
Neither of them use nREPL
Suddenly Emacs is doing that thing where it keeps five empty lines at the bottom of a buffer so there are five unusable lines in a REPL window. ¬_¬
MY DAY CANNOT START LIKE THIS [knocks stuff over]
Nrepl is actually my favorite feature of the clojure tooling world...
@cfleming okay. It's one big diff right now will probably split it by file today but yeah a second pair of eyes would be great.
haha, I remember that crazy thread on the list around nREPL
I think it’s pretty sweet myself
Question for users of Emacs/Spacemacs and Cider: how do you evaluate a form in nREPL without having to move one space past it?
In Vim + fireplace, the
cpp key combination will evaluate a form so long as your point is anywhere within the form
I’m trying to do the same thing with spacemacs, but I’ve got is
…which is annoying since I usually don’t leave extra blank spaces at the end of my lines 😉
I always use cider-eval-defun-at-point and you could create a custom function combining selection of the current sexp with cider-eval-region if you only want the current sexp and not the whole function
@jballanc why would you need an extra blank space to use
@malabarba: with Spacemacs, when you’re not in insert mode, at the end of the line the point counts as being on the last char in the line
actually, now that I think about it this is probably a bug that needs to be resolved in the Spacemacs clojure layer
@jballanc: There is a few options: (A) (setq-default evil-move-cursor-back nil)
(B) http://emacs.stackexchange.com/questions/7814/evaluate-paragraph-in-cider (works really well, even within (comment))
(A) allows you to move your curser past the last character in Evil.
(B) just evaluates the paragraph, which is often exactly what you want, given high level forms are usually separated by a blank line
actually, now that I think of it, I think I had almost that exact same function in a prior
Yeah it's really nice, even though it doesn't walk parentheses and many would consider it a hack due to relying on blank lines... But in reality: it works great
@jballanc yes, you may want to report that to spacemacs. But, in any case, it sounds like you want C-M-x.
Right, normally I can just use eval defun. The current case I’m dealing with, though, is I like to stick
(comment … ) blocks in my code with examples for the REPL, and eval defun just evals the comment
…but I do use blank spaces within the comment to separate examples, so paragraph would be the right delineation
Great then. :-)
arrdem: Ok, I’m traveling today, will try to take a look tonight.
btw, there’s now a #C0617A8PQ channel for cider-specific questions/discussions
I don’t have time to read everything about every possible editor here
but I’ll keep an eye on the #C0617A8PQ channel