{"repo":"MilesCranmer/DispatchDoctor.jl","free":true,"listed":false,"github":"https://github.com/MilesCranmer/DispatchDoctor.jl","clone":"git clone https://github.com/MilesCranmer/DispatchDoctor.jl.git","description":"The dispatch doctor prescribes type stability","language":"Julia","stars":211,"topics":["code-quality","developer-tools","development","julia","monitoring","performance","performance-testing","programming-language","safety"],"license":"Apache-2.0","category":"dev-tools","readme_excerpt":"DispatchDoctor 🩺 The doctor's orders: no type instability allowed! 💊 Usage This package provides the @stable macro to enforce that functions have type stable return values. Calling this function will throw an error for any type instability: Code which is type stable should safely compile away the check: with @code llvm f(1) : Meaning there is zero overhead on this type stability check. (This may not always be true, so be sure to try the workflow in usage in packages) You can use @stable on blocks of code, including begin-end blocks, module , and anonymous functions. The inverse of @stable is @unstable which turns it off: All methods in the block will be wrapped with the type stability check: ( Tip: you cannot import or define macros within a begin...end block, unless it is at the \"top level\" of a submodule. So, if you are wrapping the contents of a package, you should either import any macros outside of @stable begin...end , or put them into a submodule. ) ( Tip 2: in the REPL, you must wrap modules with @eval , because the REPL has special handling of the module keyword. ) You can disable stability errors for a single scope with the allow unstable context: although this will error if you try to use it simultaneously from two separate threads. 🧪 Options You can provide the following options to @stable : - default mode::String=\"error\" : - Change the default mode from \"error\" to \"warn\" to only emit a warning, or \"disable\" to disable type instability checks by default. - To l","default_branch":null,"files":null,"tree":[],"storefront":"/r/MilesCranmer","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/MilesCranmer/DispatchDoctor.jl/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}