Software:GNU lightning

From HandWiki
GNU lightning
Heckert GNU white.svg
Developer(s)GNU Project
Initial releaseJanuary 19, 2001; 23 years ago (2001-01-19)[1]
Stable release2.1.3 (September 18, 2019; 4 years ago (2019-09-18)[2]) [±]
Operating systemCross-platform
PlatformGNU
TypeJust-in-time compilation
License2007: LGPL-3.0-or-later[lower-alpha 1]
2002: LGPL-2.1-or-later[lower-alpha 2]
WebsiteOfficial website

GNU lightning is a free-software library for generating assembly language code at run-time. Version 2.1.3, released in September 2019, supports backends for SPARC (32-bit), x86 (32- and 64-bit), MIPS, ARM (32- and 64-bit), ia64, HPPA, PowerPC (32-bit), Alpha, S390 and RISC-V (64-bit).[5][6]

Advantages over other libraries

The features GNU lightning provides make it useful for Just-in-Time Compilation. In comparison to libraries such as LLVM or libJIT, GNU lightning provides only a low-level interface for assembling from a standardized RISC assembly language—loosely based on the SPARC and MIPS architectures[7]—into the target architecture's machine language.

Disadvantages

It does not provide register allocation, data-flow or control-flow analysis, or optimization.[citation needed] Starting from 2.x, It generates code via intermediate graph, rather than one by one from each It's standardized instruction. This change allows inter-instruction optimization such as register allocation and dead code elimination [1].

Instruction set

GNU lightning's instruction set is based loosely on existing RISC architectures.

Types

When required instructions handle data with these 9 types:

Type C equivalent
c signed char
uc unsigned char
s short
us unsigned short
i int
ui unsigned int
l long
f float
d double

Projects that use GNU lightning

GNU Smalltalk,[8] GNU Guile,[9] and CLISP[10] make use of GNU lightning for just-in-time compilation. GNU lightning was first developed as a tool to be used in GNU Smalltalk's dynamic translator from bytecodes to native code.[11] GNU Guile 2.9.2 and later stop using GNU lightning 2.x instead their own fork based on GNU lightning 1.4 for native code generation, because GNU lightning 2.x devotes more complexity to inter-instruction optimization.[12]

Notes

  1. LGPL-3.0-or-later since 2007-07-01.[3]
  2. LGPL-2.1-or-later from 2002-06-25 until 2007-07-01.[4]

References

  1. "ChangeLog". GNU Project. http://ftp.gnu.org/gnu/lightning/. Retrieved 2009-02-22. 
  2. de Andrade, Paulo César Pereira (2019-09-18). "GNU lightning 2.1.3 released!" (Mailing list). lightning. Retrieved 2020-01-15.
  3. "README-hacking". https://git.savannah.gnu.org/cgit/lightning.git/tree/README-hacking. 
  4. "lightning-1.1.1.tar.gz". https://ftpmirror.gnu.org/gnu/lightning/lightning-1.1.1.tar.gz. 
  5. "GNU lightning". https://www.gnu.org/software/lightning/. Retrieved 2020-01-15. 
  6. "GNU lightning 2.1.3 released!". 2019-09-18. https://lists.gnu.org/archive/html/lightning/2019-09/msg00033.html. 
  7. "Using and porting GNU lightning". https://www.gnu.org/software/lightning/manual/lightning.html. Retrieved 2009-02-22. 
  8. "GNU Smalltalk project page". http://smalltalk.gnu.org/project. Retrieved 2014-05-17. 
  9. "Just-In-Time Native Code". https://www.gnu.org/software/guile/docs/master/guile.html/Just_002dIn_002dTime-Native-Code.html. Retrieved 2019-03-11. 
  10. "Implementation notes for GNU CLISP". http://clisp.cons.org/impnotes.html. Retrieved 2009-02-23. 
  11. "GNU lightning user manual, acknowledgements". https://www.gnu.org/software/lightning/manual/lightning.html#Acknowledgements. Retrieved 2014-05-17. 
  12. "lightening run-time code generation -- wingolog". https://wingolog.org/archives/2019/05/24/lightening-run-time-code-generation. Retrieved 2021-12-10. 

External links