Skip to content
theesfeldPublic

About

WebKit browser engine rewritten in Common Lisp (SBCL)

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

cl-webkit

cl-webkit is an embeddable WebKit-style browser engine in pure Common Lisp (SBCL). Stack layout mirrors WebKit: WTF · JavaScriptCore · WebCore · WebKit API, plus a thin multi-tab shell.

Product Drop-in library: WebView, HTML/CSS/JS, layout, paint
Language Common Lisp only (SBCL)
Deps ASDF/UIOP, cl-ppcre (Quicklisp)
Compliance All tracked features :implemented (0 partial / stub / missing)
License MIT
Status Released v2.1.0
Repo github.com/theesfeld/cl-webkit

This library is for embedding and research. It is not a binary drop-in for Safari, Chrome, or WebKitGTK.


Drop-in install (consumer projects)

No patches to your app beyond a normal dependency and API calls.

1. Register the library once on the machine

git clone https://github.com/theesfeld/cl-webkit.git
# Quicklisp local-projects (recommended)
mkdir -p ~/quicklisp/local-projects
ln -sfn "$(pwd)/cl-webkit" ~/quicklisp/local-projects/cl-webkit

Or point ASDF at the tree without Quicklisp:

(asdf:load-asd #p"/absolute/or/relative/path/to/cl-webkit/cl-webkit.asd")

2. Depend on it from your system

;; your-app.asd
(defsystem "your-app"
  :depends-on ("cl-webkit")
  :components ((:file "main")))

3. Call the public API

(ql:quickload :your-app)   ; or asdf:load-system

(multiple-value-bind (wv text)
    (webkit:render-html
     "<!DOCTYPE html><html><body>
        <h1>Hello</h1>
        <script>document.title = 'cl-webkit';</script>
      </body></html>")
  (list (webkit:webview-title wv) text))

Requirements on the consumer side: declare "cl-webkit" and call shipped symbols (for example webkit:render-html, webkit:make-webview, webkit:eval-js). Do not push machine-specific paths into the library sources.


Requirements

  • SBCL 2.x (developed on 2.6.6)
  • Quicklisp or ASDF with cl-ppcre available
  • Network only when you load remote URLs; core HTML/JS paths work offline

Public embedding surface

;; HTML string → webview + text dump
(webkit:render-html html-string)

;; WebView
(let ((wv (webkit:make-webview)))
  (webkit:webview-load-html wv html :base-url "about:blank")
  (webkit:webview-evaluate wv "1+2")
  (webkit:webview-render wv :format :text))

;; Standalone JS
(webkit:eval-js "1 + 2 * 3")

;; Feature matrix
(webkit:compliance-report)
;; Summary: N implemented, 0 partial, 0 stub, 0 missing

More detail: docs/DROP-IN.md, docs/ARCHITECTURE.md.


Architecture

src/
  wtf/        URL, strings, utils
  platform/   net, websocket, timers, event loop
  jsc/        JS lexer → bytecode VM
  webcore/    DOM, HTML, CSS, layout, paint, storage, workers
  webkit/     WebView, policy, inspector, compliance
  browser/    multi-tab shell helpers

Compliance lives in src/webkit/compliance.lisp.


Tests

Portable entry (no hardcoded home directory):

# from the cl-webkit checkout
sbcl --non-interactive --load run-tests.lisp

After Quicklisp registration:

(ql:quickload :cl-webkit)
(asdf:test-system "cl-webkit")

In-repo fixtures: tests/webkit-import/, tests/wpt-mini/.
Optional upstream LayoutTests import: set WEBKIT_LAYOUT_TESTS and run scripts/import-webkit-smoke.sh (not required for the default suite).


CI

GitHub Actions (.github/workflows/ci.yml) on main:

  1. Install SBCL + Quicklisp + cl-ppcre
  2. Symlink the checkout into ~/quicklisp/local-projects/cl-webkit
  3. Smoke-load the public API (render-html, compliance counts)
  4. Run run-tests.lisp (full suite; non-zero exit on failure)

Development

See CONTRIBUTING.md and AGENTS.md.


Security

See SECURITY.md. Report vulnerabilities privately to william@theesfeld.net.


License

MIT © William Theesfeld

WebKit is a trademark of Apple Inc. This project is not affiliated with Apple or the WebKit project.

About

WebKit browser engine rewritten in Common Lisp (SBCL)

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages