January 30, 2015

DerelictUtil 1.9.1

Having used the new SharedLibVersion stuff in DerelictUtil myself for a bit now, I’ve realized the need for a particularly useful enhancement.

If a loader does not support loading based on SharedLibVersion, attempting to do so will trip a compile-time assert. I don’t want users to be confused, having not yet read the docs I haven’t yet written, if they find their apps failing to load older versions of a lib in the wild even though they specified the minimum version to load. Because that’s exactly what would happen. Say, for example, you tell DerelictGLFW3 that you’re perfectly fine with release 1.1.x (which supports GLFW 3.1) going ahead and loading GLFW 3.0.x. The loader would silently ignore your request and fail to load any 3.0.x shared libraries. Now, you’ll get an assert message telling you that the loader does not support SharedLibVersion. I assume you all develop with asserts on like I do.

This brings me one step closer to a 2.0 release of the package. Please keep in mind that I may add, remove or change things in the 1.9.x series before I declare 2.0. If you’re using the new SharedLibVersion stuff and it’s working for you, please let me know. I’m sure you’ll let me know if it isn’t.

January 24, 2015

Support for GLFW 3.1 in Derelict

I’ve added support for GLFW 3.1 to DerelictGLFW3. To make use of it, use “derelict-glfw3″: “~>1.1.0″ as your DUB dependency. If  you don’t yet need the new functions and want to continue working with GLFW 3.0, then make sure your DUB dependency is “~>1.0.0″ and not “>=1.0.0″. The former will make sure you only pick up updates to the 1.0.x series, whereas the latter will update you with 1.1.0 if you run dub upgrade. Of course, specifying specific versions is always safe (“==1.0.0″ or “==1.0.1″), but doesn’t give you any updates. The 1.0.x branch has been quite stable, though, so using “==” shouldn’t hurt you at all.

I may add support for SharedLibVersion to DerelictGLFW3 at some point, but right now I have no plans to do so. Pick the version of GLFW3 you want to use and make sure you use the appropriate dependency version so that you aren’t trying to load a 3.0 DLL with the 3.1 binding.

January 21, 2015

DerelictCEF – Binding to Chromium Embedded Framework

I recently found myself wanting to play around with the Chromium Embedded Framework. I wanted to use it from D, of course, but no bindings exist for it that I’m aware of. So I did what I always do in that situation and created one.

DerelictCEF is a binding to the C API of CEF. I’m not about to try a dynamic binding to any C++ API any time soon. Unfortunately, the C API is not for the faint of heart. It requires a good deal of boilerplate, uses the ugly_underscored_functions_names that didn’t used to bother me until I started regularly using D, and has a plethora of struct types full of function pointers. Worse, the documentation on the C API is scattered and scarce AFAICT.

I’ve added the binding to DerelictOrg and the DUB registry (“derelict-cef”: “>=0.0.1″) for anyone who wants to give it a spin. But be forewarned: don’t expect too much help from me at this point. I’ve never used CEF before I implemented this binding. So far, all I’ve done is grabbed the CEF binaries, taken the sample C code from this github project (something anyone who wants to try DerelictCEF should study) and slapped something sloppily together in D to verify that the binding works on Windows. I’ve uploaded a screenshot to imgur for your viewing pleasure.

I’ll be playing around with this off and on when the whim strikes me, so I’ll be able to kick the tires a bit and look for issues, but I’m sure I won’t be getting anywhere near full coverage. At some point, I’ll boot into my Linux partition and make sure it compiles and runs there. If someone else gets there first, please let me know. I’d also love to hear the same about Mac. Eventually, when I’m more familiar with CEF and confident the binding is doing what it’s supposed to do, I’ll tag a 1.0.0 release.

In the meantime, I highly recommend that if you aren’t familiar with CEF or aren’t willing to put the time investment into learning how to use it, that you stay away from DerelictCEF for now. If you don’t know CEF have a limited knowledge of C, you’re going to be asking for trouble. I’m currently learning my way around the API and until I know what I’m doing, I’m just unable to help anyone else with it. I can already see that this is something that’s going to require more documentation than any other Derelict package. Until I’m able to write it, consider this as being for the experienced and adventurous only.

I’m really looking forward to playing with this.

January 16, 2015

I have made a code editor and I called it...

I have made a code editor and I called it “deadcode”. It is still in alpha but slowly approaching release worthiness.

It was my new years resolution for 2014 to finally scratch this itch and at the same time have some fun programming in the D programming language. This is not my first endeavor with D e.g. I have contributed a bit to the D standard library previously. Anyway, I settled on doing an unofficial release each month with release notes and uploads of the editor binary to a server for download without announcing it. Forcing this meant that each month I had a stable version and did not start too many “dev drain” features at a time.

This is a list of features in the editor I plan to blog about in the time to come: 

  • Custom commands
  • CSS alike styling with transitions support
  • Extensions
  • The dub extension
  • The nogc extension
  • The unittest extension
  • AST for D code

The editor itself is very bare bone and it is the extensions that makes it into something. For this reason I have focused on making extensions easy and trying to keep iteration time low. I borrowed a couple of ideas from the Unity3D API that you might notice.

Extensions are created in D inside the editor itself. The video is showing how to create a basic command extension in D using the editor itself and also a short look at the semantic features.

There is no public release yet but feedback and suggestions are appreciated anyway either as blog comments or in the D language forum.