Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use normal expression printer when we don't have source code #19

Open
JeffBezanson opened this issue Mar 11, 2016 · 2 comments
Open

use normal expression printer when we don't have source code #19

JeffBezanson opened this issue Mar 11, 2016 · 2 comments

Comments

@JeffBezanson
Copy link
Collaborator

The terminal graphic tree display is really cool but it's too verbose for most purposes. We should just show the expressions the way julia usually does.
Example:

julia> f() = [i+1 for i = 1:2]
f (generic function with 1 method)

julia> @enter f()
Body
├─ none: 1
├─ :(GenSym(0) = (Main.colon)(1,2))
│  ├─ GenSym(0)
│  └─ Call
│     ├─ Main.colon
│     ├─ 1
│     └─ 2
├─ :(GenSym(1) = (top(length))(GenSym(0)))
│  ├─ GenSym(1)
│  └─ Call
│     ├─ top(length)
│     └─ GenSym(0)
├─ 0: 
├─ :(GenSym(2) = (top(Array))($(Expr(:static_typeof, GenSym(3))),GenSym(1)))
│  ├─ GenSym(2)
│  └─ Call
│     ├─ top(Array)
│     ├─ :($(Expr(:static_typeof, GenSym(3))))
│     │  └─ GenSym(3)
│     └─ GenSym(1)
├─ :(#s54 = 1)
│  ├─ #s54
│  └─ 1
├─ :(#s53 = (top(start))(GenSym(0)))
│  ├─ #s53
│  └─ Call
│     ├─ top(start)
│     └─ GenSym(0)
├─ :(#s52 = (top(typeassert))((top(convert))((top(typeof))(GenSym(1)),0),(top(typeof))(GenSym(1))))
│  ├─ #s52
│  └─ Call
│     ├─ top(typeassert)
│     ├─ Call
│     │  ├─ top(convert)
│     │  ├─ Call
│     │  │  ├─ top(typeof)
│     │  │  └─ GenSym(1)
│     │  └─ 0
│     └─ Call
│        ├─ top(typeof)
│        └─ GenSym(1)
├─ 3: 
├─ :(unless (top(!=))(#s52,GenSym(1)) goto 2)
│  ├─ Call
│  │  ├─ top(!=)
│  │  ├─ #s52
│  │  └─ GenSym(1)
│  └─ 2
├─ :(GenSym(4) = (top(+))(#s52,1))
│  ├─ GenSym(4)
│  └─ Call
│     ├─ top(+)
│     ├─ #s52
│     └─ 1
├─ :(#s52 = (top(typeassert))((top(convert))((top(typeof))(GenSym(1)),GenSym(4)),(top(typeof))(GenSym(1))))
│  ├─ #s52
│  └─ Call
│     ├─ top(typeassert)
│     ├─ Call
│     │  ├─ top(convert)
│     │  ├─ Call
│     │  │  ├─ top(typeof)
│     │  │  └─ GenSym(1)
│     │  └─ GenSym(4)
│     └─ Call
│        ├─ top(typeof)
│        └─ GenSym(1)
├─ :(GenSym(5) = (top(next))(GenSym(0),#s53))
│  ├─ GenSym(5)
│  └─ Call
│     ├─ top(next)
│     ├─ GenSym(0)
│     └─ #s53
├─ :(#s51 = (top(start))(GenSym(5)))
│  ├─ #s51
│  └─ Call
│     ├─ top(start)
│     └─ GenSym(5)
├─ :(GenSym(6) = (top(indexed_next))(GenSym(5),1,#s51))
│  ├─ GenSym(6)
│  └─ Call
│     ├─ top(indexed_next)
│     ├─ GenSym(5)
│     ├─ 1
│     └─ #s51
├─ :(i = (top(getfield))(GenSym(6),1))
│  ├─ i
│  └─ Call
│     ├─ top(getfield)
│     ├─ GenSym(6)
│     └─ 1
├─ :(#s51 = (top(getfield))(GenSym(6),2))
│  ├─ #s51
│  └─ Call
│     ├─ top(getfield)
│     ├─ GenSym(6)
│     └─ 2
├─ :(GenSym(7) = (top(indexed_next))(GenSym(5),2,#s51))
│  ├─ GenSym(7)
│  └─ Call
│     ├─ top(indexed_next)
│     ├─ GenSym(5)
│     ├─ 2
│     └─ #s51
├─ :(#s53 = (top(getfield))(GenSym(7),1))
│  ├─ #s53
│  └─ Call
│     ├─ top(getfield)
│     ├─ GenSym(7)
│     └─ 1
├─ :(#s51 = (top(getfield))(GenSym(7),2))
│  ├─ #s51
│  └─ Call
│     ├─ top(getfield)
│     ├─ GenSym(7)
│     └─ 2
├─ :(GenSym(3) = i + 1)
│  ├─ GenSym(3)
│  └─ Call
│     ├─ Main.+
│     ├─ i
│     └─ 1
├─ :($(Expr(:type_goto, 0, GenSym(3))))
│  ├─ 0
│  └─ GenSym(3)
├─ :($(Expr(:inbounds, true)))
│  └─ true
├─ Call
│  ├─ top(setindex!)
│  ├─ GenSym(2)
│  ├─ GenSym(3)
│  └─ #s54
├─ :($(Expr(:inbounds, :(Main.pop))))
│  └─ Main.pop
├─ :(#s54 = (top(+))(#s54,1))
│  ├─ #s54
│  └─ Call
│     ├─ top(+)
│     ├─ #s54
│     └─ 1
├─ 4: 
├─ goto 3
├─ 2: 
├─ 1: 
└─ Return
   └─ GenSym(2)
@Keno
Copy link
Owner

Keno commented Mar 11, 2016

Yes, I agree ;)

@JeffBezanson
Copy link
Collaborator Author

Alternative idea: don't vertically expand nodes that are "simple" according to some heuristic. For example x = 1, or calls whose child nodes are leaf nodes like symbols and numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants