www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Sciter for D

reply c-smile <andrew.fedoniouk gmail.com> writes:
I've almost done with D version of [Sciter](https://sciter.com) 
SDK.

![Sciter/D Hello 
World](https://sciter.com/wp-content/uploads/2026/05/d-hello-world.png)

Is it interesting to anyone in principle?

Just in case:

Sciter is an standalone and embeddable engine that includes:

* HTML5/CSS3 UI runtime;
* JS (QuickJS, ES6 compatible) with built-in native JSX, React'or 
and persistence.
* GPU accelerated rendering engine (over DX11/DX12, Metal, 
OpenGLES);
* OpenGLES implementation (and its JS version - WebGL):
   * Windows and MacOS - over built-in ANGLE;
   * Linux - native;

Platforms: Windows (XP...11, x32/x64 and ARM64), MacOS, Linux 
(over GTK4 or Wayland or X11, x64 and ARM64).

Sciter SDK for D provides:

* Access to Window and DOM trees;
* Ability to write in D native DOM element controllers;
* Ability to extend JS runtime by D resident functions and 
classes;
* Ability to control and handle in D all resource requests;
* Native access to Graphics API: Canvas-like 2D, OpenGLES;
May 14
next sibling parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On Thursday, 14 May 2026 at 20:56:22 UTC, c-smile wrote:
 I've almost done with D version of [Sciter](https://sciter.com) 
 SDK.

 Is it interesting to anyone in principle?
Yes, this does look interesting! Never heard of sciter before. Does this utilize the GC, or are you doing only manual resource management? -Steve
May 14
next sibling parent c-smile <andrew.fedoniouk gmail.com> writes:
On Thursday, 14 May 2026 at 21:08:36 UTC, Steven Schveighoffer 
wrote:
 On Thursday, 14 May 2026 at 20:56:22 UTC, c-smile wrote:
 I've almost done with D version of 
 [Sciter](https://sciter.com) SDK.

 Is it interesting to anyone in principle?
Yes, this does look interesting! Never heard of sciter before.
Sciter is used in production since 2007 when it first used as UI front end of Norton Antivirus. Since then quite a lot of customers have joined [the club](https://sciter.com/#customers).
 Does this utilize the GC, or are you doing only manual resource 
 management?
D app that utilizes Sciter UI frontend is a normal D application that uses its own GC and all other bells and whistles. That screenshot above is made of this file: ``` module dsciter; import sciter; import application = sciter.application; import archive = sciter.utils.archive; import std.stdio; // custom drawing controller demo import samples.drawingcontroller; //string html = "<html><body>Hello D!</body></html>"; static blob = cast(ubyte[]) import("resources.bin"); string DCompilerName() { version (DigitalMars) { return "DMD (Digital Mars D)"; } version (LDC) { return "LDC (LLVM-based D Compiler)"; } version (GNU) { return "GDC (GNU D Compiler)"; } } int main() { if(!application.start()) return -1; archive.open(blob); struct D { string name; int verMajor; int verMinor; } application.globalVar("Compiler", VALUE( D(DCompilerName(), __VERSION__ / 1000, __VERSION__ % 1000 ))); bool onClick() { writeln("mouse CLICK"); return false; } Window window = new Window(Window.AS_MAIN); //window.on(MOUSE_EVENT.TYPE.CLICK) = &onClick; window.on(MOUSE.CLICK).at("body") = (){ writeln("mouse CLICK"); return false;}; window.on(EVENT.CLICK).at("button#test") = (ref Element button){ writeln("CLICK on ", button.tag); return false;}; // load HTML // wnd.load( cast(ubyte[]) html ); // from literal HTML string window.load("this://app/index.htm"); // from archive based on resource blob // show it window.state = Window.STATE.SHOWN; // run message pump return application.run(); } ``` Where HTML (compiled in app body as archive at this://app/index.htm): ``` <html window-frame="extended" window-resizable="true" window-minimizable="true" window-maximizable="true" window-blurbehind="auto" theme="auto"> <head> <title>Sciter greets D lang!</title> <style> import url(sciter:window-chrome.css); body { margin:0; } h1, div { text-align:center; } dl { flow: row(dt, dd); border-spacing: 0.5em; text-align:start; width:max-content; margin:0 *; } dl > dt, dl > dd { width:max-content; } clock { behavior: custom-drawing-controller; // custom drawing ctl, see samples/drawingcontroller.d display:block; // like a <div> size:*; // spans whole available space } </style> <script> document.body.append(<dl> <header>Compiler</header> <dt>name:</dt> <dd>{Compiler.name}</dd> <dt>version:</dt> <dd>{Compiler.verMajor}.{Compiler.verMinor}</dd> <dt>test:</dt> <dd>{adder(10,32)}</dd> </dl>); </script> </head> <body> <h1>The D Clock</h1> <clock/> <div>Button to <button #test>Test</button></div> </body> </html> ``` And finally D resident controller of custom drawing element (the `<clock>`): ``` module drawingcontroller; import std.datetime; import std.datetime.systime; import std.utf; import core.stdc.stdio : sprintf; import sciter; const float PI = 3.1415926f; class DrawingController : ElementController { this(HELEMENT h) { super(h); } override void didStart() { startTimer(500, &this.onTick); } bool onTick() { self.requestPaint(); // will cause handleDraw() to be called return true; // keep timer ticking } override bool handleDraw(HELEMENT he, ref DRAW_EVENT evt) { if(evt.type != DRAW.CONTENT) return false; // we are drawing only content layer Graphics gfx = evt.gfx; // on this Graphics RECT area = evt.area; // in this area auto w = area.width; auto h = area.height; float scale = w < h? w / 300.0f: h / 300.0f; SysTime now = Clock.currTime(); // this time gfx.stateSave(); gfx.translate(area.left + w / 2.0f, area.top + h / 2.0f); gfx.scale(scale,scale); gfx.rotate(-PI/2); gfx.lineColor(0); gfx.lineWidth(8.0f); gfx.lineCap(LINE_CAP.ROUND); // Hour marks gfx.stateSave(); gfx.lineColor(rgba(0x32,0x5F,0xA2)); for (int i = 0; i < 12; ++i) { gfx.rotate(PI/6); gfx.line(137.0f,0,144.0f,0); } gfx.stateRestore(); // Minute marks gfx.stateSave(); gfx.lineWidth(3); gfx.lineColor(rgba(0xA5,0x2A, 0x2A)); for (int i = 0; i < 60; ++i) { if ( i % 5 != 0) gfx.line(143,0,146,0); gfx.rotate(PI/30.0f); } gfx.stateRestore(); // show current date { gfx.stateSave(); gfx.rotate(PI/2); char[20] buffer; int written = sprintf(buffer.ptr, "%04d-%02d-%02d",now.year,now.month,now.day); Text text = Text.createForElementAndStyle(toUTF16(buffer[0..written]), self, "font-size:10pt;color:brown"w ); gfx.draw(text, 0, 60, 5); gfx.stateRestore(); } uint sec = now.second; uint min = now.minute; uint hr = now.hour; hr = hr >= 12 ? hr - 12 : hr; // draw hours hand gfx.stateSave(); gfx.rotate( hr*(PI/6) + (PI/360)*min + (PI/21600)*sec ); gfx.lineWidth(14); gfx.lineColor(rgba(0x32,0x5F,0xA2)); gfx.line(-20,0,70,0); gfx.stateRestore(); // draw Minute hand gfx.stateSave(); gfx.rotate( (PI/30)*min + (PI/1800)*sec ); gfx.lineWidth(10); gfx.lineColor(rgba(0x32,0x5F,0xA2)); gfx.line(-28,0,100,0); gfx.stateRestore(); // draw Second hand gfx.stateSave(); gfx.rotate(sec * PI/30); gfx.lineColor(rgba(0xD4,0,0)); gfx.fillColor(rgba(0xD4,0,0)); gfx.lineWidth(6); gfx.line(-30,0,83,0); gfx.ellipse(0,0,10,10); gfx.noFill(); gfx.ellipse(95,0,10,10); gfx.stateRestore(); gfx.stateRestore(); return true; } } static this() { registerElementController!DrawingController("custom-drawing-controller"); // ^ for CSS: behavior: custom-drawing-controller; } ```
May 14
prev sibling parent reply Paolo Invernizzi <paolo.invernizzi gmail.com> writes:
On Thursday, 14 May 2026 at 21:08:36 UTC, Steven Schveighoffer 
wrote:
 On Thursday, 14 May 2026 at 20:56:22 UTC, c-smile wrote:
 I've almost done with D version of 
 [Sciter](https://sciter.com) SDK.

 Is it interesting to anyone in principle?
Yes, this does look interesting! Never heard of sciter before. Does this utilize the GC, or are you doing only manual resource management? -Steve
I remember "Terra Informatica"! They used to have a UI framework, called "Harmonia" made in D, and pretty impressive, we used it for sometimes in my previous company! Then they reverted back to C++ ... some history about that here: https://terrainformatica.com/2014/07/17/10-years-road-to-sciter/ /P
May 15
parent reply c-smile <andrew.fedoniouk gmail.com> writes:
On Friday, 15 May 2026 at 07:52:27 UTC, Paolo Invernizzi wrote:
 They used to have a UI framework, called "Harmonia" made in D, 
 and pretty impressive, we used it for sometimes in my previous 
 company!
Good memories, yeah :) Sciter has it roots at Harmonia/D, yes. But D was a moving target at that time so ... As of Sciter/D, progress is quite satisfactory. Spent some time tuning Sciter D SDK for a) LDC and b) MacOSX. This was built from exactly the same source sample: ![Hello D World](https://sciter.com/wp-content/uploads/2026/05/d-hello-world-osx.png) Conceptually Sciter is close to Electron (or any other webview based UI solution) but with major differences: * Sciter is made with embedability in mind: it means that the app can expose its API to UI layer (Sciter presenting HTML/CSS) in most natural way: ```D int adder(int a, int b) { return a + b; } application.globalVar("adder", VALUE(&adder)); ``` And JS can use it naturally as its own built-in: ``` let theAnswer = adder(10,32); ``` JS, as a language-behind-UI, is quite convenient by its flexibility and married with D (app core logic) creates near the ideal pair as for me.
May 15
parent reply Kapendev <alexandroskapretsos gmail.com> writes:
On Friday, 15 May 2026 at 16:48:10 UTC, c-smile wrote:
 Sciter has it roots at Harmonia/D, yes. But D was a moving 
 target at that time so ...
Looks cool.
May 15
parent c-smile <andrew.fedoniouk gmail.com> writes:
On Friday, 15 May 2026 at 17:14:18 UTC, Kapendev wrote:
 Looks cool.
And the same app is on Linux / Ubuntu: ![Hello D and Inspector](https://sciter.com/wp-content/uploads/2026/05/Screenshot-From-2026-05-15-18-30-09-scaled.png) On the right side is *inspector* app from Sciter SDK - inspects DOM/CSS/resources and JS debugger.
May 15
prev sibling next sibling parent Vladimir Marchevsky <vladimmi gmail.com> writes:
On Thursday, 14 May 2026 at 20:56:22 UTC, c-smile wrote:
 Sciter SDK for D provides:

 * Access to Window and DOM trees;
 * Ability to write in D native DOM element controllers;
 * Ability to extend JS runtime by D resident functions and 
 classes;
 * Ability to control and handle in D all resource requests;
 * Native access to Graphics API: Canvas-like 2D, OpenGLES;
Sounds great. Having some quick, cross-platform, easy to start and nice looking GUI but also customizable under the hood later is something that D misses for everyday programming, IMO. Closest are webviews but they have their twists and limitations.
May 14
prev sibling next sibling parent reply Lance Bachmeier <no spam.net> writes:
On Thursday, 14 May 2026 at 20:56:22 UTC, c-smile wrote:

 Sciter SDK for D provides:

 * Access to Window and DOM trees;
 * Ability to write in D native DOM element controllers;
 * Ability to extend JS runtime by D resident functions and 
 classes;
 * Ability to control and handle in D all resource requests;
 * Native access to Graphics API: Canvas-like 2D, OpenGLES;
I saw Sciter mentioned many times when I was looking for an alternative to Electron. I will definitely be interested in trying it out when it's released.
May 16
parent reply c-smile <andrew.fedoniouk gmail.com> writes:
On Saturday, 16 May 2026 at 15:21:50 UTC, Lance Bachmeier wrote:
 ... I will definitely be interested in trying it out when it's 
 released.
I've published [Sciter v 6.0.4.0](https://gitlab.com/sciter-engine/sciter-js-sdk/-/releases) with [sciter+/D/ sample and pure D SDK](https://gitlab.com/sciter-engine/sciter-js-sdk/-/tree/main/sciter+/D?ref_type=heads). To build sciter.d "Hello D World" demo use one of build-*** scripts in sciter+/D/ folder. sciter.dll|dylib|so has to be in the same folder as exe that uses it. So scrips place dsciter.exe in corresponding sdk/bin/ folders. If you want to inspect DOM of the app start inspector.exe before running the demo. There is a usciter executable in main SDK that is a demo browser allowing to load and play with sdk/samples***. See also [Sciter DOM and OM documentation](https://docs.sciter.com/docs/intro).
May 16
parent reply Serg Gini <kornburn yandex.ru> writes:
On Sunday, 17 May 2026 at 03:23:21 UTC, c-smile wrote:
 To build sciter.d "Hello D World" demo use one of build-*** 
 scripts in sciter+/D/ folder.

 sciter.dll|dylib|so has to be in the same folder as exe that 
 uses it. So scrips place dsciter.exe in corresponding sdk/bin/ 
 folders.
I've managed to build it on macOS. To make hellod working I had to copy sciter folder to the demos/hellod folder (otherwise it was not able to find "import sciter;")
May 21
parent c-smile <andrew.fedoniouk gmail.com> writes:
On Thursday, 21 May 2026 at 09:39:16 UTC, Serg Gini wrote:
 I've managed to build it on macOS. To make hellod working I had 
 to copy sciter folder to the demos/hellod folder (otherwise it 
 was not able to find "import sciter;")
My pardon, [fixed now](https://gitlab.com/sciter-engine/sciter-js-sdk/-/commit/5d07936bb165670708731b4473d17e0932d7d395)
May 21
prev sibling parent c-smile <andrew.fedoniouk gmail.com> writes:
On Thursday, 14 May 2026 at 20:56:22 UTC, c-smile wrote:
 I've almost done with D version of [Sciter](https://sciter.com) 
 SDK.
Published Sciter SDK v 6.0.4.1 with new options for Sciter+/D: * new [sciter.om.Promise](https://gitlab.com/sciter-engine/sciter-js-sdk/-/blob/main/sciter+/D/sciter/om/value.d?ref_t pe=heads#L202-L244) - this allows to define [async functions in D](https://gitlab.com/sciter-engine/sciter-js-sdk/-/blob/main/sciter%2B/D/dsciter.d?ref type=heads#L26-L48) so JS can [await for results](https://gitlab.com/sciter-engine/sciter-js-sdk/-/blob/main/sciter%2B/D/res/index.htm ref_type=heads#L52) without blocking the UI. * demo of calling JS function from D; * demo of calling D function from JS; Updated dsciter.d application running on W10 this time: ![Sciter/D Hello World on Windows 10](https://sciter.com/wp-content/uploads/2026/05/d-clock-6.0.4.1.jpg) Among other things sciter.dll contains: * JS persistence engine (see my [QuickJS++ variant](https://github.com/c-smile/quickjspp)) - NoSQL DB (30k in binary), similar to MongoDB; * libuv with TLS extensions; * zlib, libpng, libjpeg, libWebP; * windowless version of Sciter Engine - allows to render HTML/CSS on bitmaps and OpenGLES contexts (e.g. in games). * Unicode primitives. I am not sure if it makes to expose these as separate entities available for D directly.
May 19