Comments (13)
🏊🏻♂️ in types over here...
![Screen Shot 2024-04-19 at 11 14 35 AM](https://private-user-images.githubusercontent.com/1880641/324009157-5f6e85db-f990-4767-9217-44410ead3d18.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3Mjg5MDMsIm5iZiI6MTcyMzcyODYwMywicGF0aCI6Ii8xODgwNjQxLzMyNDAwOTE1Ny01ZjZlODVkYi1mOTkwLTQ3NjctOTIxNy00NDQxMGVhZDNkMTgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTVUMTMzMDAzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTMwNTViNzkzYmU4MmM1NmM1Y2MxZDQyNDgyNWE2NDI1ZDBiYmMwMTFiNTRmNjNkZGU2Yzk1ODU0Zjg1YjkyZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.1SAGF2pwLn67P5jZwp0vgYqU2J-02bcgvOLWZiFcnvc)
from cthulhu.jl.
I think someone would just need to truncate this and add some option to enable/disable it,
Cthulhu.jl/TypedSyntax/src/show.jl
Line 121 in 17c53a1
from cthulhu.jl.
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.
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.
Yeah, I did ] dev TypedSyntax
from Cthulhu.jl/
from cthulhu.jl.
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.
Huh, interesting, I'll try again
from cthulhu.jl.
Hmm, I can't even error inside that function. Can you put an error in there and show the stack trace?
from cthulhu.jl.
I might have to Cthulhu Cthulhu 😵💫
from cthulhu.jl.
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.
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.
Ah, wow, when I did ]dev TypedSyntax
from Cthulhu.jl/
, it picked up TypedSyntax
in a different Cthulhu.jl
directory!
from cthulhu.jl.
Looks like its working now
from cthulhu.jl.
Related Issues (20)
- expected Core.Compiler.InferenceState, got a value of type Nothing HOT 2
- Program Slice View
- `type CodeInfo has no field rettype` on Julia's master branch HOT 1
- Imperfect type inference on Julia nightly that doesn't agree with `@code_warntype` HOT 1
- Inlay hints placed in wrong locations HOT 2
- AssertionError from Core.Compiler HOT 2
- Keyword `interactive` kw does not exist in `code_warntype`, as suggested
- Cthulhu not precompiling in 1.11. IOError: stream is closed or unusable HOT 2
- ERROR: LoadError: Some tests did not pass: 320 passed, 1 failed, 0 errored, 1 broken.
- Better (or at least larger) callstack browser? HOT 1
- ERROR: type InferenceResult has no field exc_result
- Cthulhu broken on nightly HOT 1
- `_dump_function_llvm` errors when printing LLVM IR on nightly
- Cannot Precompile Cthulhu HOT 3
- Proposal: split test/FakeTerminals.jl out into its own package
- Issues with the current `ascend` extension interface
- StringIndexError when trying to @descend
- TypeError: in typeassert, expected Union{JuliaSyntax.TreeNode{TypedSyntax.TypedSyntaxData}, JuliaSyntax.SyntaxNode}, got a value of type Nothing
- `do_typeinf!(interp, mi)` does not always put `mi` into cache
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cthulhu.jl.