proj-plbook-plChImplementationTools

Table of Contents for Programming Languages: a survey

LLVM

See LLVM

PyPy

See PyPy

JVM

See JVM

CLR

See CLR

Rust HolyJIT

https://github.com/nbp/holyjit

" HolyJit? is a high-level Just-In-Time compiler. It extends the Rust compiler to convert the code of an interpreter written in Rust to tune a JIT compiler to handle the same interpreted language. ... Thus, you basically have to write an interpreter, and annotate it properly to teach the JIT compiler what can be optimized by the compiler. "

Libc s

https://en.wikipedia.org/wiki/C_standard_library

Many "libc" implementations combine the C standard library with an implementation of the POSIX standard.

Feature-complete libcs

By 'feature-complete' libcs, we mean libcs that implement all functionality required by a C standard.

glibc:

musl:

Microsoft Visual C Run-Time Library (MSVCRT.DLL):

Alternate libcs

Note: i'm not clear on which, if any, of these are 'feature complete'.

Alternative libcs with restrictive licenses

dietlibc:

uClibc:

Note: According to [9] and [10], LGPL-licensed libcs cannot be statically linked in proprietary software.

Note: if the common libcs can't support static linking, then how do runtimes of statically linked languages written in C work when the runtime was itself (at least initially) written in C? One example is Go; "Gc uses a custom C library to keep the footprint under control; it is compiled with a version of the Plan 9 C compiler that supports resizable stacks for goroutines" -- [11].

Alternative libcs with permissive licenses

Bionic, a simplified libc variant for Android:

newlib libc:

Newlib has a variant 'newlib-nano'. "Newlib is a C library that can be used on embedded systems. However, as the feature set has been increased it has become too bloated for use on the very smallest systems where the amount of memory can be very limited. In order to provide a C library with a very small footprint, suited for use with micro- controllers, we have created newlib-nano based on newlib 1.19.0.":

Minimalistic "libc" alternatives

rt0:

Baselibc "for embedded systems. Mainly geared for 32-bit microcontrollers in the 10-100kB memory range. The library compiles to less than 5kB total on Cortex-M3, and much less if some functions aren't used. The code is based on klibc and tinyprintf modules, and licensed under the BSD license."

Making your own minimal libc

Comparisons and lists of libcs

Other runtimes and runtime libraries

See also targets, IRs, VMs and runtimes

Apache Portable Runtime

"OS threads, blocking IO, and other system things"

libuv

asynchronous I/O and some other stuff.

Used by nodejs, Rust language, Luvit, Julia, pyuv, MoarVM?.

libumem

Used by nodejs

helps with debugging memory leaks (see http://www.joyent.com/blog/walmart-node-js-memory-leak for an example)

Assembly

Other useful runtime libraries

libatomic_ops

"Provides implementations for atomic memory update operations on a number of architectures"

"Note that experience with this package contributed to the design of C11 and C++11 atomics, which represent a careful refinement of the API. If your platform supports well-implemented C11 or C++11 atomics, please use those instead. "

documentation: http://en.cppreference.com/w/c/atomic

C11 atomics:

All of the above atomics take an optional parameter, memory_order, which can be one of relaxed memory_order_relaxed, memory_order_consume, memory_order_acquire, memory_order_release, memory_order_acq_rel, memory_order_seq_cst. The default is memory_order_seq_cst (the strongest sequencing condition). Here's what these do: http://en.cppreference.com/w/c/atomic/memory_order

"Members of an atomic struct/union may not be accessed individually. The whole struct must first be copied to a non-atomic variable of compatible type."

"The ++,--, and compound assignment operators (e.g. +=) are atomic read-modify-write operations."

-- http://fileadmin.cs.lth.se/cs/Education/EDAN25/F06.pdf

Libffi

https://sourceware.org/libffi/

"portable, high level programming interface to various calling conventions"

Links

Language workbenches

Libraries

Program transformation

DynASM

Cranelift

Faerie

Magical ELF and Mach-o object file writer backend

https://github.com/m4b/faerie

Parsing

Attoparsec:

K framework

http://kframework.org/

"a rewrite-based executable semantic framework in which programming languages, type systems and formal analysis tools can be defined"

Links to Implementation Tools