Sometimes you want to know more about what youβre working with, whether it be a function, type, value, or something else entirely.
This package is a utility to help answer that question, it exports a single
function about
, which can be applied to any Julia object.
This makes heavy use of the new
AnnotatedString
type provided in Julia 1.11. While it can be used with Julia 1.9 and 1.10, the package load time is dramatically worse.
These examples should give an impression of what about
does in practice, though
without some of the πpizazzβ¨ youβll see if you try it yourself.
julia> about(About)
Module About [69d22d85-9f48-4c46-bbbe-7ad8341ff72a]
Version 0.1.0 loaded from ~/.julia/dev/About
Directly depends on 4 packages (+9 indirectly):
β’ PrecompileTools (+5) β’ InteractiveUtils (+3) β’ StyledStrings β’ JuliaSyntaxHighlighting (+1)
Exports 2 names:
β’ About β’ about
julia> about(β―)
Irrational{:β―} (<: AbstractIrrational <: Real <: Number <: Any), occupies 0B.
singelton
julia> about(Float64(β―))
Float64 (<: AbstractFloat <: Real <: Number <: Any), occupies 8B.
0100000000000101101111110000101010001011000101000101011101101001
β¨ββββββ¬βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββ
+ 2^1 Γ 1.359140914229522545
= 2.7182818284590451
julia> about('β')
Char (<: AbstractChar <: Any), occupies 4B.
β2ββ β2βββββ1ββββAββ
11100010 10001000 10011010 00000000
ββ0xe2ββ ββ0x88ββ ββ0x9aββ ββ0x00ββ
= U+221A
Unicode 'β', category: Symbol, math (Sm)
julia> about(Dict{Symbol, Int})
Concrete DataType defined in Base, 64B
Dict{Symbol, Int64} <: AbstractDict{Symbol, Int64} <: Any
Struct with 8 fields:
β’ slots *Memory{UInt8}
β’ keys *Memory{Symbol}
β’ vals *Memory{Int64}
β’ ndel Int64
β’ count Int64
β’ age UInt64
β’ idxfloor Int64
β’ maxprobe Int64
β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
* * * 8B 8B 8B 8B 8B
* = Pointer (8B)
julia> about(sum, Set{Int})
sum (generic function with 10 methods)
Defined in Base(8) extended in Base.MPFR(1) and Base.GMP(1).
Matched 1 method :: Int64
sum(a; kw...) @ Base reduce.jl:561
Method effects
β consistent might not return or terminate consistently
β effect free guaranteed to be free from externally semantically visible side effects
β no throw may throw an exception
β terminates might not always terminate
β no task state guaranteed not to access task state (allowing migration between tasks)
~ inaccessible memory only may access or modify mutable memory iff pointed to by its call arguments
β no undefined behaviour may execute undefined behaviour
β non-overlayed may call methods from an overlayed method table