Fork me on GitHub
#unrepl
<
2017-11-29
>
richiardiandrea03:11:53

There are some efforts towards making error messages better, not a the keyboard now, but I will try to fetch the links

dominicm07:11:56

@cgrand that's awesome. I think I missed this, how does the data form of the exception look?

dominicm07:11:28

I've been hacking on cider's stacktrace excavator recently, so I'd be curious to know if I can get the same thing to work on top of Unrepl's system.

dominicm07:11:19

a big feature for me was being able to extract the java.net.URL for the stack frames by looking at file extensions & inferring the ns & symbol (and ergo the position in the classpath).

cgrand08:11:07

@dominicm what’s awesome? error display? it’s all @volrath. The current structure is the one returned by clojure Throwable->Map

dominicm08:11:49

Awesome unravel error display.

cgrand08:11:10

it’s unrepl.el actually

volrath08:11:40

I don't believe it's all mine haha, but I'll take the compliment 🙂

dominicm08:11:42

Oh really, oops 😄

volrath08:11:23

@dominicm what do you mean by cider's stacktrace excavator? it'd be cool to take a look at it

volrath08:11:44

I went through cider's stacktrace source code and I don't remember seeing that term, but maybe you're referring to something else

volrath08:11:27

ah cool 🙂

volrath08:11:29

yeah I went through the cider emacs mode stacktrace sourcecode, and I noticed they had differentiation for things we don't have

volrath09:11:16

for each frame, the get from the middleware

(file line flags class method name var ns fn)
I haven't got deep into the specifics of any of those or how they produce them

cgrand09:11:08

A way to extend without breakage would be to associate namespaced keys to what is returned by Throwable->map

volrath09:11:27

I think this is a good idea 👍

cgrand09:11:36

If it proves a good idea I’ll provide an extension point in unrepl-make-blob. In the meantime, can you experiment by patching unrepl.print?

volrath10:11:58

one thing though.. this things we're talking about are frame specific, and frames are returned as vectors by Throwable->map, [class method file lineno].. not sure how would be the appropriate way to extend.. maybe add another key at the :trace level, that also has a vector of vectors but with the customized extended data? or do you think there might be a better way?

cgrand10:11:43

scrap Throwable->map altogether?

cgrand10:11:01

What are the pros and cons of using Throwable->map to render exceptions in exception context?

cgrand10:11:43

In eval context (appearing as data), printing as #error seems sensible

cgrand10:11:13

but in exception context where the client is going to fo a lot of custom rendering?

volrath10:11:15

you still have *e for that

volrath10:11:37

yes, I agree

volrath10:11:11

Throwable->map serves as a good entry point for extension, and a good default

cgrand10:11:33

And in eval context we may add :unrepl/error at the root of the #error map

cgrand10:11:18

as usual, use elisions liberally 🙂

cgrand08:11:27

re: print limits; initial rendering of an exception in an exception context width different limits ok (how to set them is still an open question) however when you ask for more you are just using an elision which has no context so either I make elision to embed some kind of context or the client set limits for aux before retrieving an elision

cgrand08:11:43

maybe embedding the context is the more sensible way

volrath08:11:47

what kind of context are you thinking of? like size of the elided seq?

cgrand09:11:42

No, :eval :exception :log and depending on the context retrieve print-limits

volrath09:11:16
replied to a thread:like?

for each frame, the get from the middleware

(file line flags class method name var ns fn)
I haven't got deep into the specifics of any of those or how they produce them

dominicm09:11:42

The clojure frames are analyzed by looking at the class, and demunging it using the clojure.repl method.

cgrand09:11:42

No, :eval :exception :log and depending on the context retrieve print-limits

cgrand09:11:08
replied to a thread:like?

A way to extend without breakage would be to associate namespaced keys to what is returned by Throwable->map

cgrand09:11:51

Guys, what about another unrepl hacktogether day in Berlin on Friday 23/2? (the day before :clojureD)

cgrand09:11:25

My talk will be about repls...

cgrand10:11:01
replied to a thread:like?

What are the pros and cons of using Throwable->map to render exceptions in exception context?

pesterhazy10:11:09

according to the changelog Throwable->map's behavior has changed 1.8->1.9 - we'd need to cover both

volrath12:11:46

btw, I'm going to briefly show unrepl.el today at the berlin emacs meetup, wish me luck 🙂

volrath12:11:12

I want to get some feedback on "emacs ergonomics" for the repl.. make it feel comfortable

pesterhazy12:11:39

actually it occurs to me my office is next door - when is the meetup tonight?

volrath12:11:11

yes, 7-7:30 .. it'd be cool if you stop by 🙂

pesterhazy12:11:38

cool will try (depending on how long my standup call goes)

volrath12:11:31

alright! talks always start like 7.45, it's not so rigid, so don't worry

volrath12:11:37

I'll make time haha

cgrand13:11:16

Ok v0.3.0 of packed-printer on npm and clojars

cgrand13:11:12

It’s good enough to use IMO (no more SO, no more surprise quadratic runtime)

cgrand13:11:50

Oh and I have a 1-sentence description of its behaviour: > This printer likes rectangular shapes (the wider the better) and despises staircases.

cgrand13:11:53

Does someone has a gnarly datastructure to print?

dominicm13:11:01

@cgrand A colleagues favourite is (clojure.java.reflect/reflect java.io.File)

dominicm13:11:10

or is it clojure.reflect?

cgrand13:11:24

If one wants to pretty print machine-printed unrepl edn, then this is the file to use as a basis: https://github.com/cgrand/packed-printer/blob/master/src/net/cgrand/packed_printer/text/edn.cljc

cgrand13:11:49

of course it could be made to emit ansi codes

dominicm14:11:04

I haven't followed parfix much, but is it essentially parinfer?

cgrand14:11:05

it just some quick paren helpers

dominicm14:11:06

I'm sure there's a demo with more goodies somewhere

dominicm14:11:24

https://www.youtube.com/watch?v=xdIwkPEnlFY this is what I was thinking of, not quite the terminal I guess. Still would be a nice thing to have.

cgrand16:11:55

@dominicm I haven’t spent enough time with parinfer

dominicm16:11:49

It's very good. 🙂 http://shaunlebron.github.io/parinfer/ you can play with it in-browser.

dominicm16:11:07

There's a new smart mode which gets rid of these mode changes, but I think you can ignore them for the purposes of unravel.

cgrand17:11:24

Question: how to add a maven dep to unravel?

cgrand22:11:49

@volrath how was the meetup?

volrath22:11:31

it went quite well, I think people really dug the idea, got a chance to talk a bit more with pesterhazy about it, and about how to do some unrepl PR.

cgrand23:11:22

May I ask what is “the idea”?

volrath23:11:04

"the idea" is my vague/lazy term to define unrepl and the emacs client haha

volrath23:11:51

and Paulus and I talked about how to make unrepl more public, but didn't get to anything concrete..

cgrand00:11:26

I have trouble myself finding a 1-sentence description for the ultimate ninja repl

volrath22:11:24

also, someone asked again about the possibility of using the client (and protocol) for something other than clojure

volrath22:11:31

I'm going to stop now on working on "flashy features" and going to press more on reliability and usability, so we can plan for an actual release