+++ date = '2015-04-01' title = 'D Language' tags = ["dlang", "linux", "web", "contributions"] +++ The [D language](https://dlang.org) is a recent language very similar to C++ in term of features, but with a cleaned syntax and better compile-time features. I like the D language because it makes possible to write nice and robust applications within a very short time. Here are some small projects I have done using D: ## Served {{< cinema path="/images/posts/served-*.*" >}} Served is a __lightweight file-sharing web service__ (a bit like _Google Drive_) written using the web server library [vibe.d](https://vibed.org). It is designed to be __quickly deployed__ as a __web file server__ that can also be used to __upload files__ to a directory. Its default configuration serves the folder given by command line and uses UNIX users/passwords (via __PAM Authentification__) to upload/view files respecting file permissions. By default, the file named `index.md` gets rendered atop of the file list. ### More - Source code: https://github.com/CromFr/Served - Design: + Bootstrap + JQuery + Markdown rendering with Showdown + Interfacing D lang. with C library (PAM) ## NWN2 Log web access {{< cinema path="/images/posts/nwnlog-*.*" >}} The goal was to provide a common __web interface__ to __browse and search log__ entries written by the Neverwinter Nights 2 server _La Colère d'Aurile_. These entries are written in different files/databases, use different syntaxes and timestamps relative to different time zones. The log viewer has been written to be as easy as possible to extend and maintain: If you want to add a log page, you just have to write a class. The menus, interface, search parameters, the instantiation are __auto-generated at compile time__. ### More - Source code: https://github.com/CromFr/NWNLogViewer - Design + REST API generating Json data + Search & data-binding using AngularJS + Much code generation using D meta-programming features ## NWN2 GUI viewer {{< cinema path="/images/posts/nwnlog-*.*" >}} Neverwinter Nights 2 lacks of third applications. This one __renders NWN2 GUI__ without launching the whole game, and updates itself on file change. It allows developers to write the XML GUI code with their favourite editor, while seeing the result in real time in another window, with extra debugging information that NWN2 doesn't provide. Right now it has some quirks on text alignment and font handling, but the result is still close to the in-game rendering. ### More - Source code: https://github.com/CromFr/NWNGuiViewer - Design: + GTK 3 with GTKD wrapper for D lang. + Hand-made XML parser ## Phobos Phobos is the standard library of the D language. I have fixed a couple of bugs in the library, and I am looking to fix more of them in the future :).