Xenia - Xorg/Xlibre X server porting project
Roman Vlasov
vlasovroman.ru at yandex.ru
Sun Sep 27 18:38:35 UTC 2026
On Sunday, 27 September 2026 at 14:46:37 UTC, H. S. Teoh wrote:
> On Sun, Sep 27, 2026 at 10:42:45AM +0000, Roman Vlasov via
> Digitalmars-d-announce wrote:
>> Hello everyone!
>> I want to present you my small pet project.
>>
>> In few word, its trying to port Xorg/XLibre X server from C to
>> Dlang.
>>
>> For more info see main GitHub page:
>> https://github.com/vlasovroman96/xenia
> [...]
>
> "Small"? "Pet project"?? Porting the entire Xorg X server does
> not sound like a "small pet project" in any sense of the word.
> :-D
>
> Nevertheless, I applaud your effort. In the long term, one
> would expect the code to have less vulnerabilities caused by
> C's deficiencies, such arrays decaying to pointers, etc.. But
> from the sounds of it, it's currently just a straight
> transliteration of C into D, so pretty much all of the problems
> with a C codebase would still be present. It will likely take
> significant effort to replace the C idioms with D idioms. I'd
> be very interested in the result, though, if you get there!
>
>
> --T
Thank you for your response!
Indeed, it is much more D-like-C than idiomatic D at the moment ;D
I originally chose the approach of “make it run first, refactor
later”.
I needed a working, runnable codebase so I could be sure that
further changes would not completely break the whole system.
From there, I plan to gradually move the codebase towards a more
idiomatic D style.
Even now, you can already see on small parts of the
protocol-related modules how much simpler the code becomes,
without losing anything in the process.
As an example of the absolute chaos in the structure of the
original X server, I can mention something that happened just
today: an incorrect monitor refresh rate setting caused crashes
in a GTK context menu (!!!). It simply refused to appear in the
XFCE4 window manager.
Or another example: in the Xdefs module, there were declarations
related to fonts, with a note suggesting that they should be
moved to Xos.
After moving them, the import paths for `DGAEvent`(!!!) broke .
*Yes, these are very closely related things.*
*Sarcasm.*
Things like this could easily sit in the C source code for years
(and they did), but moving to D has already started exposing the
*beauty* of the XOrg codebase from the very beginning.
And of course, this is also a great opportunity to show that D is
perfectly capable of handling serious systems programming.
I hope this helps explain some of the reasoning behind the
approach.
More information about the Digitalmars-d-announce
mailing list