5
2
Fork
You've already forked lightening
2
Just-in-time code generation library derived from GNU Lightning
  • C 99.7%
  • Makefile 0.3%
Ekaitz Zarraga 35ed253b26
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
tests: Update comment in runner.
* tests/Makefile: Update comment.
2026年05月04日 00:03:39 +02:00
lightening riscv: Fix cas_atomic. 2026年03月25日 14:37:56 +01:00
tests tests: Update comment in runner. 2026年05月04日 00:03:39 +02:00
.gitignore Rework naming of test suite files 2019年03月26日 10:02:30 +01:00
.gitlab-ci.yml Fix CI 2025年01月29日 14:28:13 +01:00
.woodpecker.yml ci: Don't use binfmt. 2026年05月03日 23:55:27 +02:00
AUTHORS Prepare for the first alpha release of lightning 2.0. 2013年06月05日 20:18:54 -03:00
ChangeLog Archive lightning ChangeLog 2018年10月30日 11:42:08 +01:00
ChangeLog.lightning Archive lightning ChangeLog 2018年10月30日 11:42:08 +01:00
COPYING switch to GPLv3 2008年01月09日 15:50:13 +01:00
COPYING.DOC update FSF address 2008年01月09日 15:49:29 +01:00
COPYING.LESSER switch to GPLv3 2008年01月09日 15:50:13 +01:00
lightening.am RISC-V Support 2025年01月29日 14:01:52 +01:00
lightening.h RISC-V Support 2025年01月29日 14:01:52 +01:00
lightning.texi Move lightning.texi up to root, and remove Makefile.am 2018年10月30日 11:35:53 +01:00
NEWS Second alpha release 1.99a 2013年07月08日 11:58:03 -03:00
README.md README: Add CI badge and remove CI text. 2026年05月03日 23:55:13 +02:00
THANKS Implement a correct generation of Fibonacci numbers. 2015年11月30日 15:32:48 -02:00

status-badge

Lightening

Lightening is a just-in-time code generation library derived from GNU Lightning, adapted to the purposes of the GNU Guile project.

Use

gcc -flto -O2 -g -o lightening.o -c lightening/lightening.c
gcc -flto -O2 -g -o my-program lightening.o my-program.c

See the GNU Lightning manual for more on how to program against Lightening (much of the details are the same).

What's the difference with GNU Lightning?

This project is called Lightening because it's lighter-weight than GNU Lightning. When you go to generate code at run-time with GNU Lightning, what happens is that you build up a graph of nodes which GNU Lightning "optimizes" before finally emitting machine code. These optimizations can improve register allocation around call sites. However they are not helpful from a Guile perspective, as they get in the way of register allocation that we need to do; and they actually prevent access to all the registers that we would like to have.

Guile needs a simple, light-weight code generation library. The GNU Lightning architecture-specific backends provide the bulk of this functionality, and Lightening wraps it all in a lightweight API.

Supported targets

Lightening can generate code for the x86-64, i686, ARMv7, AArch64 and RISC-V (RV64) architectures. It supports the calling conventions of MS Windows, GNU/Linux, and Mac OS.

On i686, Lightening requires SSE support. On ARMv7, we require hardware floating-point support (the VFP instructions), as well as the UDIV/SDIV instructions.

Future targets

Lightening has some inherited code from GNU Lightning for MIPS, PPC64, and s390. Patches to adapt this code to the Lightening code structure are quite welcome.

Status

Lightening is used in GNU Guile since version 2.9.2 and seems to work well.