JuliaDebug / JuliaDebug/Cthulhu.jl

Feature request: only print types once in an expression

Open
#466 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
709
Forks
46
Avg merge
1d 13h
Merged PRs (30d)
2

Description

As an example, consider the following snippet:

copy(M::ArrayLayouts.MulAdd) @ ArrayLayouts ~/Dropbox/JuliaPackages/ArrayLayouts.jl/src/muladd.jl:72
72 copy(M::ArrayLayouts.MulAdd{BlockArrays.BlockLayout{ArrayLayouts.DenseColumnMajor, ArrayLayouts.UnknownLayout}, BlockArrays.BlockLayout{ArrayLayouts.DenseColumnMajor, ArrayLayouts.DenseColumnMajor}, ArrayLayouts.ZerosLayout, Float64, BlockMatrix{Float64, Matrix{SparseMatrixCSC{Float64, Int64}}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}, BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedUnitRange{Vector{Int64}}}}, FillArrays.Zeros{Float64, 1, Tuple{BlockedUnitRange{Vector{Int64}}}}}::MulAdd)::BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedUnitRange{Vector{Int64}}}} = copyto!(similar(M::ArrayLayouts.MulAdd{BlockArrays.BlockLayout{ArrayLayouts.DenseColumnMajor, ArrayLayouts.UnknownLayout}, BlockArrays.BlockLayout{ArrayLayouts.DenseColumnMajor, ArrayLayouts.DenseColumnMajor}, ArrayLayouts.ZerosLayout, Float64, BlockMatrix{Float64, Matrix{SparseMatrixCSC{Float64, Int64}}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}, BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedUnitRange{Vector{Int64}}}}, FillArrays.Zeros{Float64, 1, Tuple{BlockedUnitRange{Vector{Int64}}}}})::BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedUnitRange{Vector{Int64}}}}, M::ArrayLayouts.MulAdd{BlockArrays.BlockLayout{ArrayLayouts.DenseColumnMajor, ArrayLayouts.UnknownLayout}, BlockArrays.BlockLayout{ArrayLayouts.DenseColumnMajor, ArrayLayouts.DenseColumnMajor}, ArrayLayouts.ZerosLayout, Float64, BlockMatrix{Float64, Matrix{SparseMatrixCSC{Float64, Int64}}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}, BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedUnitRange{Vector{Int64}}}}, FillArrays.Zeros{Float64, 1, Tuple{BlockedUnitRange{Vector{Int64}}}}})
Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark.
Toggles: [w]arn, [h]ide type-stable statements, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
 • similar(M::ArrayLayouts.MulAdd{BlockArrays.BlockLayout{ArrayLayouts.DenseColumnMajor, ArrayLayouts.UnknownLayout}, BlockArrays.BlockLayout{ArrayLayouts.DenseColumnMajor, ArrayLayouts.…
   copyto!(similar(M::ArrayLayouts.MulAdd{BlockArrays.BlockLayout{ArrayLayouts.DenseColumnMajor, ArrayLayouts.UnknownLayout}, BlockArrays.BlockLayout{ArrayLayouts.DenseColumnMajor, Array…
   ↩

Here, the source for line 72 reads

copy(M::MulAdd) = copyto!(similar(M), M)

and the type of M is printed beside each instance. This seems redundant and is not adding any additional information, but is significantly adding to visual clutter. I wonder if it might be possible to ensure that the types of variables are printed only once, perhaps when the variable occurs in an expression for the first time?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the type-annotated expression display shown in the issue and trace how the debugger renders repeated variable types. Define the expected output for the example so each variable type is shown only on its first occurrence, then verify the revised display preserves the existing navigation and annotation controls.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.