lithium
所属分类:嵌入式/单片机/硬件编程
开发工具:Clojure
文件大小:0KB
下载次数:0
上传日期:2022-02-16 03:55:34
上 传 者:
sh-1993
说明: 基于Clojure的x86汇编程序和toy Lisp编译器,
(Clojure-based x86 assembler and toy Lisp compiler,)
文件列表:
examples/ (0, 2021-10-08)
examples/blue.li.clj (150, 2021-10-08)
examples/closures.clj (44, 2021-10-08)
examples/hello.clj (133, 2021-10-08)
examples/labels1.clj (93, 2021-10-08)
examples/stripes-grey.clj (255, 2021-10-08)
examples/stripes.li.clj (363, 2021-10-08)
project.clj (146, 2021-10-08)
src/ (0, 2021-10-08)
src/lithium/ (0, 2021-10-08)
src/lithium/assembler.clj (9936, 2021-10-08)
src/lithium/compiler.clj (9087, 2021-10-08)
src/lithium/compiler/ (0, 2021-10-08)
src/lithium/compiler/ast.clj (5972, 2021-10-08)
src/lithium/compiler/closure.clj (1901, 2021-10-08)
src/lithium/compiler/code.clj (315, 2021-10-08)
src/lithium/compiler/primitives.clj (3758, 2021-10-08)
src/lithium/compiler/repr.clj (394, 2021-10-08)
src/lithium/driver.clj (1232, 2021-10-08)
src/lithium/utils.clj (364, 2021-10-08)
test/ (0, 2021-10-08)
test/lithium/ (0, 2021-10-08)
test/lithium/compiler_test.clj (558, 2021-10-08)
# What is Lithium?
Lithium is an attempt at several things at once:
* An assembler for x86 CPUs, written in Clojure and using
Clojure S-expressions as its input data. This part has been
first announced in [this blog post][1].
* A compiler for a toy Lisp-like language, using that assembler as a
backend. The compiler is being written following the guidelines
found in a paper "[An Incremental Approach to Compiler Construction][2]."
The purposes of Lithium are, first and foremost, to learn and to have fun.
# Try it out
In the REPL:
```clojure
(require '[lithium.compiler :as compiler])
(compiler/compile-and-run! "examples/stripes-grey.clj")
```
# License
Unless otherwise noted, code in this repository is copyright by
Daniel Janus and released under the MIT license:
```
Copyright 2012–2021 Daniel Janus
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
The assembly code in `register-dump` is a s-expression version of a snippet
that comes from http://www.fysnet.net/yourhelp.htm and is copyright by
Forever Young Software.
[1]: https://blog.danieljanus.pl/2012/05/14/lithium/
[2]: http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf
近期下载者:
相关文件:
收藏者: