惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
WordPress大学
WordPress大学
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
P
Proofpoint News Feed
D
DataBreaches.Net

Mox的笔记库

2026PPoPP MLIR Tutorial学习 | Mox的笔记库 MacOS配置《明日方舟:终末地》 | Mox的笔记库 2025:向内生长 | Mox的笔记库 由mlir::ExecutionEngine引发的跨系统问题 | Mox的笔记库 WSL2配置Cuda-Tile环境记录(未完待续) | Mox的笔记库 Vibe Coding手搓项目记录 | Mox的笔记库 给Debian上包——以DuckDB为例 | Mox的笔记库 UCPD.sys事件存档 | Mox的笔记库 换新电脑之Mac mini M4从购买到配置 | Mox的笔记库 Mac配置MLX-C开发环境 | Mox的笔记库 RISC-V meets RDBMS——RISC-V架构上可运行数据库一览 | Mox的笔记库 DuckDB Sort实现调查 | Mox的笔记库 修复Redis在树莓派5上无法运行的问题 | Mox的笔记库 如何在MLIR中自定义类型并且输出运行 | Mox的笔记库 网站网络结构变更记录 | Mox的笔记库 EDBT25论文阅读:PhoebeDB——A Disk-Based RDBMS Kernel for High-Performance and Cost-Effective OLTP SIGMOD25论文阅读:BPF-DB:——A Kernel-Embedded Transactional Database Management System For eBPF Applications Apache Arrow Gandiva项目解析 | Mox的笔记库 VLDB24论文阅读:Cloud-Native Database Systems and Unikernels——Reimagining OS Abstractions for Modern Hardware NoisePage源码分析(未完待续) | Mox的笔记库 VLDB20论文阅读:Mainlining Databases——Supporting Fast Transactional Workloads on Universal Columnar Data File Formats VLDB17论文阅读:Relaxed Operator Fusion for In-Memory Databases:Making Compilation, Vectorization, and Prefetching Work Together At Last 论文阅读:How not to structure your database-backed web applications——a study of performance bugs in the wild SIGMOD24阅读:ROME——Robust Query Optimization via Parallel Multi-Plan Execution 文章阅读:First Past the Post-Evaluating Query Optimization in MongoDB SIGMOD文章阅读:Apache Calcite——A Foundational Framework for Optimized Query Processing Over Heterogeneous Data Sources VLDB23论文阅读:Analyzing the Impact of Cardinality Estimation on Execution Plans in Microsoft SQL Server SIGMOD22论文阅读:Efficient Massively Parallel Join Optimization for Large Queries VLDB论文阅读:Weaving Relations for Cache Performance VLDB22论文阅读:ConnectorX——Accelerating Data Loading From Databases to Dataframes
如何给自己的博客添加MLIR和LLVM IR语法高亮 | Mox的笔记库
MocusEZ · 2024-12-28 · via Mox的笔记库

为什么会有这个问题呢😅?经常看过我博客的人应该都知道,我之前写过不少有关MLIR和LLVM的博客,但Hexo使用的highlight.js只能渲染LLVM IR,MLIR IR就会自动降级为Plaintext

image-20241227213539031

这种情况在Hexo上也还可以接受,但转到Astro上后,Shiki的代码渲染给我感觉就笨的多:不仅对于语言名称大小写不敏感,导致早年写的一堆代码无法渲染渲染😅连LLVM IR的渲染也给我搞没了。

这忍不了了,得好好处理下😅

添加语法文件

看下Shiki和Expressive Code的文档很容易理解,难点在于如何找到合适的json格式TextMate文件进行导入

Load Custom Languages | Shiki

syntax-highlighting/#configuration

这里有个小技巧:可以去VS Code的插件里面找对应语言的语法高亮插件,那些插件的仓库里多半有描述语法的json文件

LLVM IR -> colejcummins/llvm-syntax-highlighting

MLIR IR -> llvm/vscode-mlir

Note: Shiki自己的语法描述文件是放在 shikijs/textmate-grammars-themes 这个仓库里的

载入

参考这个commit,理论上使用Shiki进行渲染的系统都可以参照这个进行操作:

feat: add support for LLVM IR and MLIR IR syntax highlighting in markdown,

最终效果

其实就是这篇文章:如何愉快的运行一个MLIR程序

image-20241227211508817

image-20241227211527478


avatar

探索未曾设想的道路