DTanks battle
Hey, I'm feeling like doing some DTanks battle fighting. Ping me if you are interested. https://github.com/kingsleyh/dtanks --Kingsley
WebTesting library
Hi, I don't know if this is of interest to anyone but I've created a webtesting library that is basically a phantomjs driver. It looks similar to Webdriver/Selenium but its in D. I have been using it to functionally test my web apps. If anyone is remotely interested I will publish it on dub. --Kingsley
Re: WebTesting library
On Friday, 22 January 2016 at 21:43:35 UTC, Keywan Ghadami wrote: On Friday, 22 January 2016 at 20:16:12 UTC, Kingsley wrote: Hi, I don't know if this is of interest to anyone but I've created a webtesting library that is basically a phantomjs driver. It looks similar to Webdriver/Selenium but its in D. I have been using it to functionally test my web apps. If anyone is remotely interested I will publish it on dub. --Kingsley I guess you are talking about https://github.com/kingsleyh/erik ? Can you tell more about it. You write tests in D and "erik" runs them with phantom.js? Is something special when using it together with vibe.d? Is there anything planed to put on top on it like behat? Is it compatible with selenium. E.g. can you run tests in the cloud or differnt browsers. Sorry for asking maybe stupid questions. Hey - yeah thats it. I have been using d-unit to write the tests and using erik as the tool to operate and drive the browser - in this case the phantomjs headless javascript browser. an example might be: @Test public void doit(){ Session session = Session.start(); // start new phantom on random port session.visitUrl("http://www.google.com;); // visit url By search = By.cssSelector("input[name='q']"); session.waitFor(search, Condition.isClickable()); // wait for search box to appear WebElement searchBox = session.findElement(search); // select search box searchBox.sendKeys("d language kingsley"); // type into search box writeln(searchBox.getAttribute("value")); // get search box value } There is currently nothing special for vibe.d - however I'm planning on doing some better integration there. I may write a cucumber/behat/jbehave thing that it could hook into It's currently not directly compatible with selenium - the hooks exist but I haven't pushed them forward - but it would not be hard to support selenium for driving different browsers. I'm not 100% in which direction it will go at the moment as only the basics are implemented.
Next London D Meetup: Wednesday 20th January 2016
Hi, Come along to the next London D Meetup at CodeNode SkillsMatter from 6:30pm on the 20th January. This time we peek into the mind and code of Ross McKinlay who will give us a tour of some of his D efforts. http://www.meetup.com/London-D-Programmers/events/226237683/ Hope to see you all there :) --Kingsley
Re: DLanguage IntelliJ plugin released
On Friday, 1 January 2016 at 15:37:44 UTC, Minas Mina wrote: On Wednesday, 30 December 2015 at 17:17:07 UTC, Israel wrote: On Wednesday, 30 December 2015 at 17:04:15 UTC, Suliman wrote: On Monday, 28 December 2015 at 19:23:17 UTC, Kingsley wrote: On Friday, 25 December 2015 at 17:43:06 UTC, Kingsley wrote: On Friday, 25 December 2015 at 16:55:32 UTC, Bogdan wrote: [...] Raise any issues at the GitHub page and I will fix - I will write some documentation over the next few days also Intellij D plugin version 1.5 released with improved DUB support and bug fixes How to install this plugin on Windows? Intellij Idea 14 on windows. File > Settings > plugins > browse repositories The plugin does not show up on Intellij Idea 15 though so im guessing it isnt compatible yet and neither on CLion. I am actually using it with IntelliJ 15. I'm still on IntelliJ 14 so haven't tried it with 15 personally - but it should be fine. IT should work fine on windows as well - although I'm an OSX user so have only ever tested it on OSX - please raise any windows specific issues at the github project https://github.com/kingsleyh/DLanguage/issues At the moment I've restricted the plugin to Intellij - so it won't work on other jetbrains products - but It should not be hard to get it working on CLion.
Re: DLanguage IntelliJ plugin released
On Friday, 25 December 2015 at 17:43:06 UTC, Kingsley wrote: On Friday, 25 December 2015 at 16:55:32 UTC, Bogdan wrote: On Friday, 25 December 2015 at 15:28:23 UTC, Pradeep Gowda wrote: On Friday, 25 December 2015 at 15:04:42 UTC, eyveer wrote: On Friday, 25 December 2015 at 13:57:52 UTC, Pradeep Gowda wrote: [...] https://github.com/kingsleyh/DLanguage Thank you. The screenshots are very impressive! Gives me motivation to figure out why i couldn't get it to work. Couldn't figure out what went wrong until I read your comment and looked at the screenshots. Try going to Settings/Other Tools/D Tools and press all the "Auto Find" buttons. Raise any issues at the GitHub page and I will fix - I will write some documentation over the next few days also Intellij D plugin version 1.5 released with improved DUB support and bug fixes
Re: Official Announcement: 'Learning D' is Released
On Saturday, 26 December 2015 at 17:58:52 UTC, Guillaume Piolat wrote: On Tuesday, 1 December 2015 at 06:17:17 UTC, Mike Parker wrote: [...] Got "Learning D" as a present, still reading. I must say I didn't expect to learn much after the D Cookbook or TDPL. Wrong! The content matches perfectly with the stuff I hadn't understood well enough. Just like D it has a lot of value in small details, like "this" template parameters, detailing opEquals, details on align, DVM introduction... The chapter on Ranges is extremely helpful and should help overcome my "range anxiety". Other chapter are similarly thorough on Voldemort types or slices. Really appreciate the attention to detail that went into it. This is a fantastic book - thanks very much to Mike for all the effort and attention he put into the book :) - I have learned a lot from it.
Re: DLanguage IntelliJ plugin released
On Saturday, 26 December 2015 at 07:17:01 UTC, Minas Mina wrote: Also, it seems that no [project name].sdl file is created for dub projects. I've fixed both of those issues and released
Re: DLanguage IntelliJ plugin released
On Friday, 25 December 2015 at 13:57:52 UTC, Pradeep Gowda wrote: On Friday, 25 December 2015 at 10:41:26 UTC, Kingsley wrote: [...] Thanks! I did install it on IntelliJ IDEA Ultimate 15 and take it for a spin. However, it did not create a "dub" project even when I chose "D application with DUB" option in the "New project" screen. Nor was it able to import an existing DUB project. [...] A link to the github page would help me in reporting these bugs? Ok thanks - I'm still on 14 but will test with 15 next GitHub: https://github.com/kingsleyh/DLanguage
Re: DLanguage IntelliJ plugin released
On Friday, 25 December 2015 at 16:55:32 UTC, Bogdan wrote: On Friday, 25 December 2015 at 15:28:23 UTC, Pradeep Gowda wrote: On Friday, 25 December 2015 at 15:04:42 UTC, eyveer wrote: On Friday, 25 December 2015 at 13:57:52 UTC, Pradeep Gowda wrote: A link to the github page would help me in reporting these bugs? https://github.com/kingsleyh/DLanguage Thank you. The screenshots are very impressive! Gives me motivation to figure out why i couldn't get it to work. Couldn't figure out what went wrong until I read your comment and looked at the screenshots. Try going to Settings/Other Tools/D Tools and press all the "Auto Find" buttons. Raise any issues at the GitHub page and I will fix - I will write some documentation over the next few days also
DLanguage IntelliJ plugin released
Hi I have released an initial attempt at an IntelliJ plugin for D to the jetbrains plugin repository. It's DLanguage version 1.2 It has basic syntax highlighting, autocompletion with DCD, compile checking and linting with Dscanner, code formatting with Dfmt and navigation jump to classes and functions and dub support - recommend using dub See the GitHub page screenshots for an idea Enjoy :) --Kingsley
Re: DLanguage IntelliJ plugin released
On Friday, 25 December 2015 at 11:09:01 UTC, Vadim Lopatin wrote: On Friday, 25 December 2015 at 10:41:26 UTC, Kingsley wrote: Hi I have released an initial attempt at an IntelliJ plugin for D to the jetbrains plugin repository. It's DLanguage version 1.2 It has basic syntax highlighting, autocompletion with DCD, compile checking and linting with Dscanner, code formatting with Dfmt and navigation jump to classes and functions and dub support - recommend using dub See the GitHub page screenshots for an idea Enjoy :) --Kingsley Great! Does it have debugging support? Debugging will be in July 2016
Re: DLang users telegram group
On Monday, 30 November 2015 at 10:58:34 UTC, Quentin Ladeveze wrote: Hi everybody, I just created a Telegram group for dlang users : https://telegram.me/joinchat/BeLaugMz35ZxQUq2fks4YQ Feel free to join ! says the link has expired
Next London D Meetup - 18th November
Hi Please come to the London D meetup on Wednesday 18th November. We have a great talk by John Colvin on semi functional programming. We have a fantastic venue at skills matter with great facilities and free video recording capabilities. http://www.meetup.com/London-D-Programmers/events/226237601/
Re: OS X libphobos2.so
On Sunday, 8 November 2015 at 18:12:04 UTC, bitwise wrote: On Saturday, 7 November 2015 at 08:37:40 UTC, Jacob Carlborg wrote: [...] Well, I'm speaking in relative terms when I say easy... ;) [...] Hi Bit, I'm very excited by your posts with your insights and progress into this issue. I'm afraid I am not able to help much (lacking in skills not enthusiasm). But Please keep going :) and keep us updated - if there is anything I can do to help - please don't hesitate to ask :) Thanks for the links you posted - I have started watching Martin's presentation with interest. --K
Re: OS X libphobos2.so
On Thursday, 5 November 2015 at 21:09:41 UTC, Jacob Carlborg wrote: On 2015-11-05 16:51, bitwise wrote: Once I get this sorted out, the rest shouldn't be that bad. It will still probably be a few months minimum though. Then the TLS is left as well. Hi - I would like to help. I don't have the knowledge or skills (yet) to be of much use. However I'm certainly interested in starting a public project somewhere and encouraging as many people who do have the skills and knowledge to help out. I have absolutely no idea where to start. However if you are remotely interested could you reply here. If people with skills and knowledge were open to jumping on a regular skype call to discuss how to get this moving forward I could possibly provide some kind of compensation as motivation. Please let me know :)
OS X libphobos2.so
Hi Anyone know when a version of libphobos2.so will be available on OS X? I understand there are issues preventing us having one. -k
Re: Functional Programming with D
On Sunday, 14 April 2013 at 15:27:29 UTC, Ali Çehreli wrote: On 04/13/2013 11:35 PM, qznc wrote: [...] talking about [...] // in D [...] is similar to [...] foo(const int * [...] const ref d); [...] immutable.) The C variant is an mutable pointer to an immutable int. What is not to know about that? What foo() does not know is whether the original int is const or not: int i = 0; foo(i); // Can be mutated by the caller later on i = 1; For that reason, function foo() cannot store the pointer 'c' in confidence that it will not change in the future. Of course you and the dlang.org link that you have provided indicate that immutable is not the same as const. When you say You can qualify variables as immutable, which is similiar to C's const and Java's final, but it is transitive, it sounds like the main difference that brings 'immutable' is transitivity but I think the fact that data cannot be mutated is the main difference. That makes it possible for a function to request immutable data, something not possible in C because a const reference parameter is not a requirement but a promise not to mutate. And of course you never say they are the same; you say similar. Nothing is wrong with that. :) Ali This is excellent information on functional programming with D. I would love to see a lot more information in this area - perhaps a much longer article covering in more detail - and also covering what is missing - e.g. does D have a for comprehension, Option, Either etc
TCP Socket Client Example
Hi Does anyone have some examples of making a client socket connection to a host on a port and parsing the incoming data in some kind of loop. --K
Re: TCP Socket Client Example
On Friday, 14 August 2015 at 14:12:14 UTC, Alex Parrill wrote: On Friday, 14 August 2015 at 14:06:03 UTC, Kingsley wrote: Hi Does anyone have some examples of making a client socket connection to a host on a port and parsing the incoming data in some kind of loop. --K auto addresses = getAddress(localhost, 8085); auto socket = new Socket(AddressFamily.INET, SocketType.STREAM, ProtocolType.TCP); scope(exit) socket.close(); socket.connect(addresses[0]); auto buffer = new ubyte[2056]; ptrdiff_t amountRead; while((amountRead = socket.receive(buffer)) != 0) { enforce(amountRead 0, lastSocketError); // Do stuff with buffer } Great thanks. How would I send stuff back to the server without blocking? Is there some kind of IO reactor / event machine library for D that could help me?
Periodic Scheduler
Hi, Is there a good periodic scheduler for D? Similar to Quartz or rufus-scheduler?
Re: London D meetups ...
On Tuesday, 4 August 2015 at 14:25:33 UTC, Russel Winder wrote: On Tue, 2015-08-04 at 09:54 +, Dejan Lekic via Digitalmars-d -announce wrote: Yes, I am aware of that. I was thinking of volunteering for some time, with help of others. We have a healthy D community here in London and we should work on making it bigger. Kingsley has stepped down as organizer of the London D Meetup, we need to create a cabal to decide who should register as organizer. This is relatively urgent or Meetup will close the group. Hi I've reconsidered - but it would help a lot if someone would volunteer to co organise with me --k
Re: Working with pdf
On Thursday, 30 July 2015 at 12:01:55 UTC, Daniel Kozák wrote: I use wkhtmltopdf: http://wkhtmltopdf.org On Thu, 30 Jul 2015 11:19:45 + Kingsley via Digitalmars-d digitalmars-d@puremagic.com wrote: Hi Can anyone recommend any ways of pdf creation using D. I am generating an HTML and JavaScript page but I would like it in pdf format as well. This one I'm having the most success with thanks :)
Working with pdf
Hi Can anyone recommend any ways of pdf creation using D. I am generating an HTML and JavaScript page but I would like it in pdf format as well.
Re: OctoDeskdex: D language program for your pleasure
On Wednesday, 8 July 2015 at 03:51:07 UTC, Ramon wrote: On Saturday, 4 July 2015 at 15:00:08 UTC, Guy Gervais wrote: [...] Yes, you can use D or C++ for the backend (internal logic), and there is an entire API for the backend-frontend conversastion. You can access and manipulate the DOM from the backend, as you can do it also through scripting (the language that Sciter technology supports is called TIScript, very similar to javascript). I recommend do to all the UI logic through scripting. You will need to use the native D/C++ side for the system stuff, like feeding the HTML/CSS/img resources, loading the HTML page, creating the HWND, ... I'm interested in this - if you could write up a tutorial or something I would try it out
json parsing performance
I have read that std.json is pretty slow compared to other languages json parsers and I'm about to do a whole stack of json parsing and was wondering if anyone has got any benchmarks to indicate what slow means compared to other languages - particularly java, ruby, python? I want to know whether to roll up the sleeves and write my own json parser focused on performance or if slow just means a few ms slower - which I could live with.
Re: json parsing performance
On Monday, 6 April 2015 at 20:26:15 UTC, cym13 wrote: On Monday, 6 April 2015 at 20:20:06 UTC, Kingsley wrote: I have read that std.json is pretty slow compared to other languages json parsers and I'm about to do a whole stack of json parsing and was wondering if anyone has got any benchmarks to indicate what slow means compared to other languages - particularly java, ruby, python? I want to know whether to roll up the sleeves and write my own json parser focused on performance or if slow just means a few ms slower - which I could live with. I don't know much about json parsers so I can't say if it is a good one but it was subject to many discussions lately: https://github.com/kostya/benchmarks/tree/master/json great thanks. Hmm when I ran the test json I got a 212MB json file which the tests used. So although the std.json takes around 10 seconds to parse this - I can probably live with that and spend my energy getting on with my project. Of course it would have been nice to see the performance of std.json closer to that of rust and go instead of closer to ruby.
Business Venture in D - Help Wanted
Hi, I have a great idea for a small web based business and I want to build the system in D since I have committed to learning D this year. The idea builds upon technology in a space I have already had some experience in although everything is currently free - I want to completely re-write / revamp and monetise it. I am looking for a few people who are interested in helping me in this venture. Primarily I need some help with the D coding. Im only interested in people who can contribute time and effort and are reliable, quick to respond, easy to contact, enthusiastic, can suggest ideas as well. Ideally I want people that are willing to work for free in return for a share in the business. Only contact me if you are serious and have the qualities I listed above. kingsley dot hendrickse at gmail dot com
Re: DTanks Alpha
On Wednesday, 25 March 2015 at 15:16:06 UTC, Russel Winder wrote: On Tue, 2015-03-24 at 23:37 +, Kingsley via Digitalmars-d-announce wrote: On Saturday, 21 March 2015 at 15:57:54 UTC, Dan Olson wrote: Kingsley kingsley.hendric...@gmail.com writes: In preparation for the London D meetup I have got the DTanks robot battle framework into the first alpha release state - good enough to use at the meetup anyway. https://github.com/masterthought/dtanks And an excellent framework it is too. I hope to be able to put some programming effort towards this to help make it even better. Actually I am wondering if we can put the framework skeleton to a constructive rather than destructive purpose. --K DTanks looks cool! I am going to have to try it. Brings back memories. I got hooked on the Apple ][ version (http://corewar.co.uk/robotwar/) back in the 80's and started a version for the Amiga called Tonks but it never got off the drawing board. I've always loved this game concept. Even did a version to run each tank on a node of an Intel Hypercube as a school project. Cool - feel free to give me any feedback. At the London D programmers meetup we had a tank tournament which was great fun. Some of the guys who came had not done D before - they were Scala / Java guys - but really enjoyed playing with D by way of the tanks game. Great fun was had by all there. Thanks to Kingsley for organizing this, and perhaps more importantly, getting the framework together. An interesting point was made by some there: this looks very like Java coding. Laeeth and I both agreed, saying that we felt Kingsley background in Java was being reflected a little in the look and feel of the D code, that if a C++ programmer had written it most likely the code would have had a C++ feel to it. Much of this is about spacing, identifier structure and things like that – relatively trivial stuff in the main. The question us then is this fine ( that D code can have a Java or C++ feel) or should there always be a D feel to all D code? There should be a video of the tournament emerging at some point from SkillsMatter who sponsor the meetup as they filmed it. The video may not reflect quite as much of the fun that was had! Here is the video: https://skillsmatter.com/skillscasts/6287-d-robot-tank-battle-tournament the fun starts at 16:48
Re: 2nd London D Programmers Meetup - Robot Tank Battle Tournament
On Wednesday, 25 March 2015 at 13:21:21 UTC, Iain Buclaw wrote: On 25 Mar 2015 12:15, Russel Winder via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: On Wed, 2015-03-25 at 11:25 +, wobbles via Digitalmars-d-announce wrote: On Tuesday, 24 March 2015 at 23:32:38 UTC, Kingsley wrote: Here are the details - spread the word: http://www.meetup.com/London-D-Programmers/events/220610394/ thanks --Kingsley Thanks for all who came to the D meetup. The champion tank of the evening goes to runaway.d by Justin Priya which defeated all challengers swiftly and in style :) Looking forward to the next meetup. Any videos of the fights? (Or were they all robot fights?) The activity was captured by the good folk of Skills Matter. It is worth noting the name of the winning tank exemplified it's strategy. It can be characterized by a quote from Monty Python and the Holy Grail: run away, run away. Whilst there, I didn't get around to writing a tank strategy, I spent too long looking at, and analysing, Kingsley's little framework – oh and chatting with Laeeth about D, Go, computational finance, etc. Kingsley's code is (mostly) great; hopefully I and others can help evolve this via pull requests, to be something we can put before CAS and others for inclusion in Key Stage 3 and 4 educational materials. Long explanation of new UK computing education system elided. This would be a great way of getting young people interested in native code after Scratch and Python. D and Java would be a good combination. Great stuff. I would have tried to come up, but with moving home and all... Vacated the flat this morning. :-o Iain Here is the video: https://skillsmatter.com/skillscasts/6287-d-robot-tank-battle-tournament the fun starts at 16:48
Re: 2nd London D Programmers Meetup - Robot Tank Battle Tournament
Here are the details - spread the word: http://www.meetup.com/London-D-Programmers/events/220610394/ thanks --Kingsley Thanks for all who came to the D meetup. The champion tank of the evening goes to runaway.d by Justin Priya which defeated all challengers swiftly and in style :) Looking forward to the next meetup.
DTanks Alpha
In preparation for the London D meetup I have got the DTanks robot battle framework into the first alpha release state - good enough to use at the meetup anyway. https://github.com/masterthought/dtanks --K
Re: 2nd London D Programmers Meetup - Robot Tank Battle Tournament
Just a reminder - this is happening next Tuesday - please come along if you are in London and fancy a bit of D programming fun. On Thursday, 26 February 2015 at 15:56:13 UTC, Kingsley wrote: Hi, The second London D Programmers Meetup is now officially scheduled for Tuesday 24th March. As usual it's sponsored by Skills Matter and will be at their awesome training facility. This meetup will be all about an awesome robot battle tournament. Come along and bring your laptop and be prepared to build a tank robot that can destroy the opposition in our custom made 2D battle arena. I've used the very excellent DSFML library for the graphics so it's looks nice :) If we come up with a super tank we may start challenging other D meetup groups to a robot tank battle royale extravaganza!! So watch out!!! Here are the details - spread the word: http://www.meetup.com/London-D-Programmers/events/220610394/ thanks --Kingsley
Terminal ANSI Colouring Library
Hi, As a learning project I've knocked up a tiny library to output ansi coloured text on linux/osx. I guess I will go through a few iterations of improvements to end up with something more D like. https://github.com/kingsleyh/rainbow
Re: Deadcode: A code editor in D
Up to your imagination! Personally I will probably use them to integrate 3rd party tools or create small helpers in my day to day work that are currently small bash/bat scripts. Using D for scripting this way would be very nice imho. Of course the editor itself can (and does) make use of such widgets to show misc. info about you project state. /Jonas Could you put the code on github or somewhere so I can have play with it? I don't care what state the code is in or if stuff fully works or not - just want to have a go. I'm writing an intellij plugin for D https://github.com/kingsleyh/DLanguage and curious to see other approaches to editing D code. --K
Re: Deadcode: A code editor in D
On Monday, 19 January 2015 at 20:41:11 UTC, Rikki Cattermole wrote: On 20/01/2015 1:48 a.m., Jonas Drewsen wrote: On Sunday, 18 January 2015 at 22:00:51 UTC, Piotrek wrote: On Friday, 16 January 2015 at 21:19:08 UTC, Jonas Drewsen wrote: I have been working on an editor written in D for use with D for some time now and have made a blog post about it. Any feedback or suggestions are welcome. http://deadcodedev.steamwinter.com Thanks Jonas Hi, This is an impressive work. I's really nice to see a presentation of how much help can be provided from the D editor and existing language labiaries. I have several questions as well: 1. Was the libdparser integrated with extension system or is it embedded in the core? Done with the extension system. 2. What are the dependencies? sdl2, opengl, freetype, libdparse (if you want the extension for D semantic) I am keeping an eye on some of the native D input/window libraries that is being worked on in the hope of being able to replace the SDL2 dependency. Please file any enhancement requests for any Devisualization projects you need. It would help me know what is needed of them more. 3. How hard it would be to change the feellook of the gui as it is in conventional editors (Visual, MonoDeveop, GtCreator, Eclipse). I mean menus, buttons, views etc? Would require some more views/controls to be created. The styling is done through CSS sheets. A common subset of CSS keys are supported but maybe a few more would be needed. What is the purpose of the widgets in deadcode
2nd London D Programmers Meetup - Robot Tank Battle Tournament
Hi, The second London D Programmers Meetup is now officially scheduled for Tuesday 24th March. As usual it's sponsored by Skills Matter and will be at their awesome training facility. This meetup will be all about an awesome robot battle tournament. Come along and bring your laptop and be prepared to build a tank robot that can destroy the opposition in our custom made 2D battle arena. I've used the very excellent DSFML library for the graphics so it's looks nice :) If we come up with a super tank we may start challenging other D meetup groups to a robot tank battle royale extravaganza!! So watch out!!! Here are the details - spread the word: http://www.meetup.com/London-D-Programmers/events/220610394/ thanks --Kingsley
Re: What am I doing wrong here - canFind with iota is not working
On Thursday, 26 February 2015 at 11:12:42 UTC, Kingsley wrote: On Thursday, 26 February 2015 at 11:04:58 UTC, Baz wrote: On Thursday, 26 February 2015 at 10:55:43 UTC, Kingsley wrote: float oneDegree = (PI / 180.0); float first = -(oneDegree * 10.0); float second = (oneDegree * 10.0); float step = 0.01; float[] r = iota(first,second,step).array; writeln(r); float item = 0.174531; writeln(r.canFind(item)); // returns false for canFind - even though that float is in the array ??? also mark your float litteral with the f postfix. By default FP litterals are double...IIRC float oneDegree = (PI / 180.0f); float first = -(oneDegree * 10.0f); float second = (oneDegree * 10.0f); float step = 0.01f; Hardcoding the double[] does work as expected - so why doesn't it work with the iota generated array? double oneDegree = (PI / 180.0); double first = -(oneDegree * 10.0); double second = (oneDegree * 10.0); double step = 0.01; double[] r = iota(first,second,step).array; writeln(r); double[] hardCoded = [ 0.174521, 0.174522, 0.174523, 0.174524, 0.174525, 0.174526, 0.174527, 0.174528, 0.174529, 0.17453, 0.174531, 0.174532]; double item = 0.174531; writeln(r.canFind(item)); // false - I expect true writeln(hardCoded.canFind(item)); // true - as I expect float[] r = iota(first,second,step).array; writeln(r); float item = 0.174531f; writeln(r.canFind(item)); Adding the f still produces a false result. Also I tried changing all to double but still not working - I always get false back. Interestingly if I harcode the output of the iota into an array - then things start to work as I expect.
What am I doing wrong here - canFind with iota is not working
float oneDegree = (PI / 180.0); float first = -(oneDegree * 10.0); float second = (oneDegree * 10.0); float step = 0.01; float[] r = iota(first,second,step).array; writeln(r); float item = 0.174531; writeln(r.canFind(item)); // returns false for canFind - even though that float is in the array ???
Re: What am I doing wrong here - canFind with iota is not working
On Thursday, 26 February 2015 at 11:04:58 UTC, Baz wrote: On Thursday, 26 February 2015 at 10:55:43 UTC, Kingsley wrote: float oneDegree = (PI / 180.0); float first = -(oneDegree * 10.0); float second = (oneDegree * 10.0); float step = 0.01; float[] r = iota(first,second,step).array; writeln(r); float item = 0.174531; writeln(r.canFind(item)); // returns false for canFind - even though that float is in the array ??? also mark your float litteral with the f postfix. By default FP litterals are double...IIRC float oneDegree = (PI / 180.0f); float first = -(oneDegree * 10.0f); float second = (oneDegree * 10.0f); float step = 0.01f; float[] r = iota(first,second,step).array; writeln(r); float item = 0.174531f; writeln(r.canFind(item)); Adding the f still produces a false result. Also I tried changing all to double but still not working - I always get false back. Interestingly if I harcode the output of the iota into an array - then things start to work as I expect.
Re: Are there any 2D games libraries available for D2?
I'm using DSFML and it is one of the easiest. Though I had strange issues like high ram usage and text not rendering. Though the ease of use and performance is phenomenal. Thanks for the heads up. I'll open an issue to inspect RAM usage, but can you let me know when you were having Text rendering issues so I can inspect that too? This link can give you more information about it: http://en.sfml-dev.org/forums/index.php?topic=17550.0 I started getting text rendering issues when I was playing with my space background render textures. It's kinda strange cause they seem unrelated. I'll check it out, thanks! Hi - I started using dsfml - I really like it! The fact that there were pre-built zips to download for my platform was awesome!! Got started straight away. I have been googling but not found a nice answer. I want to make an explosion from a list of 20 images. sfml doesn't seem to have very good support for doing that kind of thing. I have seen an external thing called thor - but I guess I'd have to port that to D - maybe a bit beyond my skills at the moment. If anyone has an example of creating an explosion from images using dsfml please post it so I can learn :) :) you will see why I need this pretty soon :) --K
Re: Dgame revived
On Saturday, 21 February 2015 at 14:43:57 UTC, Namespace wrote: Today I registered Dgame on DUB. Since I do not currently have much time (I'm currently in my exams period) I hope I did everything right. Let me know if not and what could be improved. Since I left D a while ago, Dgame was also not maintained, but thanks to your demand I will maintain Dgame again. The current goal is to register Dgame successful on DUB. The next goal would be to adapt the webpage and the installation chapter and to re-register the domain dgame.dev.de After that (and after my hopefully successful exams) I will rebuild Dgame from scratch with the goal of a more consistent and better structure and with the idea in mind to use @nogc wherever possible. Awesome!! great news :)
Reloaded for dub
Hi Just thought I would share this in case anyone else finds it useful. I wrote a tiny utility that detects changes to D files and then rebuilds and re-executes the main binary using dub. I use for developing with vibe.d and other dub D project that have an executable binary. The code is here: https://github.com/kingsleyh/reloaded essentially you just run dub in the root and it builds the reloaded binary. Then you just copy that binary to the root of your dub project and ./reloaded and then as soon as you make a change to a D file your code will be built and executed. --K
Re: Are there any 2D games libraries available for D2?
On Thursday, 19 February 2015 at 23:59:14 UTC, Kingsley wrote: I use Dgame which has a really nice and simple interface http://rswhite.de/dgame4/ From the web page: Dgame is a 2D framework which is based on the SDL and OpenGL, and is designed for the D programming language. The design is based on Pygame and as well on the SFML from the C++ programming language. Cheers, Stew I'm looking at DGame - I'm on osx - so I guess I have to build all the dependencies myself sigh - Once I get it installed and working - it looks like it may be enough for what I want. I guess I'll have to make it work with dub myself to make it easier to get started with. DGame has a dependency on Derelict 3 - but going to the link provided says that project is no longer maintained and doesn't work with the latest DMD compiler. It points to a new location where there are multiple different Derelict libraries - I'm hoping DGame will work with one of those still.
Are there any 2D games libraries available for D2?
Hi I'm looking for a 2D games library in D2 similar to gosu from ruby: http://www.libgosu.org/ or ray: https://github.com/Mon-Ouie/ray Does such a thing exist? --K
Re: Are there any 2D games libraries available for D2?
I use Dgame which has a really nice and simple interface http://rswhite.de/dgame4/ From the web page: Dgame is a 2D framework which is based on the SDL and OpenGL, and is designed for the D programming language. The design is based on Pygame and as well on the SFML from the C++ programming language. Cheers, Stew I'm looking at DGame - I'm on osx - so I guess I have to build all the dependencies myself sigh - Once I get it installed and working - it looks like it may be enough for what I want. I guess I'll have to make it work with dub myself to make it easier to get started with.
Re: London D Programmers MeetUp
Thanks to everyone who attended it was a great evening of D fun :) As part of the evening we did a secret santa code challenge - here are some of the results: http://www.meetup.com/London-D-Programmers/messages/boards/thread/48694585 We had about 13 people from different backgrounds - many from C/C++ as well as Java, F# and dynamic languages such as Python. Many of the guys had a financial / banking background or an academic background - for example we had some guys working on market data, another guy who ran a hedge fun as well as people from scientific / research and university backgrounds. We touched on IDE's and editors for D - I demo'd my intellij plugin. Bruno was also there (he maintains the eclipse D plugin DDT) and he had some interesting things to say about where he thought the future of IDE's is going especially in terms of code completion. In my intellij plugin I actually re-use the guts of the DDT parser/lexer and the general opinion seemed to be that have a single set of tools that could be re-used in multiple IDE projects was a good way forward. I already implemented Brian's DCD and DScanner tools in my plugin and Bruno was looking to go that way also rather than re-writing the wheel each time. Brian certainly has some great tools in D for this kind of thing. (Hackerpilot - DCD/libdparse/DScanner etc) We also had some discussion about the popularity of D - and many felt that D was a great language especially coming from C/C++ but that the whole community was perhaps a little fragmented and finding information on the Dlang site was also a bit disjointed and that in order for a language to gain popularity it needed the appropriate community support and information - the recent language Rust was mentioned as having great documentation/support for new people and is arguably doing a better job at that aspect than D especially since its such a new language compared to D. There was also a bit of discussion around the dub package manager with Russel W feeling strongly that dub was more like a java maven and had many issues for what he wanted to do. I think he has since posted something on the D forum about his dub feelings. We got onto dub from my intellij plugin which uses dub by default. We got together in pairs with 1 more experienced D person and 1 newbie / less experienced D persons and paired on the secret santa challenge. We only had about 45 mins for this one and then some discussion on how we chose to implement things. A couple of issues came out of the challenge regarding familiarity with syntax and then spending time hunting down the docs - is there a forall in D? Also one of the guys ended up with an out of data d compiler and spend a lot of time trying to get the right version instead of the one that came with the IDE he downloaded. The slides for the evening are here: http://slides.com/kingsleyhendrickse/london-d-programmers Our kind host Skills Matter are organising a Functional Programming conference in the summer and they have suggested we add a D talk to it that focuses on the functional aspects of D. I'll be arranging meetups every 6 weeks or so. Hope to see you all at the next one :) On Sunday, 1 February 2015 at 17:33:48 UTC, Kingsley wrote: Hi Just a reminder that the first London D Programmers meet up is happening on Tuesday February 3rd at Skills Matter. Looking forward to seeing you there :) http://www.meetup.com/London-D-Programmers/ --Kingsley On Tuesday, 23 December 2014 at 18:26:52 UTC, Kingsley wrote: Hi, I've created this meetup group for any London based D enthusiasts to meet up and get excited about D. I'll also demo my intellij plugin for D at the first meetup which I've scheduled for February. Although I might be a bit lonely if I'm the only person there! lol. http://www.meetup.com/London-D-Programmers/ Please join me if you are in the area and feel like getting some D.
Re: London D Programmers MeetUp
Also Iain B was there (who maintains the GDC compiler) and he mentioned that he was more from a devops background than a developer background and found it interesting to see how people were using the compiler. Thanks all who came from further away for making it :) On Wednesday, 4 February 2015 at 12:53:45 UTC, Kingsley wrote: Thanks to everyone who attended it was a great evening of D fun :) As part of the evening we did a secret santa code challenge - here are some of the results: http://www.meetup.com/London-D-Programmers/messages/boards/thread/48694585 We had about 13 people from different backgrounds - many from C/C++ as well as Java, F# and dynamic languages such as Python. Many of the guys had a financial / banking background or an academic background - for example we had some guys working on market data, another guy who ran a hedge fun as well as people from scientific / research and university backgrounds. We touched on IDE's and editors for D - I demo'd my intellij plugin. Bruno was also there (he maintains the eclipse D plugin DDT) and he had some interesting things to say about where he thought the future of IDE's is going especially in terms of code completion. In my intellij plugin I actually re-use the guts of the DDT parser/lexer and the general opinion seemed to be that have a single set of tools that could be re-used in multiple IDE projects was a good way forward. I already implemented Brian's DCD and DScanner tools in my plugin and Bruno was looking to go that way also rather than re-writing the wheel each time. Brian certainly has some great tools in D for this kind of thing. (Hackerpilot - DCD/libdparse/DScanner etc) We also had some discussion about the popularity of D - and many felt that D was a great language especially coming from C/C++ but that the whole community was perhaps a little fragmented and finding information on the Dlang site was also a bit disjointed and that in order for a language to gain popularity it needed the appropriate community support and information - the recent language Rust was mentioned as having great documentation/support for new people and is arguably doing a better job at that aspect than D especially since its such a new language compared to D. There was also a bit of discussion around the dub package manager with Russel W feeling strongly that dub was more like a java maven and had many issues for what he wanted to do. I think he has since posted something on the D forum about his dub feelings. We got onto dub from my intellij plugin which uses dub by default. We got together in pairs with 1 more experienced D person and 1 newbie / less experienced D persons and paired on the secret santa challenge. We only had about 45 mins for this one and then some discussion on how we chose to implement things. A couple of issues came out of the challenge regarding familiarity with syntax and then spending time hunting down the docs - is there a forall in D? Also one of the guys ended up with an out of data d compiler and spend a lot of time trying to get the right version instead of the one that came with the IDE he downloaded. The slides for the evening are here: http://slides.com/kingsleyhendrickse/london-d-programmers Our kind host Skills Matter are organising a Functional Programming conference in the summer and they have suggested we add a D talk to it that focuses on the functional aspects of D. I'll be arranging meetups every 6 weeks or so. Hope to see you all at the next one :) On Sunday, 1 February 2015 at 17:33:48 UTC, Kingsley wrote: Hi Just a reminder that the first London D Programmers meet up is happening on Tuesday February 3rd at Skills Matter. Looking forward to seeing you there :) http://www.meetup.com/London-D-Programmers/ --Kingsley On Tuesday, 23 December 2014 at 18:26:52 UTC, Kingsley wrote: Hi, I've created this meetup group for any London based D enthusiasts to meet up and get excited about D. I'll also demo my intellij plugin for D at the first meetup which I've scheduled for February. Although I might be a bit lonely if I'm the only person there! lol. http://www.meetup.com/London-D-Programmers/ Please join me if you are in the area and feel like getting some D.
Re: London D Programmers MeetUp
usually it applies to a collection e.g. List in Scala there is one - that takes a function that returns a boolean. e.g. List(1,2,3).forall(x = x 3) which is equivalent to a foldLeft ( I think) On Wednesday, 4 February 2015 at 14:52:32 UTC, Andrej Mitrovic wrote: On 2/4/15, Kingsley via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: A couple of issues came out of the challenge regarding familiarity with syntax and then spending time hunting down the docs - is there a forall in D? What would forall do?
Re: London D Programmers MeetUp
Hi Just a reminder that the first London D Programmers meet up is happening on Tuesday February 3rd at Skills Matter. Looking forward to seeing you there :) http://www.meetup.com/London-D-Programmers/ --Kingsley On Tuesday, 23 December 2014 at 18:26:52 UTC, Kingsley wrote: Hi, I've created this meetup group for any London based D enthusiasts to meet up and get excited about D. I'll also demo my intellij plugin for D at the first meetup which I've scheduled for February. Although I might be a bit lonely if I'm the only person there! lol. http://www.meetup.com/London-D-Programmers/ Please join me if you are in the area and feel like getting some D.
Re: London D Programmers MeetUp
We now have a venue for the London D meetup. Skills Matter have kindly offered us their support. The first meetup will be Tuesday 3rd February - see details here: http://www.meetup.com/London-D-Programmers/ Please come along if you can :) --Kingsley On Tuesday, 23 December 2014 at 18:26:52 UTC, Kingsley wrote: Hi, I've created this meetup group for any London based D enthusiasts to meet up and get excited about D. I'll also demo my intellij plugin for D at the first meetup which I've scheduled for February. Although I might be a bit lonely if I'm the only person there! lol. http://www.meetup.com/London-D-Programmers/ Please join me if you are in the area and feel like getting some D.
Re: lint for D
On Sunday, 4 January 2015 at 00:05:51 UTC, Martin Nowak wrote: https://github.com/Hackerpilot/Dscanner Brilliant thanks - I've successfully integrated it into my IntelliJ plugin
Re: lint for D
Hi has anyone made any progress with a lint for D? perhaps we could adapt this one https://github.com/facebook/flint I could do with one for my intellij plugin. --K
Re: DConf 2015?
On Tuesday, 23 December 2014 at 00:25:33 UTC, Walter Bright wrote: On 12/22/2014 12:59 PM, Iain Buclaw via Digitalmars-d wrote: On 22 December 2014 at 20:52, Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: On 12/22/2014 9:40 AM, Adam D. Ruppe wrote: By this time last year, dconf 2014 preparations were already under way but I haven't heard anything this year. Is another one planned? Yes. Still working on getting confirmation of the date. You mean to say that it's moving from it's usual time slot next year? (Weekend before spring bank holiday) Looks like it'll be May 27-29. Hi I've recently started programming in D and I have set up a London meetup group - http://www.meetup.com/London-D-Programmers/ I'm interested in coming to the next D conference. Please let me know if there is anything I can do to help out. I've been working on IDE support for intellij here: https://github.com/kingsleyh/DLanguage which I thought might be an interesting topic for a brief presentation. Although I guess it depends on the audience at these conferences. Will the next one be in the same place? I'm based in London - I guess it's not going to be in London?
London D Programmers MeetUp
Hi, I've created this meetup group for any London based D enthusiasts to meet up and get excited about D. I'll also demo my intellij plugin for D at the first meetup which I've scheduled for February. Although I might be a bit lonely if I'm the only person there! lol. http://www.meetup.com/London-D-Programmers/ Please join me if you are in the area and feel like getting some D.
Re: BNF grammar for D?
On Sunday, 21 December 2014 at 00:34:06 UTC, Kingsley wrote: On Friday, 19 December 2014 at 02:53:02 UTC, Rikki Cattermole wrote: On 19/12/2014 10:19 a.m., Kingsley wrote: On Wednesday, 17 December 2014 at 21:05:05 UTC, Kingsley wrote: Hi Bruno, Thanks very much. I do have a couple of questions about DDT in relation to my plugin. Firstly - I'm not too familiar with parsing/lexing but at the moment the Psi Structure I have implemented that comes from the DDT parser/lexer is not in any kind of hierarchy. All the PsiElements are available but all at the same level. Is this how the DDT parser works? Or is it down to my implementation of the Parser/Lexer that wraps it to create some hierarchy. For intellij it's going to be vastly easier to have a hierarchy with nested elements in order to get hold of a structure representing a class or a function for example - in order to do things like get the start and end lines of a class definition in order to apply code folding and to use for searching for classes and stuff. Secondly - how active it the development of DDT - does it keep up with the D2 releases. --Kingsley After doing a bit more research it looks like I have to create the psi hierarchy myself - my current psi structure is flat because I'm just converting the DeeTokens into PsiElements directly. I've still got some experimentation to do. On the plus side I implemented commenting, code folding but everything else needs a psi hierarchy I've done some more investigation and I do need to build the parser myself in order to create the various constructs. I've made a start but I haven't gotten very far yet because I don't fully understand the correct way to proceed. I also had a look at using the DeeParser - because it already does most of what I want. However the intellij plugin wants a PsiParser which returns an intellij ASTNode in the primary parse method. I can't see an easy way to hook this up with DeeParser because the ParsedResult although had a node method on it - gives back the wrong type of ASTNode. Any pointers on how I might get the DeeParser to interface to an intellij ASTNode would be appreciated. Read my codebase again, it'll answer a lot of questions. Your parser is different, but what it produces shouldn't be. and yes it supports hierarchies. Hi So finally after a lot of wrestling with the internals of intellij I finally managed to get a working parser implementation that produces a psi hierarchy based on the DeeParser from the ddt code. The main issue was that Intellij only wants you to create a parser using their toolset - which is either with a BNF grammar that you can then generate the parser - or with a hand written parser. Since I'm already using the DDT lexer and there is a perfectly good DDT parser as well - I just wanted to re-use the DDT parser. Hi Bruno - would be easy to return the list of tokens included for each node in the DeeParser? However Intellij does not provide any way to create a custom AST/PSI structure or use an external parser. So I basically had to wrap the DeeParse inside the Intellij parser and sync them up programmatically. It's not the most efficient way in the world but it at least works. In the long term I will write a BNF grammar for Intellij (using their toolkit) but I can see that will take me several months so this is a quick way to get the plugin up and running with all the power of intellij extras without spending several months stuck learning all about the complexities of grammar parsing and lexing. Thanks very much for you help. Once I get a bit more of the cool stuff done I will release the plugin.
Re: BNF grammar for D?
On Friday, 19 December 2014 at 02:53:02 UTC, Rikki Cattermole wrote: On 19/12/2014 10:19 a.m., Kingsley wrote: On Wednesday, 17 December 2014 at 21:05:05 UTC, Kingsley wrote: Hi Bruno, Thanks very much. I do have a couple of questions about DDT in relation to my plugin. Firstly - I'm not too familiar with parsing/lexing but at the moment the Psi Structure I have implemented that comes from the DDT parser/lexer is not in any kind of hierarchy. All the PsiElements are available but all at the same level. Is this how the DDT parser works? Or is it down to my implementation of the Parser/Lexer that wraps it to create some hierarchy. For intellij it's going to be vastly easier to have a hierarchy with nested elements in order to get hold of a structure representing a class or a function for example - in order to do things like get the start and end lines of a class definition in order to apply code folding and to use for searching for classes and stuff. Secondly - how active it the development of DDT - does it keep up with the D2 releases. --Kingsley After doing a bit more research it looks like I have to create the psi hierarchy myself - my current psi structure is flat because I'm just converting the DeeTokens into PsiElements directly. I've still got some experimentation to do. On the plus side I implemented commenting, code folding but everything else needs a psi hierarchy I've done some more investigation and I do need to build the parser myself in order to create the various constructs. I've made a start but I haven't gotten very far yet because I don't fully understand the correct way to proceed. I also had a look at using the DeeParser - because it already does most of what I want. However the intellij plugin wants a PsiParser which returns an intellij ASTNode in the primary parse method. I can't see an easy way to hook this up with DeeParser because the ParsedResult although had a node method on it - gives back the wrong type of ASTNode. Any pointers on how I might get the DeeParser to interface to an intellij ASTNode would be appreciated. Read my codebase again, it'll answer a lot of questions. Your parser is different, but what it produces shouldn't be. and yes it supports hierarchies. Hi So finally after a lot of wrestling with the internals of intellij I finally managed to get a working parser implementation that produces a psi hierarchy based on the DeeParser from the ddt code. The main issue was that Intellij only wants you to create a parser using their toolset - which is either with a BNF grammar that you can then generate the parser - or with a hand written parser. Since I'm already using the DDT lexer and there is a perfectly good DDT parser as well - I just wanted to re-use the DDT parser. However Intellij does not provide any way to create a custom AST/PSI structure or use an external parser. So I basically had to wrap the DeeParse inside the Intellij parser and sync them up programmatically. It's not the most efficient way in the world but it at least works. In the long term I will write a BNF grammar for Intellij (using their toolkit) but I can see that will take me several months so this is a quick way to get the plugin up and running with all the power of intellij extras without spending several months stuck learning all about the complexities of grammar parsing and lexing. Thanks very much for you help. Once I get a bit more of the cool stuff done I will release the plugin.
Re: BNF grammar for D?
On Wednesday, 17 December 2014 at 21:05:05 UTC, Kingsley wrote: Hi Bruno, Thanks very much. I do have a couple of questions about DDT in relation to my plugin. Firstly - I'm not too familiar with parsing/lexing but at the moment the Psi Structure I have implemented that comes from the DDT parser/lexer is not in any kind of hierarchy. All the PsiElements are available but all at the same level. Is this how the DDT parser works? Or is it down to my implementation of the Parser/Lexer that wraps it to create some hierarchy. For intellij it's going to be vastly easier to have a hierarchy with nested elements in order to get hold of a structure representing a class or a function for example - in order to do things like get the start and end lines of a class definition in order to apply code folding and to use for searching for classes and stuff. Secondly - how active it the development of DDT - does it keep up with the D2 releases. --Kingsley After doing a bit more research it looks like I have to create the psi hierarchy myself - my current psi structure is flat because I'm just converting the DeeTokens into PsiElements directly. I've still got some experimentation to do. On the plus side I implemented commenting, code folding but everything else needs a psi hierarchy I've done some more investigation and I do need to build the parser myself in order to create the various constructs. I've made a start but I haven't gotten very far yet because I don't fully understand the correct way to proceed. I also had a look at using the DeeParser - because it already does most of what I want. However the intellij plugin wants a PsiParser which returns an intellij ASTNode in the primary parse method. I can't see an easy way to hook this up with DeeParser because the ParsedResult although had a node method on it - gives back the wrong type of ASTNode. Any pointers on how I might get the DeeParser to interface to an intellij ASTNode would be appreciated.
Re: BNF grammar for D?
On Wednesday, 17 December 2014 at 03:03:59 UTC, Rikki Cattermole wrote: On 17/12/2014 1:35 p.m., Kingsley wrote: On Tuesday, 16 December 2014 at 23:25:02 UTC, Kingsley wrote: On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote: On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via Digitalmars-d wrote: This looks eerily familiar... I took a stab at an Intellij plugin a long time ago, and happened to pick the same name: https://github.com/elendel-/intelliD Been meaning to pick back up again, but haven't had the chance... was waiting for the Eclipse plugin code to mature, then got distracted. Feel free to take anything that looks useful. Brian Schott (Hackerpilot) has done a lot of useful work grammar wise. See: https://github.com/Hackerpilot/DGrammar An interesting path to take for an intellij plugin would be to use his DCD/libdparse for all the heavy lifting, with the plugin just farming out the work to external daemon process(es). That would avoid having yet another lexer/parser implementation to keep up to date. I actually forked yours originally to get it running in IDEA 14, then decided to mess with the lexer since it was causing some problems and went off from there. I saw it was somewhat inactive and tried contacting you, but couldn't find any of your contact info anywhere! Glad to see you turned up here. Hi guys, I have been working on an intellij plugin which is here: https://github.com/kingsleyh/DLanguage I only started learning D a couple of weeks ago and I haven't written an intellij plugin before - and also I'm not very familiar with parsing/lexing. On my first pass - I got all the infrastructure working - e.g. run configurations, project creation, file creation etc. And I'm working on a BNF and JFlex by hand - but I realise it will take some time - so I have a branch which implements the DDT parser/lexer so I could get something working while I work on the bnf - however it breaks the contextual run configurations - which is pretty much essential for the plugin to be useful. I'd like to get the DDT parser/lexer working but I'm not really sure where to go from where I am now. My DDT branch is called with_ddt. If anyone has any pointers to what I need to do next that would be very helpful - even in terms of reading or reference material. I guess it all comes down to the DParserDefinition class - as my master branch uses a FlexAdapter which gives access to the context. But in the with_ddt branch its just using the DParser - which I think needs to have the hooks into the AST tree implemented or something like that. Anyway let me know if you have any pointers or offers of help :) --K Actually I guess what I need is a way to make the PSI structure. I'm not sure how I would do that with the DDT code I have imported. I've sent you an email reguarding my own work on getting a plugin together using Dscanner. As well as the source code. Feel free to use it. I've successfully integrated the Psi generation stuff with the DDT parser/lexer now with a huge thanks to Rikki. So now I think I can add all the other ps related stuff - code insight, refactoring, completion etc etc Of course its the first cut - so I'll have to do some code cleanup once I understand what I'm doing! Thanks for your help and support :)
Re: BNF grammar for D?
On Wednesday, 17 December 2014 at 12:31:32 UTC, Bruno Medeiros wrote: On 17/12/2014 09:13, Kingsley wrote: On Wednesday, 17 December 2014 at 03:03:59 UTC, Rikki Cattermole wrote: On 17/12/2014 1:35 p.m., Kingsley wrote: On Tuesday, 16 December 2014 at 23:25:02 UTC, Kingsley wrote: On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote: On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via Digitalmars-d wrote: This looks eerily familiar... I took a stab at an Intellij plugin a long time ago, and happened to pick the same name: https://github.com/elendel-/intelliD Been meaning to pick back up again, but haven't had the chance... was waiting for the Eclipse plugin code to mature, then got distracted. Feel free to take anything that looks useful. Brian Schott (Hackerpilot) has done a lot of useful work grammar wise. See: https://github.com/Hackerpilot/DGrammar An interesting path to take for an intellij plugin would be to use his DCD/libdparse for all the heavy lifting, with the plugin just farming out the work to external daemon process(es). That would avoid having yet another lexer/parser implementation to keep up to date. I actually forked yours originally to get it running in IDEA 14, then decided to mess with the lexer since it was causing some problems and went off from there. I saw it was somewhat inactive and tried contacting you, but couldn't find any of your contact info anywhere! Glad to see you turned up here. Hi guys, I have been working on an intellij plugin which is here: https://github.com/kingsleyh/DLanguage I only started learning D a couple of weeks ago and I haven't written an intellij plugin before - and also I'm not very familiar with parsing/lexing. On my first pass - I got all the infrastructure working - e.g. run configurations, project creation, file creation etc. And I'm working on a BNF and JFlex by hand - but I realise it will take some time - so I have a branch which implements the DDT parser/lexer so I could get something working while I work on the bnf - however it breaks the contextual run configurations - which is pretty much essential for the plugin to be useful. I'd like to get the DDT parser/lexer working but I'm not really sure where to go from where I am now. My DDT branch is called with_ddt. If anyone has any pointers to what I need to do next that would be very helpful - even in terms of reading or reference material. I guess it all comes down to the DParserDefinition class - as my master branch uses a FlexAdapter which gives access to the context. But in the with_ddt branch its just using the DParser - which I think needs to have the hooks into the AST tree implemented or something like that. Anyway let me know if you have any pointers or offers of help :) --K Actually I guess what I need is a way to make the PSI structure. I'm not sure how I would do that with the DDT code I have imported. I've sent you an email reguarding my own work on getting a plugin together using Dscanner. As well as the source code. Feel free to use it. I've successfully integrated the Psi generation stuff with the DDT parser/lexer now with a huge thanks to Rikki. So now I think I can add all the other ps related stuff - code insight, refactoring, completion etc etc Of course its the first cut - so I'll have to do some code cleanup once I understand what I'm doing! Thanks for your help and support :) Also, if you have questions about the DDT parser/lexer, or if there are changes that might help your project, let me know, I'll be glad to add such changes (assuming they also fit well with the way DDT uses the parser/lexer). Hi Bruno, Thanks very much. I do have a couple of questions about DDT in relation to my plugin. Firstly - I'm not too familiar with parsing/lexing but at the moment the Psi Structure I have implemented that comes from the DDT parser/lexer is not in any kind of hierarchy. All the PsiElements are available but all at the same level. Is this how the DDT parser works? Or is it down to my implementation of the Parser/Lexer that wraps it to create some hierarchy. For intellij it's going to be vastly easier to have a hierarchy with nested elements in order to get hold of a structure representing a class or a function for example - in order to do things like get the start and end lines of a class definition in order to apply code folding and to use for searching for classes and stuff. Secondly - how active it the development of DDT - does it keep up with the D2 releases. --Kingsley
Re: BNF grammar for D?
Hi Bruno, Thanks very much. I do have a couple of questions about DDT in relation to my plugin. Firstly - I'm not too familiar with parsing/lexing but at the moment the Psi Structure I have implemented that comes from the DDT parser/lexer is not in any kind of hierarchy. All the PsiElements are available but all at the same level. Is this how the DDT parser works? Or is it down to my implementation of the Parser/Lexer that wraps it to create some hierarchy. For intellij it's going to be vastly easier to have a hierarchy with nested elements in order to get hold of a structure representing a class or a function for example - in order to do things like get the start and end lines of a class definition in order to apply code folding and to use for searching for classes and stuff. Secondly - how active it the development of DDT - does it keep up with the D2 releases. --Kingsley After doing a bit more research it looks like I have to create the psi hierarchy myself - my current psi structure is flat because I'm just converting the DeeTokens into PsiElements directly. I've still got some experimentation to do. On the plus side I implemented commenting, code folding but everything else needs a psi hierarchy
Re: BNF grammar for D?
On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote: On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via Digitalmars-d wrote: This looks eerily familiar... I took a stab at an Intellij plugin a long time ago, and happened to pick the same name: https://github.com/elendel-/intelliD Been meaning to pick back up again, but haven't had the chance... was waiting for the Eclipse plugin code to mature, then got distracted. Feel free to take anything that looks useful. Brian Schott (Hackerpilot) has done a lot of useful work grammar wise. See: https://github.com/Hackerpilot/DGrammar An interesting path to take for an intellij plugin would be to use his DCD/libdparse for all the heavy lifting, with the plugin just farming out the work to external daemon process(es). That would avoid having yet another lexer/parser implementation to keep up to date. I actually forked yours originally to get it running in IDEA 14, then decided to mess with the lexer since it was causing some problems and went off from there. I saw it was somewhat inactive and tried contacting you, but couldn't find any of your contact info anywhere! Glad to see you turned up here. Hi guys, I have been working on an intellij plugin which is here: https://github.com/kingsleyh/DLanguage I only started learning D a couple of weeks ago and I haven't written an intellij plugin before - and also I'm not very familiar with parsing/lexing. On my first pass - I got all the infrastructure working - e.g. run configurations, project creation, file creation etc. And I'm working on a BNF and JFlex by hand - but I realise it will take some time - so I have a branch which implements the DDT parser/lexer so I could get something working while I work on the bnf - however it breaks the contextual run configurations - which is pretty much essential for the plugin to be useful. I'd like to get the DDT parser/lexer working but I'm not really sure where to go from where I am now. My DDT branch is called with_ddt. If anyone has any pointers to what I need to do next that would be very helpful - even in terms of reading or reference material. I guess it all comes down to the DParserDefinition class - as my master branch uses a FlexAdapter which gives access to the context. But in the with_ddt branch its just using the DParser - which I think needs to have the hooks into the AST tree implemented or something like that. Anyway let me know if you have any pointers or offers of help :) --K
Re: BNF grammar for D?
On Tuesday, 16 December 2014 at 23:25:02 UTC, Kingsley wrote: On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote: On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via Digitalmars-d wrote: This looks eerily familiar... I took a stab at an Intellij plugin a long time ago, and happened to pick the same name: https://github.com/elendel-/intelliD Been meaning to pick back up again, but haven't had the chance... was waiting for the Eclipse plugin code to mature, then got distracted. Feel free to take anything that looks useful. Brian Schott (Hackerpilot) has done a lot of useful work grammar wise. See: https://github.com/Hackerpilot/DGrammar An interesting path to take for an intellij plugin would be to use his DCD/libdparse for all the heavy lifting, with the plugin just farming out the work to external daemon process(es). That would avoid having yet another lexer/parser implementation to keep up to date. I actually forked yours originally to get it running in IDEA 14, then decided to mess with the lexer since it was causing some problems and went off from there. I saw it was somewhat inactive and tried contacting you, but couldn't find any of your contact info anywhere! Glad to see you turned up here. Hi guys, I have been working on an intellij plugin which is here: https://github.com/kingsleyh/DLanguage I only started learning D a couple of weeks ago and I haven't written an intellij plugin before - and also I'm not very familiar with parsing/lexing. On my first pass - I got all the infrastructure working - e.g. run configurations, project creation, file creation etc. And I'm working on a BNF and JFlex by hand - but I realise it will take some time - so I have a branch which implements the DDT parser/lexer so I could get something working while I work on the bnf - however it breaks the contextual run configurations - which is pretty much essential for the plugin to be useful. I'd like to get the DDT parser/lexer working but I'm not really sure where to go from where I am now. My DDT branch is called with_ddt. If anyone has any pointers to what I need to do next that would be very helpful - even in terms of reading or reference material. I guess it all comes down to the DParserDefinition class - as my master branch uses a FlexAdapter which gives access to the context. But in the with_ddt branch its just using the DParser - which I think needs to have the hooks into the AST tree implemented or something like that. Anyway let me know if you have any pointers or offers of help :) --K Actually I guess what I need is a way to make the PSI structure. I'm not sure how I would do that with the DDT code I have imported.