Jump to page: 1 2
Thread overview
slint GUI, for RUST, C++, nodejs, dotnet. cloud add Dlang support
Oct 13, 2023
d007
Oct 13, 2023
ryuukk_
Oct 13, 2023
d007
Oct 14, 2023
Tobias Hunger
Oct 14, 2023
Tobias Hunger
Oct 14, 2023
d007
Oct 14, 2023
Tobias Hunger
Oct 14, 2023
d007
Oct 14, 2023
Tobias Hunger
Oct 14, 2023
d007
Oct 18, 2023
Martyn
October 13, 2023

https://github.com/slint-ui/slint

slint UI support desktop and embed device, and mobile device in future.

There is a c# https://github.com/microhobby/slint-dotnet compiler implement, maybe sone one is capable to translate this into dlang ?

October 13, 2023

On Friday, 13 October 2023 at 12:44:57 UTC, d007 wrote:

>

https://github.com/slint-ui/slint

slint UI support desktop and embed device, and mobile device in future.

There is a c# https://github.com/microhobby/slint-dotnet compiler implement, maybe sone one is capable to translate this into dlang ?

I don't understand why slint is popular, it's one of the worst library out there, and it uses a custom scripting language

Just look at the generator, it's very basic: https://github.com/microhobby/slint-dotnet/blob/main/SlintDotnet/Generator.cs

The resulting API however.. very ugly: https://github.com/microhobby/slint-dotnet/blob/main/test/Program.cs

Can't really call this a binding

If you do embedded work, I suggest lvgl (no scripting, so you can fully make use of powerful D's capabilities): https://github.com/lvgl/lvgl in pure C

October 13, 2023

On Friday, 13 October 2023 at 15:09:27 UTC, ryuukk_ wrote:

>

I don't understand why slint is popular, it's one of the worst library out there, and it uses a custom scripting language

Just look at the generator, it's very basic: https://github.com/microhobby/slint-dotnet/blob/main/SlintDotnet/Generator.cs

The resulting API however.. very ugly: https://github.com/microhobby/slint-dotnet/blob/main/test/Program.cs

Can't really call this a binding

If you do embedded work, I suggest lvgl (no scripting, so you can fully make use of powerful D's capabilities): https://github.com/lvgl/lvgl in pure C

lvgl is great.

I guess slint is used to tanslate target language. for example we translate vide.d template into dlang source code, then pass to dmd compile.

Slint allow us use live preview to design the UI, and generate execute binary direct from target language code. this can guaranteed the best performance and flexibility, and the results binary size is also very small (if we use betterC for this case).

for example a slint c++ project result around 200KB binary.

October 14, 2023

I stumbled into this thread on Google, I have tried D about a decade ago but did not stick around. I do contribute to slint though.

On Friday, 13 October 2023 at 15:09:27 UTC, ryuukk_ wrote:

> >

There is a c# https://github.com/microhobby/slint-dotnet compiler implement, maybe sone one is capable to translate this into dlang ?

There are also C++ and JS bindings. Especially the C++ one is further along.

>

I don't understand why slint is popular, it's one of the worst library out there, and it uses a custom scripting language

What makes you say so?

I consider the description language to be a huge plus: It allows us to have a design tool, a live preview and allows non-programmers to design and update the UI. That code is compiled into native code (rust, c++, ...), using a small runtime library written in rust. Nothing gets interpreted (well, we do have an interpreter, too).

It is not a scripting language on purpose, more a description language. Think more HTML than JS. https://slintpad.com/ has an online editor if you want to play with it.

Basically you describe the UI and an interface into the host language (properties, functions and callbacks). As long as that interface does not change, a dev can not break the UI and a UI designer can not break the business logic. I love that part:-)

>

Just look at the generator, it's very basic: https://github.com/microhobby/slint-dotnet/blob/main/SlintDotnet/Generator.cs

The resulting API however.. very ugly: https://github.com/microhobby/slint-dotnet/blob/main/test/Program.cs

That code has a lot of code in there demoing all kinds of things you will typically not do in an application. A typical application usually creates the UI, sets a few properties and callbacks to bind the business logik to the UI and then calls run().

>

Can't really call this a binding

I was very impressed by it: It works(TM) and was done by one person without involving anyone from the core team in a few weeks.

October 14, 2023

PS: The generator code linked above just "renders" out the compilation results into c# code. The slint compiler does the heavy lifting in the background.

That is what you need to support a new language. We would then build a nicer facade in the supported language around that.

October 14, 2023

On Saturday, 14 October 2023 at 08:58:23 UTC, Tobias Hunger wrote:

>

PS: The generator code linked above just "renders" out the compilation results into c# code. The slint compiler does the heavy lifting in the background.

That is what you need to support a new language. We would then build a nicer facade in the supported language around that.

Thanks for the explain.

Correct me if I am wrong.

The Slint c++ version not need link into any object binary generate by rust ? (or need link into a static library build from rust?)

October 14, 2023

On Saturday, 14 October 2023 at 11:32:56 UTC, d007 wrote:

>

Correct me if I am wrong.

The Slint c++ version not need link into any object binary generate by rust ? (or need link into a static library build from rust?)

The slint code is turned into C++ code. That code calls into a small runtime library written in Rust. That library exposes a classic C-style interface.

There is more c++ code that provides C++ types to conveniently work with the generated code, which either wraps more of that rust library or just re-implements parts of it in c++.

October 14, 2023

On Saturday, 14 October 2023 at 11:52:00 UTC, Tobias Hunger wrote:

>

The slint code is turned into C++ code. That code calls into a small runtime library written in Rust. That library exposes a classic C-style interface.

There is more c++ code that provides C++ types to conveniently work with the generated code, which either wraps more of that rust library or just re-implements parts of it in c++.

Thanks for explain.

I believe Slint will work for D as well as C++. D is able to call C-style interface function direct, and has a great type system to work with rust type.

October 14, 2023

On Saturday, 14 October 2023 at 15:19:46 UTC, d007 wrote:

>

I believe Slint will work for D as well as C++. D is able to call C-style interface function direct, and has a great type system to work with rust type.

Everything is able to call C-style interface functions:-)

Getting some basic support rolling should be very doable in dlang (but again, I looked into D about a decade ago and never used it beyond toy applications). The challenge is going beyond the basic support, building something that feels native to dlang developers.

October 15, 2023
On 15/10/2023 4:32 AM, Tobias Hunger wrote:
> Everything is able to call C-style interface functions:-)
> 
> Getting some basic support rolling should be very doable in dlang (but again, I looked into D about a decade ago and never used it beyond toy applications). The challenge is going beyond the basic support, building something that feels native to dlang developers.

It'll be worth looking at gtkd as they generate D bindings + wrapper for gtk. Which appears to be pretty much what you're trying to do.

https://github.com/gtkd-developers/GtkD
« First   ‹ Prev
1 2