Fork me on GitHub
#editors
<
2015-06-05
>
arrdem00:06:00

Okie doke. Taking a stab at that RT/Util refactor we talked about.

cfleming02:06:25

arrdem: Awesome, let me know how you get on

arrdem02:06:12

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

cfleming02:06:42

arrdem: Sure, let me know when you’d like to call

cfleming02:06:08

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

arrdem02:06:28

Evening in CA works best for me... What Zulu offset are you on

cfleming02:06:13

This isn’t IRC any more - just click on my user

cfleming02:06:44

You’ll notice that Cursive is technology from the future

danielcompton02:06:13

Colin is 1200 Zulu

danielcompton02:06:28

Until Spain (?)

cfleming02:06:53

arrdem: What’s the issue with var?

cfleming02:06:39

arrdem: I guess if you move var, you have to move all the static vars too, right?

cfleming02:06:07

arrdem: Or not, RT can call Util.var

arrdem02:06:49

Right it can

arrdem02:06:57

The question is philosophical

cfleming02:06:31

I’ll get my pipe

arrdem02:06:42

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

arrdem02:06:26

Or can we move it as such alias it and spread the mutable mess somewhat for the loading consequences

arrdem02:06:38

Does that make sense?

cfleming02:06:17

You’re talking about data-readers etc?

arrdem02:06:25

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

cfleming02:06:34

That should have earmuffs, obviously

cfleming02:06:48

Is that needed by anything in Util?

cfleming02:06:17

From my POV Util should be as small as humanly possible

cfleming02:06:48

To allow collections & EDN to work without RT, basically

arrdem02:06:59

No the problem is that the printing functions and the math class depend on earmuffs

arrdem02:06:18

And since some datastructures use the printing stuff

arrdem02:06:40

Unless we can move that it's not possible to do with this partition

arrdem02:06:00

Also math in lean Clojure

cfleming02:06:41

So you need to move them, then.

cfleming02:06:48

Is there an issue with doing that?

cfleming02:06:40

Var itself doesn’t contain anything too funky, right?

cfleming02:06:07

And those vars are initialised on creation, looks like - I guess there might be issues with missing init

cfleming02:06:35

If any of them are initialised later using set! during ns load or something

arrdem02:06:43

Right if you move those vars you now have this weird partially booted Clojure monster

cfleming02:06:59

But it doesn’t need any actual Clojure though, right?

arrdem02:06:05

Right it doesn't

cfleming02:06:12

My definition of purity is: does it load clojure.core?

arrdem02:06:23

We can do this without core

arrdem02:06:41

Core doesn't to my knowledge modify this stuff

cfleming02:06:52

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.

cfleming02:06:20

And it’s not optional anyway, sounds like.

arrdem02:06:29

Right right...

arrdem02:06:53

Okay. I have a refactored copy of rt in Dropbox...

arrdem02:06:08

I'll do the big move to util later tonight

arrdem04:06:49

cfleming: one complaint... when I did my big method move Cursive didn't catch the changes and rewrite clojure/core.clj

arrdem04:06:10

it's not hard to do by hand, I would just have expected you'd catch that

arrdem04:06:32

some of the stuff like Compiler.java and gen-class using class field accessors is totally excusable

cfleming04:06:56

arrdem: Yeah, support for the move refactorings is still a little patchy.

cfleming04:06:26

arrdem: You’re talking about moving RT.var not renaming RT/var to Util/var in Clojure code?

arrdem04:06:34

yeah so wen I did the "refactor > move" on RT.var it didn't see that RT/var == RT.var and rewrite that stuff

cfleming04:06:01

Yeah, sorry - renames catch all that stuff, moves not so much

cfleming04:06:34

Moves are more complicated since I’d also have to muck with imports and so on.

cfleming04:06:47

It’s on the list, but the list is long simple_smile

cfleming04:06:13

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

danielcompton04:06:10

That’s some next level refactoring

cfleming04:06:10

In other news, I only have two cases to fix, and the whole Cursive codebase will typecheck correctly with the in-editor inference

arrdem04:06:12

okay I think I'm almost there...

arrdem04:06:27

thank god for Intellij refactoring automagically fixing most of Compiler.java for me

cfleming04:06:41

Sing it, brother

danielcompton04:06:01

Where’s your CIDER now huh?

cfleming04:06:01

Using Emacs for Java development is basically professional negligence

cfleming04:06:20

On that note, I’m going for a beer

arrdem04:06:22

I cannot go into RT without wanting to light it on fire

arrdem04:06:29

s/RT/Compiler/g

arrdem04:06:36

way ahead of you there...

arrdem04:06:43

office beer 😄

arrdem04:06:15

How do I force intellij to synchronize buffers and fs?

arrdem04:06:57

Okay I think that's Compiler.java ported...

arrdem05:06:45

I guess I don't even need to rewrite the preamble of RT to use vars from Util thanks to the magic of intern...

arrdem05:06:19

cfleming: patch complete... tests clean so far

arrdem05:06:28

tests clean

arrdem05:06:41

gents we have a 1.7 snapshot that breaks no behavior and enables lean AOT

arrdem05:06:04

I'm gonna go no not celebrate sleep yeah that's the other one.

arrdem06:06:26

merry christmas

arrdem06:06:29

I think there's still more to be done in terms of moving all the vars out to some common namespace...

arrdem06:06:36

but that's putting lipstick on a pig

arrdem06:06:00

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.

arrdem07:06:31

You shouldn't see load time improvements on non lean binaries because calling require or compilers hits RT which does the source load

arrdem07:06:29

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.

cfleming08:06:52

arrdem: That’s awesome

cfleming08:06:07

arrdem: I’ll take a look at at the patch sometime soon, hopefully tomorrow

bozhidar10:06:31

@arrdem: I’m always watching 😉

bozhidar10:06:36

but I don’t mind

bozhidar10:06:08

I’m perfectly fine with everyone using Cursive instead of cider

bozhidar10:06:23

most of you are Clojure users

bozhidar10:06:32

I’m an Emacs user

bozhidar10:06:49

and there lies the big difference

bozhidar10:06:14

if you view your editor as something that puts into disadvantage

bozhidar10:06:21

then I guess you’re not using the right tool

bozhidar10:06:10

btw, on the subject of formatting

bozhidar10:06:24

I really don’t know how Rich has written all the Clojure and Java code

bozhidar10:06:30

pretty much everything is way off

bozhidar10:06:38

tabs and spaces all over the place

bozhidar10:06:49

makes the codebase look pretty messy to most people

bozhidar10:06:26

every time I see Clojure’s Java code I get sick

thomas10:06:10

@arrdem: I think Rich used intellij... but I could be wrong. at clojureExchange 2013 (?) he showed us a bit of the Java code.

thomas10:06:27

you could go back and look at the videos and find out.

thomas10:06:39

probably 2012 actually btw.

bozhidar10:06:31

I think he even said this a few times

bozhidar10:06:44

that he used Emacs for Clojure and IntelliJ for Java

bozhidar10:06:56

although I’m not sure if this is the case anymore

cfleming10:06:03

He’s always used IntelliJ for Java

cfleming10:06:32

I think he’s using Cursive for Clojure now as well - he was planning to, but I haven’t heard how it’s going

cfleming10:06:44

Stu Halloway was going to switch as well

cfleming10:06:15

They were both waiting for the inferior-lisp equivalent REPL, which went in a while back

cfleming10:06:29

Neither of them use nREPL

akiva13:06:35

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. ¬_¬

akiva13:06:46

MY DAY CANNOT START LIKE THIS [knocks stuff over]

arrdem15:06:28

Nrepl is actually my favorite feature of the clojure tooling world...

arrdem15:06:31

@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.

erichmond15:06:21

haha, I remember that crazy thread on the list around nREPL

erichmond15:06:43

I think it’s pretty sweet myself

jballanc15:06:45

Question for users of Emacs/Spacemacs and Cider: how do you evaluate a form in nREPL without having to move one space past it?

jballanc15:06:20

In Vim + fireplace, the cpp key combination will evaluate a form so long as your point is anywhere within the form

jballanc15:06:45

I’m trying to do the same thing with spacemacs, but I’ve got is cider-eval-last-sexp

jballanc15:06:17

…which is annoying since I usually don’t leave extra blank spaces at the end of my lines 😉

otijhuis15:06:24

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

malabarba16:06:28

@jballanc why would you need an extra blank space to use eval-last-sexp?

jballanc16:06:15

@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

jballanc16:06:38

actually, now that I think about it this is probably a bug that needs to be resolved in the Spacemacs clojure layer

rauh16:06:13

@jballanc: There is a few options: (A) (setq-default evil-move-cursor-back nil)

rauh16:06:20

(A) allows you to move your curser past the last character in Evil.

rauh16:06:56

(B) just evaluates the paragraph, which is often exactly what you want, given high level forms are usually separated by a blank line

jballanc16:06:08

@rauh: Ah yes, I think (B) is exactly what I want

jballanc16:06:38

actually, now that I think of it, I think I had almost that exact same function in a prior .emacs.d

rauh16:06:57

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

malabarba16:06:18

@jballanc yes, you may want to report that to spacemacs. But, in any case, it sounds like you want C-M-x.

jballanc16:06:06

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

jballanc16:06:30

…but I do use blank spaces within the comment to separate examples, so paragraph would be the right delineation

malabarba16:06:51

Great then. :-)

cfleming22:06:22

arrdem: Ok, I’m traveling today, will try to take a look tonight.

bozhidar23:06:53

btw, there’s now a #C0617A8PQ channel for cider-specific questions/discussions

bozhidar23:06:19

I don’t have time to read everything about every possible editor here

bozhidar23:06:39

but I’ll keep an eye on the #C0617A8PQ channel