23

GitHub - racaljk/llmd: 如果将markdown视作一门编程语言可以做哪些有趣的事情呢?

 5 years ago
source link: https://github.com/racaljk/llmd
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Using markdown as a programming language

如果将markdown视作一门编程语言可以做哪些有趣的事情?这个项目就是为了解决这个好奇:

获取LLMD

推荐使用预编译版本:

源码构建:

三步即可编译得到llmd(需要在CMakeLists.txt中配置LLVM libs):

$ mkdir build && cd build && cmake .. && make
$ llmv your_markdown_file

markdown示例

你好,世界

计算斐波那契数列

图灵完备的语法集


[var](value)             // 赋值(Literal,Arithmetic)

> hello `var`            // 输出

`a+b`                    // 算术运算(+,-,*) 

**label**                // 跳转标记

![condition](tag)       //  条件跳转(condition!=0)

计划

  1. 如果给定的markdown源码无法满足编译要求会报错,而不是直接crash
  2. 编译最终产物是对象文件或者库文件,可以与C系语言输出进行链接

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK