Skip to content
Tech News
← Back to articles

Dotcl: Common Lisp Implementation on .NET

read original more articles
Why This Matters

dotcl brings the power of Common Lisp to the .NET ecosystem, enabling cross-platform compatibility and seamless integration with existing .NET applications. Its ability to embed Lisp, access .NET types, and utilize NuGet packages makes it a versatile tool for developers seeking to combine Lisp's flexibility with .NET's robustness. This advancement opens new possibilities for scripting, extension, and development within the .NET environment, benefiting both industry and consumers.

Key Takeaways

dotcl

Common Lisp implementation on .NET. Lisp source is compiled to CIL (Common Intermediate Language) and runs on the .NET JIT — so the same Lisp image runs on Windows, macOS, and Linux across x86-64 and ARM64 without per-platform porting work.

Broadly conforms to the ANSI Common Lisp standard — verified against the ansi-test suite.

What dotcl is good for

Embedding Common Lisp in .NET applications. dotcl.runtime is a regular .NET library; you load it from any C# / F# / VB.NET project, evaluate Lisp code, and call back and forth.

is a regular .NET library; you load it from any C# / F# / VB.NET project, evaluate Lisp code, and call back and forth. Writing .NET code in Lisp. The dotnet: package gives direct access to .NET types: (dotnet:new "System.Text.StringBuilder") , (dotnet:invoke sb "Append" "x") , (dotnet:static "System.Math" "Sin" 1.0) . You can subclass .NET types from Lisp via dotnet:define-class — the compiler emits real .NET classes, so frameworks like MAUI, ASP.NET Core, and MonoGame just see them as ordinary subclasses.

The package gives direct access to .NET types: , , . You can subclass .NET types from Lisp via — the compiler emits real .NET classes, so frameworks like MAUI, ASP.NET Core, and MonoGame just see them as ordinary subclasses. Cross-platform CL with NuGet ecosystem access. Any NuGet package is reachable from Lisp; any Quicklisp library that doesn't rely on SBCL-only internals tends to work too (asdf, alexandria, etc. are routinely loaded).

Quick start

# One-time bootstrap: cross-compile dotcl's compiler with Roswell/SBCL. make cross-compile # Install as a `dotnet tool`-style global command. make install # REPL dotcl repl # Evaluate a form dotcl --eval " (format t \" hello, ~a~% \" (lisp-implementation-type)) " # Run a file dotcl --load my-program.lisp

After the first cross-compile, dotcl can self-host: DOTCL_LISP=dotcl make cross-compile rebuilds the compiler using dotcl itself.

... continue reading