DMD's lexer available on code.dlang.org
I've created a dub package for the D version of DMD's lexer, generated automatically from the C++ source. github: https://github.com/yebblies/ddmd dub: http://code.dlang.org/packages/ddmd There are a few annoying limitations, such that it uses dmd's error printing and allocation functions, and requires configuration through 'global'. Here is an example program that uses the lexer: == import std.stdio; import std.file; import ddmd.tokens; import ddmd.lexer; / void main() { Lexer.initLexer(); string data = "void blah() {} // stuff"; auto l = new Lexer("myfile", data.ptr, 0, data.length, 0, 0); l.nextToken(); do { printf("token: %s\n", l.token.toChars()); } while (l.nextToken() != TOKeof); } == Prints: token: void token: blah token: ( token: ) token: { token: }
Re: DMD's lexer available on code.dlang.org
On 5/01/2015 2:07 a.m., Daniel Murphy wrote: I've created a dub package for the D version of DMD's lexer, generated automatically from the C++ source. github: https://github.com/yebblies/ddmd dub: http://code.dlang.org/packages/ddmd There are a few annoying limitations, such that it uses dmd's error printing and allocation functions, and requires configuration through 'global'. Here is an example program that uses the lexer: == import std.stdio; import std.file; import ddmd.tokens; import ddmd.lexer; / void main() { Lexer.initLexer(); string data = "void blah() {} // stuff"; auto l = new Lexer("myfile", data.ptr, 0, data.length, 0, 0); l.nextToken(); do { printf("token: %s\n", l.token.toChars()); } while (l.nextToken() != TOKeof); } == Prints: token: void token: blah token: ( token: ) token: { token: } I saw that. I'm really looking forward to getting my teeth into it and doing some good old refactoring. Although that will be a while because of the auto generated thing.
Re: DMD's lexer available on code.dlang.org
"Rikki Cattermole" wrote in message news:m8be2m$1dlp$1...@digitalmars.com... I saw that. I'm really looking forward to getting my teeth into it and doing some good old refactoring. Although that will be a while because of the auto generated thing. There's plenty of refactoring to be done on the C++ side too.
Re: DMD's lexer available on code.dlang.org
On Sunday, 4 January 2015 at 13:07:34 UTC, Daniel Murphy wrote: I've created a dub package for the D version of DMD's lexer, generated automatically from the C++ source. github: https://github.com/yebblies/ddmd dub: http://code.dlang.org/packages/ddmd There are a few annoying limitations, such that it uses dmd's error printing and allocation functions, and requires configuration through 'global'. Here is an example program that uses the lexer: == import std.stdio; import std.file; import ddmd.tokens; import ddmd.lexer; / void main() { Lexer.initLexer(); string data = "void blah() {} // stuff"; auto l = new Lexer("myfile", data.ptr, 0, data.length, 0, 0); l.nextToken(); do { printf("token: %s\n", l.token.toChars()); } while (l.nextToken() != TOKeof); } == Prints: token: void token: blah token: ( token: ) token: { token: } (sorry if you get this question too often) How is DDMD as a whole going? Is it getting closer or are ongoing DMD changes slowing it down too much? Anyway, great to have the lexer on DUB, not going to use if for now because I expect there to be changes, but I guess it may eventually be useful for writing tools.
Re: DMD's lexer available on code.dlang.org
"Kiith-Sa" wrote in message news:nffxogzwpmayydyom...@forum.dlang.org... (sorry if you get this question too often) How is DDMD as a whole going? Is it getting closer or are ongoing DMD changes slowing it down too much? It's been sitting still for 8 nearly months because of https://github.com/braddr/d-tester/issues/39 and https://github.com/braddr/d-tester/issues/40 I don't mind getting asked, I just wish the answer would change. Anyway, great to have the lexer on DUB, not going to use if for now because I expect there to be changes, but I guess it may eventually be useful for writing tools. Hopefully lots of changes.
Re: GCCJIT Bindings for D
On Saturday, 27 December 2014 at 09:53:42 UTC, Iain Buclaw wrote: For a more practical example, I've added an example jit compiled brainf*** interpreter. https://github.com/ibuclaw/gccjitd/blob/master/tests/brainf.d Another practical example has been published which implements a made up toy language using the gccjitd library as a backend. Using a vistor class to split backend and frontend was shamelessly borrowed from DMD. :) https://github.com/ibuclaw/gccjitd/tree/master/tests/toy This I plan to be the last example that will be pushed in. Regards Iain.
Bindings for libmRSS: for parsing, writing and creating RSS/ATOM files or streams.
https://github.com/Laeeth/d_rss/ d_rss: D Programming Language bindings for libmRSS. http://www.autistici.org/bakunin/libmrss/doc/ mRss is a C library written by Andrea Marchesini for parsing, writing and creating RSS/ATOM files or streams. This library supports: RSS 0.91 - http://my.netscape.com/publish/formats/rss-spec-0.91.html RSS 0.92 - http://backend.userland.com/rss092 RSS 1.0 - http://web.resource.org/rss/1.0/ RSS 2.0 - http://www.rssboard.org/rss-specification ATOM 0.3 - http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html ATOM 1.0 - http://tools.ietf.org/html/rfc4287
Re: DMD's lexer available on code.dlang.org
On 2015-01-04 14:07, Daniel Murphy wrote: I've created a dub package for the D version of DMD's lexer, generated automatically from the C++ source. This is very cool :), keep up to good work. -- /Jacob Carlborg
Re: DMD's lexer available on code.dlang.org
I've created a dub package for the D version of DMD's lexer, generated automatically from the C++ source. very cool. on a related note, have you considered sharing your translation tool (c++ -> D)? I completely understand if you would rather not of course. Laeeth.
Re: DMD's lexer available on code.dlang.org
On Sunday, 4 January 2015 at 17:27:57 UTC, Daniel Murphy wrote: "Kiith-Sa" wrote in message news:nffxogzwpmayydyom...@forum.dlang.org... (sorry if you get this question too often) How is DDMD as a whole going? Is it getting closer or are ongoing DMD changes slowing it down too much? It's been sitting still for 8 nearly months because of https://github.com/braddr/d-tester/issues/39 and https://github.com/braddr/d-tester/issues/40 I don't mind getting asked, I just wish the answer would change. Anyway, great to have the lexer on DUB, not going to use if for now because I expect there to be changes, but I guess it may eventually be useful for writing tools. Hopefully lots of changes. I can't really help with those, but FWIW I bumped the issues.
Re: DMD's lexer available on code.dlang.org
On 1/4/2015 5:07 AM, Daniel Murphy wrote: I've created a dub package for the D version of DMD's lexer, generated automatically from the C++ source. github: https://github.com/yebblies/ddmd dub: http://code.dlang.org/packages/ddmd Great! Thank you!
Re: DOtherSide: QML bindings for both D and Nim
On Wednesday, 31 December 2014 at 13:11:39 UTC, filcuc wrote: Hi all, i'll like to share my project for building the bindings for QML in both D and Nim programming languages. The project is young and it's not complete, however at the current state slots, signals and properties can be exposed to QML from D. So a pure databound application can be created (like MVVM). The projects is hosted on github https://github.com/filcuc/DOtherSide. A the current state the syntax isn't pretty so i'm glad in any contribution for improving it. Have a nice new year, cool, i've been looking for something like this for a long time. after so many hours messing around with qt bindings, maybe D+QML is enough for me.
Re: DMD's lexer available on code.dlang.org
On 5/01/2015 2:39 a.m., Daniel Murphy wrote: "Rikki Cattermole" wrote in message news:m8be2m$1dlp$1...@digitalmars.com... I saw that. I'm really looking forward to getting my teeth into it and doing some good old refactoring. Although that will be a while because of the auto generated thing. There's plenty of refactoring to be done on the C++ side too. What I want to do is D side unfortunately. I just hate to see large lists in e.g. globals with constructors. When they can be dealt with a simple array and a bit of CTFE magic.
Re: DMD's lexer available on code.dlang.org
"Laeeth Isharc" wrote in message news:yzmwemaevaltcmkyw...@forum.dlang.org... on a related note, have you considered sharing your translation tool (c++ -> D)? I completely understand if you would rather not of course. The translation tool is available on github and is boost licensed. This pull request contains the latest version in src/magicport - https://github.com/D-Programming-Language/dmd/pull/3410 Please keep in mind that the tool makes a lot of assumptions about the C++ source that may not be valid for projects other than dmd. It's fairly easy to adapt to other projects, but it won't work on them out of the box.
Re: DMD's lexer available on code.dlang.org
"Daniel Murphy" wrote in message news:m8bdul$1dke$1...@digitalmars.com... I've created a dub package for the D version of DMD's lexer, generated automatically from the C++ source. github: https://github.com/yebblies/ddmd dub: http://code.dlang.org/packages/ddmd I've pushed a new version which should fix the 64-bit build errors.
Re: DMD's lexer available on code.dlang.org
On Monday, 5 January 2015 at 02:51:17 UTC, Daniel Murphy wrote: "Laeeth Isharc" wrote in message news:yzmwemaevaltcmkyw...@forum.dlang.org... on a related note, have you considered sharing your translation tool (c++ -> D)? I completely understand if you would rather not of course. The translation tool is available on github and is boost licensed. This pull request contains the latest version in src/magicport - https://github.com/D-Programming-Language/dmd/pull/3410 Please keep in mind that the tool makes a lot of assumptions about the C++ source that may not be valid for projects other than dmd. It's fairly easy to adapt to other projects, but it won't work on them out of the box. Thanks v much - this will be very helpful indeed.
D port of the Dynamic Window Manager (DWM)
Hi, I've ported DWM to D as a learning exercise and thought I'd share it. The repository can be found here: https://bitbucket.org/growlercab/ddwm (Beware, I've only tested it on Arch-Linux 64 bit for about 1 day!) DWM is a minimalist dynamic window manager from suckless. More details on DWM can be found here http://dwm.suckless.org/ The "cport" branch is where I've done as little as possible to port the C code to D. It really looks like C code and is basically the DWM code compiling with DMD. Under the "Downloads" section is a build of ddwm-cport to try out if anyone is interested, or build from source as it's pretty easy with dub. The master branch is where I'm learning D, trying new Phobos functions and D style coding. I'm then comparing how the D-style version performs with DDWM.cport and the original DWM in terms of speed and memory. I don't expect the master branch to be stable but cport should work fine. Cheers, Stew
Re: DMD's lexer available on code.dlang.org
"Laeeth Isharc" wrote in message news:vtgirvyjsalkzjvlz...@forum.dlang.org... Thanks v much - this will be very helpful indeed. Let me know if you have any questions about it.
I'll be presenting at NWCPP on Jan 21 at Microsoft
http://nwcpp.org/ All are invited. Now I just have to write the presentation :-(