# \[ANN\] ColoredLLCodes: syntax highlighting for \`code\_llvm\` and \`code\_native\`

**URL:** <https://discourse.julialang.org/t/ann-coloredllcodes-syntax-highlighting-for-code-llvm-and-code-native/44739>\
**Category:** Package Announcements\
**Created:** [August 11, 2020, 9:46am UTC](https://discourse.julialang.org/t/ann-coloredllcodes-syntax-highlighting-for-code-llvm-and-code-native/44739 "2020-08-11T09:46:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimikage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimikage/32/14534_2.png) [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Post date:** [August 11, 2020, 9:46am UTC](https://discourse.julialang.org/t/ann-coloredllcodes-syntax-highlighting-for-code-llvm-and-code-native/44739/1 "2020-08-11T09:46:40Z")

</div>

Hi all,

I’m happy to announce [ColoredLLCodes.jl](https://github.com/kimikage/ColoredLLCodes.jl), a syntax highlighter for `code_llvm` and `code_native` 100% in Julia.  
All you have to do is install and load the package.

 ![vscode](https://global.discourse-cdn.com/julialang/original/3X/9/2/927493d9beea98412d34ac50ab3d077741f52606.png)

This package started from [Why are `code_llvm` and `code_native` not displayed in color?](https://discourse.julialang.org/t/why-are-code-llvm-and-code-native-not-displayed-in-color/42959). I made a feature request (proposal) in the JuliaLang/julia repository ([Issue #36634](https://github.com/JuliaLang/julia/issues/36634)), and I submitted a PR to port this highlighting feature to `InteractiveUtils` ([PR #36984](https://github.com/JuliaLang/julia/pull/36984)).  
I’m neutral about whether or not the syntax highlighting feature should be in `InteractiveUtils`, and I think both opinions are reasonable. So, I would be grateful for your opinion on (in) the PR.

FYI, this package is based on a heuristic approach, not the formal grammar of LLVM IR or assembly languages. I’m not sure about the quality of highlighting for LLVM IR, since I prefer `@code_native` over `@code_llvm`. Also, I do not have a machine with new instruction sets such as Intel AVX-512, ARM SVE. So if you find a parsing failure, feel free to submit an issue to the ColoredLLCodes repository.

---

<div class="post-metadata">

**Author:** ![kimikage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimikage/32/14534_2.png) [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Post date:** [October 2, 2020, 3:14am UTC](https://discourse.julialang.org/t/ann-coloredllcodes-syntax-highlighting-for-code-llvm-and-code-native/44739/2 "2020-10-02T03:14:34Z")

</div>

[PR #36984](https://github.com/JuliaLang/julia/pull/36984) was merged.  
You can customize the color scheme on the nightly build as shown below. Note that there is no public API for customization at the moment.

```julia
InteractiveUtils.llstyle[:default] = (false, :normal)
InteractiveUtils.llstyle[:comment] = (false, 101)
InteractiveUtils.llstyle[:label] = (false, :normal)
InteractiveUtils.llstyle[:instruction] = ( true, 197)
InteractiveUtils.llstyle[:type] = (false, 81)
InteractiveUtils.llstyle[:number] = (false, 141)
InteractiveUtils.llstyle[:bracket] = (false, :normal)
InteractiveUtils.llstyle[:variable] = (false, 208)
InteractiveUtils.llstyle[:keyword] = (false, 197)
InteractiveUtils.llstyle[:funcname] = (false, 208)

```
