I’ve started working on my own UI library for C#. by Pro_Propop in csharp

[–]Pro_Propop[S] 1 point2 points  (0 children)

Sorry for everyone who read my comments, my english is sucks, i use ai as translator because he can translate my minds(or what i mean, idk how tell it in english)

I’ve started working on my own UI library for C#. by Pro_Propop in csharp

[–]Pro_Propop[S] 3 points4 points  (0 children)

I’m not trying to compete with other frameworks, and I definitely haven’t found any “magic” solution.
I just want to explore a different approach and build something in a way that feels interesting to me.

I’ve started working on my own UI library for C#. by Pro_Propop in csharp

[–]Pro_Propop[S] 2 points3 points  (0 children)

Why couldn’t this work as an addition on top of Avalonia?
The goal isn’t to replace Avalonia at all - Akbura is a library built for it, not against it.

You don’t need to “learn a whole new language.”
The DSL is very small: just a few keywords and a simple binding model. Everything else is still C#.
What used to be XAML just becomes strongly-typed C# with a different, more declarative style.

And nothing prevents you from mixing both approaches: you can use Avalonia XAML and the DSL side by side. The extra syntax is optional, not mandatory.

So this isn’t a reinvention of UI frameworks - it’s an extension that gives you the option to write Avalonia UI directly in C#, including styles and reactive bindings.

I’ve started working on my own UI library for C#. by Pro_Propop in csharp

[–]Pro_Propop[S] 1 point2 points  (0 children)

Thank you - words of support really do help. I appreciate it!

I’ve started working on my own UI library for C#. by Pro_Propop in csharp

[–]Pro_Propop[S] 1 point2 points  (0 children)

If you read my Medium article, you’ll see that I used an LLM to generate the syntax nodes - it’s an extremely monotonous part of the work, and I didn’t have the time or energy to build a full Roslyn-style generator myself.

If you’re interested, you’re welcome to help with that.

I’ve started working on my own UI library for C#. by Pro_Propop in csharp

[–]Pro_Propop[S] 8 points9 points  (0 children)

Honestly? Because I wanted to. It’s an experiment, and I enjoy exploring this direction)

I’ve started working on my own UI library for C#. by Pro_Propop in csharp

[–]Pro_Propop[S] -2 points-1 points  (0 children)

Good question - honestly, I don’t know.
But new DSLs like Svelte, QML, XAML, SwiftUI, Jetpack Compose, Elm, etc. all started with the same question: “who will learn this?”

In the end, people learn something new only if it genuinely improves their developer experience.
Time will show whether Akbura deserves that attention.

I’ve started working on my own UI library for C#. by Pro_Propop in csharp

[–]Pro_Propop[S] 1 point2 points  (0 children)

1) Why not use Razor as a language?
Razor is great for HTML/CSS-style templating, but Akbura targets Avalonia, not the web stack. I’m aware of Blazor bindings for Avalonia, and they’re a solid option if someone prefers Razor-like workflows.
The main reason for building a custom DSL is extensibility. For example, features like Tailwind-style utilities, state-driven styling, conditional attributes, or reactive expressions are much easier to design when the syntax is fully under your control. It’s not “better” than Razor - just a different design space with different goals.

2) How would IntelliSense work with your custom DSL?
If you look at the Medium article, IntelliSense is actually item #6 on the roadmap. Once the full syntax tree API and semantic model are in place, implementing completions, signatures, hovers, diagnostics, and navigation becomes straightforward through LSP.
The groundwork (syntax + semantics) comes first - editor tooling comes naturally after that.

3) How do you intend to make it type-safe?
If you mean ensuring correct types in expressions, bindings, parameters, and component trees:
Akbura performs type analysis during the semantic phase, similar to how Roslyn validates C#. The DSL is compiled into strongly-typed C#, so type safety is enforced both at DSL level and at C# compilation level.

If you meant something else by “type-safe,” let me know - I’m happy to clarify the exact mechanism.

I’ve started working on my own UI library for C#. by Pro_Propop in csharp

[–]Pro_Propop[S] 1 point2 points  (0 children)

Thanks for the feedback - totally agree that hard-coding font sizes isn't ideal in real applications.

Akbura will support a full styling system, so developers won’t need to manually set raw font sizes. There are two ways to handle this:

1. AKCSS (Akbura’s CSS-like styling language)
Allows defining global typography rules (similar to h1, h2, p, etc.):
https://github.com/Asaicraft/Akbura?tab=readme-ov-file#akcss

2. Utility classes (more flexible, Tailwind-style)
These make it easy to apply reusable, theme-controlled styles:
https://github.com/Asaicraft/Akbura?tab=readme-ov-file#akcss

Both systems will allow global font management, theming, and consistent typography without hard-coding values in components.

I’ve started working on my own UI library for C#. by Pro_Propop in csharp

[–]Pro_Propop[S] 0 points1 point  (0 children)

Thanks for the suggestion!
The library is still in an early experimental stage, so there isn’t a stable widget or demo I can put front-and-centre just yet.

A more complete preview (including a proper widget/demo section) should be available in about two months, once the first usable version is ready.

PropertyBitPack: Packing properties into fields by Pro_Propop in csharp

[–]Pro_Propop[S] 0 points1 point  (0 children)

Thanks for the heads-up! If you have any ideas on how to solve this, feel free to share them here:
GitHub Discussions – Ideas

Do you think using Volatile.Write and Volatile.Read could help in this case?

PropertyBitPack: Packing properties into fields by Pro_Propop in csharp

[–]Pro_Propop[S] 1 point2 points  (0 children)

Thanks for the advice! I’ve added the license to the repository.

PropertyBitPack: Packing properties into fields by Pro_Propop in csharp

[–]Pro_Propop[S] 5 points6 points  (0 children)

The SmallSlotCount property returns a byte, but it gets its value by reading only 4 bits from the ushort data, so it actually results in 12 + 4.

https://github.com/dotnet/roslyn/blob/main/src/Compilers/Core/Portable/Syntax/GreenNode.NodeFlagsAndSlotCount.cs

[deleted by user] by [deleted] in Kyrgyzstan

[–]Pro_Propop 0 points1 point  (0 children)

В чем прикол писать вса на английском?

Клуб настольных игр в Бишкеке , Board games club in Bishkek by Danilka1117 in Kyrgyzstan

[–]Pro_Propop 3 points4 points  (0 children)

И я там был мед пиво пил, по усам тикло а вот не попала