JuliaDebug / JuliaDebug/Cthulhu.jl

show corresponding return types for each union-split callsite

Open
#141 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

Can be described with the following example:

julia> f(::Int) = rand(Int)
f (generic function with 1 method)

julia> f(::Float64) = rand(Float64)
f (generic function with 2 methods)

julia> descend((Union{Int,Float64},); optimize = false) do t
           f(a)
       end
 ...
 • %1  = call #f(::Any)::Union{Float64, Int64}
   ↩
 • %1  = f(::Int64)::Union{Float64, Int64}   # <= ::Int64, ideally
   %1  = f(::Float64)::Union{Float64, Int64} # <= ::Float64, ideally
   ↩

We will need to obtain "not-merged" return types for each callsite somehow,
and it requires additional or customized abstract interpretation passes under the current AbstractInterpreter inteface, I guess.

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 with the descend((Union{Int,Float64},); optimize = false) example and inspect the current AbstractInterpreter interface. Determine how additional or customized abstract-interpretation passes could retain unmerged return types for each union-split callsite. Done means each specialized callsite displays its corresponding return type rather than only the merged union.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.