dmd support for IDEs + network GUI
Adam D. Ruppe
destructionator at gmail.com
Tue Oct 20 19:38:17 PDT 2009
On 10/20/09, Nick B <nickB at gmail.com> wrote:
> Re your use of a binary protocol.
>
> Perhaps instead of re-inventing the wheel,
Eh, my code is already written and works. One of the advantages to my
code generator reading a C like syntax is that I might be able to
fully automate porting some existing APIs down the wire - I'm
particularly looking at OpenGL, or at least a subset of it, to work
with ease. Another one is porting my generator to a new language is easy
- I already know the code and it is fairly simple anyway.
Anyway, quickly skimming through the google page, their system isn't
bad (Coincidentally, it and I encode unsigned ints and strings in
exactly the same way! Cool.), but I don't think there's much to gain
by me switching to it. Though, their signed varint algorithm is pretty
elegant; I might have to use that.
And it reminds me that I didn't even consider optional arguments on
functions. Trivial to implement though, even compatible with my
current protocol: if message length is shorter than what you expect,
use default values for the rest of the arguments. This means they'd
have to be at the end, but you expect that from C like functions
anyway.
> It is also worthwhile reading the section called "A bit of history".
I thought about future compatibility, which is why my protocol has a
length field on every message. If you read the length and the function
number and find it isn't something you know, you can simply skip past
the whole message and carry on.
The ugliness might be that future functions deprecate old functions...
if this took off and was widely used, it might end up looking like
Win32 in 10 years (CreateWindow() nope, CreateWindowEx()!), but I'm ok
with that.
> One more point. What, if any, library to you plan to use ?
The D side is all custom code (I've written various libraries and
helper tools over the years for myself - the big one used here is a
network manager thing that handles incoming connections and output
buffering) and Phobos - nothing third party there. I'm using D2, but
there's nothing preventing it from being backported to D1 at some
point. I actually want to do a DMDScript port that speaks it too, but
that's way down the line.
For the viewer, my current implementation is C++ with Qt. I'd like to
actually do various viewers, including ones with less fat dependencies
(asking users to download Qt just to run it is a bit heavy), but for
now, I just wanted something I could start using immediately without
too much trouble for me. Qt on C++ works pretty well across platforms,
and I already know how to use it, so it was an easy choice for early
stages.
>
> cheers
> Nick B
>
Thanks!
-Adam
More information about the Digitalmars-d
mailing list