Giter VIP home page Giter VIP logo

Comments (13)

charleskawczynski avatar charleskawczynski commented on August 15, 2024

🏊🏻‍♂️ in types over here...

Screen Shot 2024-04-19 at 11 14 35 AM

from cthulhu.jl.

Zentrik avatar Zentrik commented on August 15, 2024

I think someone would just need to truncate this and add some option to enable/disable it,

T_str = string(T)

from cthulhu.jl.

charleskawczynski avatar charleskawczynski commented on August 15, 2024

I have a branch where I'm experimenting with depth-limited type printing, and that unfortunately doesn't seem to be working

from cthulhu.jl.

Zentrik avatar Zentrik commented on August 15, 2024

Are you sure you're using your custom TypedSyntax, it's its own package. Just loading your branch of Cthulhu won't work I think.

from cthulhu.jl.

charleskawczynski avatar charleskawczynski commented on August 15, 2024

Yeah, I did ] dev TypedSyntax from Cthulhu.jl/

from cthulhu.jl.

Zentrik avatar Zentrik commented on August 15, 2024

That's odd, I changed that line to T_str = string(T)[1:2] and it works

julia> @descend sin(42.)
sin(x::T) where T<:Union{Float32, Float64} @ Base.Math C:\Users\gag\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\share\julia\base\special\trig.jl:29       
29 function (sin(x::Fl::T) where T<:Union{Float32, Float64})::Fl
30     absx::Fl = abs(x::Fl)::Fl
31     if (absx::Fl < (T::Ty(pi::Ir)::Fl/4)::Fl)::Bo #|x| ~<= pi/4, no need for reduction
32         if (absx::Fl < sqrt(eps(T::Ty)::Fl)::Fl)::Bo
33             return x::Fl
34         end
35         return sin_kernel(x::Fl)::Fl
36     elseif isnan(x::Fl)::Bo
37         return x::Fl
38     elseif isinf(x::Fl)::Bo
39         sin_domain_error(x::Fl)
40     end
41     n::In, y::Ba = rem_pio2_kernel(x::Fl)::Tu::Ba
42     n::In = (n::In&3)::In
43     if (n::In == 0)::Bo
44         return sin_kernel(y::Ba)::Fl
45     elseif (n::In == 1)::Bo
46         return cos_kernel(y::Ba)::Fl
47     elseif (n::In == 2)::Bo
48         return -(sin_kernel(y::Ba)::Fl)::Fl
49     else
50         return -(cos_kernel(y::Ba)::Fl)::Fl
51     end
52 end
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, [j]ump to source always, [v]scode: inlay types, [V]scode: diagnostics.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
 • abs(x::Fl)
   T::Ty(pi::Ir)
    T::Ty(pi::Ir)::Fl/4
    absx::Fl < (T::Ty(pi::Ir)::Fl/4)::Fl
   eps(T::Ty)
   sqrt(eps(T::Ty)::Fl)
    absx::Fl < sqrt(eps(T::Ty)::Fl)::Fl
   sin_kernel(x::Fl)
   isnan(x::Fl)
v  isinf(x::Fl)

from cthulhu.jl.

charleskawczynski avatar charleskawczynski commented on August 15, 2024

Huh, interesting, I'll try again

from cthulhu.jl.

charleskawczynski avatar charleskawczynski commented on August 15, 2024

Hmm, I can't even error inside that function. Can you put an error in there and show the stack trace?

from cthulhu.jl.

charleskawczynski avatar charleskawczynski commented on August 15, 2024

I might have to Cthulhu Cthulhu 😵‍💫

from cthulhu.jl.

Zentrik avatar Zentrik commented on August 15, 2024

We call the printstyled in the show.jl file linked here, https://github.com/JuliaDebug/Cthulhu.jl/blob/master/src/codeview.jl#L152

from cthulhu.jl.

Zentrik avatar Zentrik commented on August 15, 2024

Also, we pass an iocontext object to printstyled so perhaps just add the type limit to that like we do at https://github.com/JuliaDebug/Cthulhu.jl/blob/master/TypedSyntax/src/show.jl#L117-118

from cthulhu.jl.

charleskawczynski avatar charleskawczynski commented on August 15, 2024

Ah, wow, when I did ]dev TypedSyntax from Cthulhu.jl/, it picked up TypedSyntax in a different Cthulhu.jl directory!

from cthulhu.jl.

charleskawczynski avatar charleskawczynski commented on August 15, 2024

Looks like its working now

from cthulhu.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.