djs: the LDC 1.43.0 frontend ported to TypeScript (preview)
Paolo Invernizzi
paolo.invernizzi at gmail.com
Wed Oct 14 05:38:55 UTC 2026
I've been porting the frontend of LDC 1.43.0 to TypeScript:
lexer, parser, semantic analysis, CTFE, ImportC, Ddoc, -vcg-ast
and -X. It runs in-process in Node, no code generation.
https://github.com/DeepGlance/djs
On the DMD test suite shipped with LDC it gives ldmd2's exit
status, stdout and stderr byte for byte, and every module of
druntime and Phobos compiles with the same output, -vcg-ast
included. The import tree is bundled, so there's nothing to
install besides Node 22.
Why: a VS Code extension that compiles in a worker thread, with
hover, go to definition, completion, semantic tokens and inlay
hints answered by the real frontend, no language server. That one
is coming shortly.
Limits: macOS arm64 and Linux hosts only, DMD-style x86 asm is
skipped with a warning (licence reasons, see LICENSE), it's 10x
slower than ldmd2 and hungry on memory. It's a preview, 0.1.0.
About the AI discussion in the other thread: the port was done
with Claude agents, whole files at a time, against a written
guide, with the test suite as the judge. I think this is the kind
of AI work that pays for everybody, including who doesn't want AI
anywhere near their editor: there's no model in djs or in the
extension, it's the same D, the same frontend and the same
diagnostics as LDC, Boost licensed. The guide is in docs/porting,
if someone wants to apply the same method to other pieces of the
D house.
Feedback welcome, especially from anyone who tries it on Linux,
which I couldn't test against an ldc2 here.
/P
More information about the Digitalmars-d-announce
mailing list