Fork me on GitHub
#admin-announcements
<
2015-08-21
>
cfleming08:08:26

@magnars: It’s probably clj-refactor, as you say - tools.analyzer will evaluate as it reads.

cfleming08:08:45

Very nice series, I’m looking forward to more!

magnars08:08:48

Nice to have that confirmed, thanks simple_smile Glad you like the series, I'm publishing a new episode in 5 hours.

cfleming08:08:13

I’ll set my alarm simple_smile

cfleming08:08:50

It’s also nice to see what the state of Emacs tooling is, clj-refactor is getting very impressive.

pxlpnk09:08:18

@magnars: looking forward to it!

stian09:08:19

magnars: Looking forward to it! How is the viewer count compared to the Norwegian version?

magnars09:08:46

hah, fun question. The Norwegian first episode has been seen 720 times (after well over a year), and the English version 3598 times (after a few days)

cfleming09:08:07

@magnars: Does the English version more or less mirror the Norwegian one? Are you just translating the existing series?

dottedmag09:08:09

@magnars: Where can one find the Norwegian version?

stian09:08:48

Feels like complete reimplementation so far, except for css/pictures (from watching the 2 first episodes). And one more year of clj experience have def added to the quality (was awesome before as well, but now feels even better).

dottedmag09:08:35

@magnars: Also in Emacs Rocks! one can see the keystrokes used, can you enable it in future episodes of PotD as well?

magnars10:08:04

@dottedmag: I abandoned key press overlays since I'm using a weird Norwegian keyboard, and I'm not convinced you'd find it very useful with "M-æ"'s flying around. simple_smile

dottedmag11:08:46

@magnars: It allows one to cross-link to .emacs.d. And actually C-å is a very nice hack, I'd adopt it if I were using stock Norwegian keyboard instead of International English.

magnars11:08:57

sure, an exceedingly interested individual could manually look up all my keybindings and figure it out somehow, but the noise-to-signal ratio would be way off for most people.

dottedmag12:08:19

Okay. Probably easier to ask you how did you do this or that ;)

dottedmag12:08:29

@magnars: Speaking of which, what do you use for populating templates in new files? Is it yasnippet or something else?

magnars12:08:49

yeah, yasnippet - I've removed all the default ones, using only my own

dottedmag12:08:11

@magnars: Did you hook it to visit-file-hook or do you do it manually?

magnars12:08:48

I do it manually. But if you're thinking of the automatic namespace declarations, those are handled by clj-refactor

dottedmag12:08:05

I see, thanks.

bronsa13:08:52

@cfleming: I think the clj-refactor guys managed to use tools.analyzer w/o evaluating form per form

cfleming13:08:30

@bronsa: Really? Nice. How did they manage that?

cfleming13:08:44

Can that be configured?

bronsa13:08:27

yeah, there are a bunch of hooks in the tools.analyzer passes that I added with that in mind

bronsa13:08:29

you won't obviously get a completely correct AST but it looks like it's good enough for the clj-refactor use-case

cfleming13:08:34

Nice, I should check that out, that might be very useful. But you still have to eval to expand macros though, right?

bronsa13:08:31

I don't think they do any macroexpansion at all

cfleming13:08:54

Interesting, it probably has the same limitations as Cursive around macro-defined symbols then

bronsa13:08:09

AFAIK they use it as a glorified lexical parser

cfleming13:08:37

Ok, that’s interesting. I’ve been meaning to look at their impl but haven’t had time.

cfleming13:08:43

I spoke to the Racket guys at Curry On about this actually, it was really interesting. They read, eval and macroexpand, and just leave it to the user to not suffer any effects.

cfleming13:08:07

It’s slow, though, and requires some pretty deep hooks into the macroexpander to get the results they need.

cfleming13:08:44

But they can map partially-generated symbols, so things like ->MyRecord get renamed correctly, really impressive.

bronsa13:08:17

@cfleming: they also have different loading phases for stuff required at macroexpansion-time vs stuff required at runtime

cfleming13:08:40

Interesting, I didn’t know that

cfleming13:08:43

I’ll take a look.

bronsa13:08:54

It's a really interesting approach

cfleming13:08:33

They actually expose hooks so that libs can decorate macroexpansions with info for the IDE - Typed Racket uses that to add types in tooltips

bronsa13:08:17

@cfleming: nice, I found out with tools.analyzer that a pluggable macroexpander makes a very powerful tool for users

cfleming13:08:41

@bronsa: Ugh, more things I need to read simple_smile

cfleming13:08:15

@bronsa: Yes, no doubt. I really need to get to grips with t.a and friends, I’m sure there’s a lot I could use there.

cfleming13:08:41

The Cursive macroexpander is currently very powerful but very hairy.

cfleming13:08:45

It uses Riddley right now, but I’m thinking of changing that at some point to something generic so I can support CLJS expansion too, which would be really nice.

redbeardymcgee14:08:54

out of sheer curiosity i wanted to read the source of persistent!, but the clj code is a java interop to .persistent. I don't know how to find this

Alex Miller (Clojure team)14:08:02

You'll want to look at implementors of ITransientCollection

Alex Miller (Clojure team)14:08:21

for example: TransientVector (inside PersistentVector.java), TransientHashSet in PersistentHashSet.java, and ATransientMap

Alex Miller (Clojure team)14:08:05

if you use an IDE like IntelliJ that understands both Clojure and Java, it will let you traverse through these fairly easily

redbeardymcgee15:08:42

i use emacs but haven't really discovered my way around all that yet

magnars15:08:58

you can navigate to Java sources with CIDER as well

redbeardymcgee15:08:33

yeah i think i'll need to jump between things to see it all

chris15:08:27

if you haven’t seen parens-of-the-dead it’s worth watching for the emacs skill alone

teslanick15:08:01

Cursive auto-importing stuff by name after I use it is pretty awesome. I can type (ws/connect ... and it asks, "import whatever.core :as ws?"

micahalles17:08:51

anyone have a recommendation for a library to consume a RESTful json API?

micahalles17:08:15

I’m currently looking at clj-http & curious if I’m missing out on something a bit higher-level than it.

timvisher19:08:01

i will never make an emacs screencast again. @magnars does it so much better. simple_smile

roberto19:08:53

my productivity with clojure + emacs improved after watching his videos

emil0r19:08:58

@micahalles: http-kit is an alternative you can look at which also works really well. biggest difference in how i've used them is excellent support for callbacks in http-kit, and excellent support for cookies in clj-http

micahalles20:08:25

thanks, @emil0r. I’ll check it out

magnars21:08:35

@timvisher: Hey Tim simple_smile Your videos was a huge reason that I started making Emacs Rocks! Hope you don't stop making vids just because of me.

roberto21:08:37

@timvisher: emacs videos using clojure or common lisp would be awesome. simple_smile

roberto21:08:54

focused on work flow instead of the language.

tel22:08:01

I wonder why reader conditional syntax uses #?(:a 1 :b 2) instead of #?{:a 1 :b 2}

tel22:08:06

The latter seems more natural

tel22:08:23

also would work better with indenters

ghadi23:08:07

a metacircular interpreter in the jdk

ghadi23:08:24

well, a maybe future JDK (valhalla dev branch)

bronsa23:08:11

@tel in case more than one feature expr matches, order matters

tel23:08:07

even #?[:a 1 :b 2] is more natural, I feel… it reminds me of let bindings