Re: __Symbol an alternative to recursive templates for type-introsecption

2016-10-09 Thread Stefan Koch via Digitalmars-d
On Sunday, 9 October 2016 at 13:40:14 UTC, Jacob Carlborg wrote: How about we just implement AST macros and be done with it :) Walter would rather die. Then see ast-macros in D. I must say they would probably be worse then templates, in regards of compile-time bloating.

Re: Can you shrink it further?

2016-10-10 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 02:48:22 UTC, Andrei Alexandrescu wrote: That looks good. I'm just worried about the jump forward - ideally the case c < 127 would simply entail a quick return. I tried a fix, but it didn't do what I wanted in ldc. We shouldn't assert(0) if wrong - just skip one

Re: The build is broken when using gcc 6

2016-10-26 Thread Stefan Koch via Digitalmars-d
On Thursday, 27 October 2016 at 04:39:03 UTC, mogu wrote: On Thursday, 27 October 2016 at 04:33:30 UTC, Stefan Koch wrote: On Thursday, 27 October 2016 at 02:36:13 UTC, Stefam Koch wrote: Trivial. Fix is comeing. Okay it was less trivial then it should have been. Great job gcc.

Re: The build is broken when using gcc 6

2016-10-26 Thread Stefan Koch via Digitalmars-d
On Thursday, 27 October 2016 at 02:36:13 UTC, Stefam Koch wrote: Trivial. Fix is comeing. Okay it was less trivial then it should have been. Great job gcc.

Re: The build is broken when using gcc 6

2016-10-26 Thread Stefan Koch via Digitalmars-d
On Thursday, 27 October 2016 at 05:15:26 UTC, deadalnix wrote: On Thursday, 27 October 2016 at 04:41:38 UTC, Stefan Koch wrote: On Thursday, 27 October 2016 at 04:39:03 UTC, mogu wrote: On Thursday, 27 October 2016 at 04:33:30 UTC, Stefan Koch wrote: On Thursday, 27 October 2016 at 02:36:13

Re: Fun: Shooting yourself in the foot in D

2016-10-27 Thread Stefan Koch via Digitalmars-d
On Thursday, 27 October 2016 at 19:59:09 UTC, Steven Schveighoffer wrote: On 10/27/16 3:49 PM, Ali Çehreli wrote: http://www.toodarkpark.org/computers/humor/shoot-self-in-foot.html Some entries for reference: C - You shoot yourself in the foot. - You shoot yourself in the foot and then

Re: The build is broken when using gcc 6

2016-10-27 Thread Stefan Koch via Digitalmars-d
On Thursday, 27 October 2016 at 23:49:49 UTC, deadalnix wrote: On Thursday, 27 October 2016 at 05:25:49 UTC, Stefan Koch wrote: https://github.com/dlang/dmd/pull/6215 PR is open. Pending review and merge. Although if you ask me this is a no-brainer. It's now merged, thanks Stefan. No

Re: calling convention optimisation & const/immutable ref

2016-11-07 Thread Stefan Koch via Digitalmars-d
On Monday, 7 November 2016 at 21:45:42 UTC, John Colvin wrote: On Monday, 7 November 2016 at 20:23:37 UTC, Jacob Carlborg wrote: Since D is a systems programming language, wouldn't the user want to have control over this? It's just another optimisation in a long list of optimisations that

Re: Paging Walter Bright: Contextual Keywords

2016-11-07 Thread Stefan Koch via Digitalmars-d
On Monday, 7 November 2016 at 04:32:52 UTC, deadalnix wrote: On Monday, 7 November 2016 at 03:33:47 UTC, Meta wrote: Hello Walter, I'm currently working on a DIP on the topic of either removing or replacing the `body` keyword in D's contract programming syntax. I've found that the best

Re: CTFE Status

2016-11-07 Thread Stefan Koch via Digitalmars-d
On Saturday, 5 November 2016 at 20:57:06 UTC, Andrei Alexandrescu wrote: On 11/4/16 9:21 PM, Stefan Koch wrote: I thought about it some more, and decided that I will replace the old interpreter completely in the long run. However in order to get something release before 2017, I have to rely

Re: CTFE Status

2016-11-07 Thread Stefan Koch via Digitalmars-d
On Sunday, 6 November 2016 at 15:31:24 UTC, Stefan Koch wrote: Phobos and druntime unittests do compile now. After the ability for returning errors is added all unitests will be passed. (Most likely if there are not more bugs inside the engine) I just have just implemented the ability to

Re: CTFE Status

2016-11-08 Thread Stefan Koch via Digitalmars-d
Back to CTFE. The 64Bit bug is fixed. And now there is one bailout-line less. I am onto the next bug. Let's hunt them all down!

Re: Is the following code legal?

2016-11-08 Thread Stefan Koch via Digitalmars-d
On Wednesday, 9 November 2016 at 05:00:28 UTC, Shachar Shemesh wrote: On 08/11/16 17:41, Kagamin wrote: no Is this officially declared in the policy? Should I open an issue? Shachar Please open an issue.

Re: CTFE Status

2016-11-09 Thread Stefan Koch via Digitalmars-d
On Tuesday, 8 November 2016 at 21:56:32 UTC, Stefan Koch wrote: Back to CTFE. The 64Bit bug is fixed. And now there is one bailout-line less. I am onto the next bug. Let's hunt them all down! More 64bit bugs appeared that were shadowed by the one I fixed. Also a new bugs related to labeled

Re: CTFE Status

2016-11-09 Thread Stefan Koch via Digitalmars-d
After the bad news now a bit of good news. I just finished the strCat algorithm; The reason this took so much time is because of the representation the heap has in the elevator. it is a uint[] meaning you are getting into trouble with offsets if the first string is not a multiple of 4

Re: [OT] Re: CTFE Status

2016-11-09 Thread Stefan Koch via Digitalmars-d
On Thursday, 10 November 2016 at 04:22:10 UTC, Nick Sabalausky wrote: On 11/08/2016 11:40 PM, Chris Wright wrote: On Tue, 08 Nov 2016 11:44:50 -0500, Nick Sabalausky wrote: I really wish Google would take that to heart. They seem to make a habit of ripping things out *before* having

Re: calling convention optimisation & const/immutable ref

2016-11-07 Thread Stefan Koch via Digitalmars-d
On Monday, 7 November 2016 at 23:19:18 UTC, John Colvin wrote: On Monday, 7 November 2016 at 22:46:57 UTC, Stefan Koch wrote: On Monday, 7 November 2016 at 21:45:42 UTC, John Colvin wrote: On Monday, 7 November 2016 at 20:23:37 UTC, Jacob Carlborg wrote: Since D is a systems programming

Re: CTFE Status

2016-11-07 Thread Stefan Koch via Digitalmars-d
On Monday, 7 November 2016 at 14:13:04 UTC, Stefan Koch wrote: On Monday, 7 November 2016 at 10:02:37 UTC, Stefan Koch wrote: On Sunday, 6 November 2016 at 22:07:05 UTC, Stefan Koch wrote: On Sunday, 6 November 2016 at 15:31:24 UTC, Stefan Koch wrote: Phobos and druntime unittests do compile

Re: CTFE Status

2016-11-10 Thread Stefan Koch via Digitalmars-d
On Thursday, 10 November 2016 at 20:15:49 UTC, Jonathan M Davis wrote: On Thursday, November 10, 2016 18:40:03 Stefan Koch via Digitalmars-d wrote: On Thursday, 10 November 2016 at 01:17:48 UTC, Stefan Koch wrote: > After the bad news now a bit of good news. > I just finished the

Re: CTFE Status

2016-11-10 Thread Stefan Koch via Digitalmars-d
On Thursday, 10 November 2016 at 01:17:48 UTC, Stefan Koch wrote: After the bad news now a bit of good news. I just finished the strCat algorithm; [...] As expected this code is slightly wrong and will fail on the offset == 3 case. It will need a little bit of tinkering until it's ready to

Re: CTFE Status

2016-11-04 Thread Stefan Koch via Digitalmars-d
On Friday, 4 November 2016 at 10:59:25 UTC, Marc Schütz wrote: In this case better make sure to remove the resulting dead code from the old interpreter, otherwise it will become and unmaintainable mess in the long run. If you ask me the old interpreter is already an unmaintainble mess. It

Re: CTFE Status

2016-11-05 Thread Stefan Koch via Digitalmars-d
On Saturday, 5 November 2016 at 03:01:48 UTC, ketmar wrote: On Friday, 4 November 2016 at 10:59:25 UTC, Marc Schütz wrote: In this case better make sure to remove the resulting dead code from the old interpreter, otherwise it will become and unmaintainable mess in the long run. interpreter

Re: CTFE Status

2016-11-07 Thread Stefan Koch via Digitalmars-d
On Sunday, 6 November 2016 at 22:07:05 UTC, Stefan Koch wrote: On Sunday, 6 November 2016 at 15:31:24 UTC, Stefan Koch wrote: Phobos and druntime unittests do compile now. After the ability for returning errors is added all unitests will be passed. (Most likely if there are not more bugs

Re: CTFE Status

2016-11-07 Thread Stefan Koch via Digitalmars-d
On Monday, 7 November 2016 at 10:02:37 UTC, Stefan Koch wrote: On Sunday, 6 November 2016 at 22:07:05 UTC, Stefan Koch wrote: On Sunday, 6 November 2016 at 15:31:24 UTC, Stefan Koch wrote: Phobos and druntime unittests do compile now. After the ability for returning errors is added all

Re: Can you shrink it further?

2016-10-10 Thread Stefan Koch via Digitalmars-d
On Monday, 10 October 2016 at 15:17:05 UTC, Stefan Koch wrote: On Monday, 10 October 2016 at 03:55:17 UTC, Andrei Alexandrescu wrote: Oh, forgot to mention: the initial/short path should only check for ASCII, i.e. c < 0x80. -- Andrei Since in this case stability of min is concern, you can

Re: core.intrinsics

2016-10-14 Thread Stefan Koch via Digitalmars-d
On Friday, 14 October 2016 at 04:44:46 UTC, Patrick Schluter wrote: core.hints short and simple core.hints ? That sounds to weak. If I tell the compiler to group function a and function b together and position them as close as possible to each other it damn well better do it. Because If I

Re: Idea for a new tool

2016-10-14 Thread Stefan Koch via Digitalmars-d
On Friday, 14 October 2016 at 13:13:16 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=5051 -- Andrei I have been working on this. What this amounts to is an AST-writeout using the HdrGen. This will affect the code in so far as it will be lowerd my the dmd frontend.

Re: Idea for a new tool

2016-10-15 Thread Stefan Koch via Digitalmars-d
On Friday, 14 October 2016 at 18:02:24 UTC, Andrei Alexandrescu wrote: On 10/14/16 12:38 PM, Stefan Koch wrote: On Friday, 14 October 2016 at 13:13:16 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=5051 -- Andrei I have been working on this. What this amounts to is

Re: "for" statement issue

2016-10-21 Thread Stefan Koch via Digitalmars-d
On Friday, 21 October 2016 at 13:18:19 UTC, RazvanN wrote: On Friday, 21 October 2016 at 12:34:58 UTC, Andrei Alexandrescu wrote: [...] I am the one who raised the question. I am n00b when it comes to D language (I just started reading about it a couple of days ago) and I tried the above

Re: "for" statement issue

2016-10-21 Thread Stefan Koch via Digitalmars-d
On Friday, 21 October 2016 at 12:34:58 UTC, Andrei Alexandrescu wrote: I got a question about what happens with this code: int j; for({j=2; int d = 3; } j+d<7; {j++; d++;}) { } [...] We could restrict the initialze part to assignments only. But I am unsure of the implications. How did you

Re: "for" statement issue

2016-10-21 Thread Stefan Koch via Digitalmars-d
On Friday, 21 October 2016 at 13:42:49 UTC, Adam D. Ruppe wrote: On Friday, 21 October 2016 at 13:33:26 UTC, Stefan Koch wrote: It does create a lambda? Hmm that should not happen. I think deprecating `{ lambda }` is really the way to go. It'd fix this as well at that other FAQ at pretty low

Re: CTFE Status

2016-11-14 Thread Stefan Koch via Digitalmars-d
To more bullet points cross the border from unsupported to supported. - assignment to static array cells - long ulong arithmetic. However there is a a bug inside the code that does bounds-checking for array assignment. In rare cases it can trigger a out-bounds-error on newly created arrays.

Re: CTFE Status

2016-11-14 Thread Stefan Koch via Digitalmars-d
On Monday, 14 November 2016 at 05:27:15 UTC, Stefan Koch wrote: Assignment to Array.length works now :) the following code : uint[] makeArr() { uint[] arr; arr.length = 5; return arr; } pragma(msg, makeArr()); results in : CTFE_DEBUG_MESSAGE : building Array of Length 5 [0u, 0u,

Re: CTFE Status

2016-11-14 Thread Stefan Koch via Digitalmars-d
On Monday, 14 November 2016 at 07:57:20 UTC, Stefan Koch wrote: On Monday, 14 November 2016 at 05:27:15 UTC, Stefan Koch wrote: Assignment to Array.length works now :) the following code : uint[] makeArr() { uint[] arr; arr.length = 5; return arr; } pragma(msg, makeArr());

Re: {DMD-AST-Tool} For beginning DDMD hackers

2016-11-22 Thread Stefan Koch via Digitalmars-d
On Wednesday, 23 November 2016 at 07:11:56 UTC, ANtlord wrote: On Saturday, 12 November 2016 at 10:26:53 UTC, Stefan Koch wrote: Hi Guys, I have written a small utility called dmd-ast-tool. It can be used to quickly generate boilerplate code for dmd-ast-visitors. Originally it was only

Re: What is going on with the ubuntu/debian debacle ?

2016-11-21 Thread Stefan Koch via Digitalmars-d
On Monday, 21 November 2016 at 19:16:07 UTC, deadalnix wrote: On Monday, 21 November 2016 at 01:20:06 UTC, deadalnix wrote: This doesn't affect installation. But nothing link anymore. Ho Hi ! The .deb do NOT work. Can we get an hotfix out there ? Which deb does not work where ? I will try

Re: CTFE Status

2016-11-21 Thread Stefan Koch via Digitalmars-d
On Monday, 21 November 2016 at 19:11:58 UTC, Anonymouse wrote: On Sunday, 20 November 2016 at 09:02:30 UTC, Stefan Koch wrote: On Saturday, 19 November 2016 at 11:22:18 UTC, Stefan Koch wrote: [...] I would buy you a beer but the Internet is in the way. I appreciate the offer. During the

Re: CTFE Status

2016-11-24 Thread Stefan Koch via Digitalmars-d
On Monday, 21 November 2016 at 19:19:50 UTC, Stefan Koch wrote: On Monday, 21 November 2016 at 19:11:58 UTC, Anonymouse wrote: On Sunday, 20 November 2016 at 09:02:30 UTC, Stefan Koch wrote: On Saturday, 19 November 2016 at 11:22:18 UTC, Stefan Koch wrote: [...] I would buy you a beer but

Re: CTFE Status

2016-11-25 Thread Stefan Koch via Digitalmars-d
On Thursday, 24 November 2016 at 17:16:33 UTC, Stefan Koch wrote: I have just discovered breakage of basic operations. I will need regression tests, some time soon. Hey Guys, I fixed the regression. (At the expense, of removing more optimization) Work continues on struct and (dynamic) array

Re: OT: for (;;) {} vs while (true) {}

2016-11-25 Thread Stefan Koch via Digitalmars-d
On Friday, 25 November 2016 at 08:46:24 UTC, rikki cattermole wrote: On 25/11/2016 8:27 PM, unDEFER wrote: Why you consider only 2 options? Use "do {} while (true);" :-) The condition only executes after a single iteration. So it is not the same code flow. For an the usecase infinite-loop

Re: @trusted AKA most useless statement ever

2016-11-25 Thread Stefan Koch via Digitalmars-d
On Friday, 25 November 2016 at 10:14:46 UTC, Satoshi wrote: Simply, it should be replaced by: void safeFunc() @safe { unsafe { auto vi = doUnsafeCall(); } } @trusted functions are prohibited by d-idiom (so I don't know why are still in D). So, when I need to create a simple

Re: CTFE Status

2016-11-25 Thread Stefan Koch via Digitalmars-d
On Friday, 25 November 2016 at 09:14:16 UTC, Stefan Koch wrote: On Thursday, 24 November 2016 at 17:16:33 UTC, Stefan Koch wrote: I have just discovered breakage of basic operations. I will need regression tests, some time soon. Hey Guys, I fixed the regression. (At the expense, of removing

Re: CTFE Status

2016-11-28 Thread Stefan Koch via Digitalmars-d
On Friday, 25 November 2016 at 10:53:50 UTC, Stefan Koch wrote: On Friday, 25 November 2016 at 09:14:16 UTC, Stefan Koch wrote: On Thursday, 24 November 2016 at 17:16:33 UTC, Stefan Koch wrote: I have just discovered breakage of basic operations. I will need regression tests, some time soon.

Re: CTFE Status

2016-11-24 Thread Stefan Koch via Digitalmars-d
I have just discovered breakage of basic operations. I will need regression tests, some time soon.

Re: interest in Static Analysis for D ?

2016-11-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 November 2016 at 15:28:14 UTC, ketmar wrote: if it will be independent utility -- yes. dmdfe part -- no. It would relay on the parser of the dmdfe, and parts of dmd's semantic analysis. DMD will be much nicer to work with the facility envision. As I see it there is little

Re: Intresa in Static Analysis for D ?

2016-11-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 November 2016 at 16:50:47 UTC, Basile B. wrote: p you dont get the point. The point is when an IDE message leads you to this: http://imgur.com/a/6zLHU I really don't get it. What is actionable about that metric ?

Re: interest in Static Analysis for D ?

2016-11-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 November 2016 at 16:59:49 UTC, Dicebot wrote: On 11/15/2016 06:46 PM, Stefan Koch wrote: On Tuesday, 15 November 2016 at 16:39:22 UTC, Dicebot wrote: [ ] But I'd sincerely advise against any ad-hoc solution that is built into DMD itself. It seems I did not clearly state

Re: Intresa in Static Analysis for D ?

2016-11-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 November 2016 at 16:28:30 UTC, Basile B. wrote: On Tuesday, 15 November 2016 at 14:45:29 UTC, Stefan Koch wrote: Hi Guys, I was wondering how much interest in static analysis exists in this community . DMD already has rudimentary support for these kinds of things. cyclic

Re: interest in Static Analysis for D ?

2016-11-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 November 2016 at 16:39:22 UTC, Dicebot wrote: [ ] But I'd sincerely advise against any ad-hoc solution that is built into DMD itself. It seems I did not clearly state this. I mean to provide the general plumbing that is needed for the dmd-fe, to utilize it for static

Re: CTFE Status

2016-11-17 Thread Stefan Koch via Digitalmars-d
On Thursday, 17 November 2016 at 08:39:57 UTC, Andrea Fontana wrote: I follow this thread every day. I hope you'll write an article on dlang blog when the work will be completed :) Mike Parker is going to write an short article about it based on information I gave him via mail. I am

Re: Bug or not? "Functions cannot return a function"

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Thursday, 17 November 2016 at 03:10:33 UTC, Jonathan M Davis wrote: Regardless, optional parens are one of those features that seems really nice in some situations and gets really annoying in others, and you hit one of those spots where it's annoying. I would be feasible to only recognize

Re: CTFE Status

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Wednesday, 16 November 2016 at 14:44:06 UTC, Stefan Koch wrote: And Again a bit of bad news. Due to problems in the lowering of function arguments the implementation of strcat is delayed again. The bug does not affect strings. Since strings are not build up out of multiple

Re: Bug or not? "Functions cannot return a function"

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Thursday, 17 November 2016 at 02:15:49 UTC, Meta wrote: On Thursday, 17 November 2016 at 02:14:43 UTC, Meta wrote: On Thursday, 17 November 2016 at 01:48:51 UTC, Jonathan M Davis wrote: Well, you _can't_ return a function. You could return a function pointer or a delegate, but not a

Re: D front end implementation

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Wednesday, 16 November 2016 at 09:11:50 UTC, Timon Gehr wrote: I want to get there eventually. :) Unfortunately I haven't had a lot of time to spend on this lately. Also, DMD 2.060 has quite many annoying bugs that slow down development. Sounds to me like you should rewrite the compiler

Intresa in Static Analysis for D ?

2016-11-15 Thread Stefan Koch via Digitalmars-d
Hi Guys, I was wondering how much interest in static analysis exists in this community . DMD already has rudimentary support for these kinds of things.

Re: interest in Static Analysis for D ?

2016-11-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 November 2016 at 14:45:29 UTC, Stefan Koch wrote: Hi Guys, I was wondering how much interest in static analysis exists in this community . DMD already has rudimentary support for these kinds of things. Whoops I accidentally pressed enter too soon. I am currently working on

Re: CTFE Status

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Wednesday, 16 November 2016 at 09:22:01 UTC, Stefan Koch wrote: On Tuesday, 15 November 2016 at 23:46:51 UTC, Stefan Koch wrote: I suspect that somewhere the heapPtr is not bumped or the length is not set correctly. Indeed the length was not set on a code-path meant for resizeing. The

Re: CTFE Status

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Wednesday, 16 November 2016 at 09:45:24 UTC, Stefan Koch wrote: Here is a small demostration of the performance increase : [root@localhost dmd]# time src/dmd -c testSettingArrayLength.d > x 2> x real0m0.199s user0m0.180s sys 0m0.017s [root@localhost dmd]# time src/dmd -c

Re: CTFE Status

2016-11-16 Thread Stefan Koch via Digitalmars-d
Here is a small demostration of the performance increase : [root@localhost dmd]# time src/dmd -c testSettingArrayLength.d > x 2> x real0m0.199s user0m0.180s sys 0m0.017s [root@localhost dmd]# time src/dmd -c testSettingArrayLength.d -bc-ctfe > x 2> x real0m0.072s user

Re: CTFE Status

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 November 2016 at 23:46:51 UTC, Stefan Koch wrote: On Tuesday, 15 November 2016 at 22:50:49 UTC, deadalnix wrote: On Tuesday, 15 November 2016 at 01:35:42 UTC, Stefan Koch wrote: However there is a a bug inside the code that does bounds-checking for array assignment. In rare

Re: interest in Static Analysis for D ?

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Wednesday, 16 November 2016 at 10:45:54 UTC, Dicebot wrote: On 11/15/2016 07:05 PM, Stefan Koch wrote: [...] It's a compiler frontend. Very good observation :P I cannot see any other purposes then code-analysis and code-transformation. Regarding Transformations I wanted to write a

Re: CTFE Status

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Wednesday, 16 November 2016 at 10:07:06 UTC, Stefan Koch wrote: A more accurate breakdown : Initializing Heap: 18.6 ms Generating Bytecode:1.2 ms Executing Bytecode:13.2 ms Converting to CTFE-EXp: 9.1 ms For a second execution of the same function with the same arguments

Re: CTFE Status

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Wednesday, 16 November 2016 at 10:25:30 UTC, Stefan Koch wrote: First Execution (cold cache) : Initializing Heap: 17.4 ms Generating Bytecode:0.7 ms Executing Bytecode: 5.3 ms Converting to CTFE-EXp: 5.1 ms Second run (warmer cache) : Initializing Heap: 16.9 ms Generating

Re: Intresa in Static Analysis for D ?

2016-11-16 Thread Stefan Koch via Digitalmars-d
On Wednesday, 16 November 2016 at 14:06:16 UTC, Basile B. wrote: On Tuesday, 15 November 2016 at 14:45:29 UTC, Stefan Koch wrote: Hi Guys, I was wondering how much interest in static analysis exists in this community . DMD already has rudimentary support for these kinds of things. By the

Re: CTFE Status

2016-11-18 Thread Stefan Koch via Digitalmars-d
On Thursday, 17 November 2016 at 09:19:57 UTC, Stefan Koch wrote: On Thursday, 17 November 2016 at 08:39:57 UTC, Andrea Fontana wrote: I follow this thread every day. I hope you'll write an article on dlang blog when the work will be completed :) Mike Parker is going to write an short

Re: CTFE Status

2016-11-18 Thread Stefan Koch via Digitalmars-d
On Friday, 18 November 2016 at 15:09:02 UTC, Stefan Koch wrote: I just fixed the bug with multiple ArraysLiterals as arguments. This means the following code will now compile and properly execute: uint Sum3Arrays (uint[] a1, uint[] a2, uint[] a3) { uint result; for(int i; i != a1.length;

Re: CTFE Status

2016-11-18 Thread Stefan Koch via Digitalmars-d
On Friday, 18 November 2016 at 17:21:10 UTC, Stefan Koch wrote: On Friday, 18 November 2016 at 15:09:02 UTC, Stefan Koch wrote: I just fixed the bug with multiple ArraysLiterals as arguments. This means the following code will now compile and properly execute: uint Sum3Arrays (uint[] a1,

Re: {DMD-AST-Tool} For beginning DDMD hackers

2016-11-18 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 November 2016 at 11:31:01 UTC, Dicebot wrote: You may want to consider adding it to https://github.com/dlang/tools Yes, I will make it a little more user friendly, then I'll raise a PR.

Re: CTFE Status

2016-11-19 Thread Stefan Koch via Digitalmars-d
Another small update. I got rid of the heapClearing overhead. By using ddmds allocator. Because of that I was able to shave off 20ms overhead.

Re: CTFE Status

2016-11-19 Thread Stefan Koch via Digitalmars-d
On Saturday, 19 November 2016 at 09:42:33 UTC, Stefan Koch wrote: Another small update. I got rid of the heapClearing overhead. By using ddmds allocator. Because of that I was able to shave off 20ms overhead. Allocation of dynamic arrays works :) The following code will work just fine with the

Re: D front end implementation

2016-11-18 Thread Stefan Koch via Digitalmars-d
On Friday, 18 November 2016 at 12:50:30 UTC, Rainer Schuetze wrote: On 18.11.2016 12:39, Stefan Koch wrote: On Friday, 18 November 2016 at 11:37:40 UTC, Rainer Schuetze wrote: On 18.11.2016 11:33, Stefan Koch wrote: On Friday, 18 November 2016 at 10:18:21 UTC, Rainer Schuetze wrote:

Re: Any AST experts n da house?

2016-11-17 Thread Stefan Koch via Digitalmars-d
On Thursday, 17 November 2016 at 14:10:01 UTC, Andrei Alexandrescu wrote: Lucia is working on https://issues.dlang.org/show_bug.cgi?id=16683 which shows good promise in cleaning the cobwebs around Typeinfo. She looked into matters and figured she needs to have TypeidExp.semantic() return the

Re: Any AST experts n da house?

2016-11-17 Thread Stefan Koch via Digitalmars-d
On Thursday, 17 November 2016 at 14:11:50 UTC, Stefan Koch wrote: On Thursday, 17 November 2016 at 14:10:01 UTC, Andrei Alexandrescu wrote: auto tidSymbol = new Dsymbol(new Identifier("__typeidImplT")); Andrei I am looking into it. DSymbol is an abstract class. It is not meant to

Re: D front end implementation

2016-11-18 Thread Stefan Koch via Digitalmars-d
On Friday, 18 November 2016 at 11:37:40 UTC, Rainer Schuetze wrote: On 18.11.2016 11:33, Stefan Koch wrote: On Friday, 18 November 2016 at 10:18:21 UTC, Rainer Schuetze wrote: I'm looking for candidates that might replace the semantic engine in Visual D, as D_Parser is unlikely to be

Re: D front end implementation

2016-11-17 Thread Stefan Koch via Digitalmars-d
On Thursday, 17 November 2016 at 22:46:33 UTC, Timon Gehr wrote: On 17.11.2016 22:41, John Colvin wrote: On Thursday, 17 November 2016 at 21:39:15 UTC, Timon Gehr wrote: On 17.11.2016 03:52, Stefan Koch wrote: On Wednesday, 16 November 2016 at 09:11:50 UTC, Timon Gehr wrote: I want to get

Re: D front end implementation

2016-11-18 Thread Stefan Koch via Digitalmars-d
On Friday, 18 November 2016 at 10:18:21 UTC, Rainer Schuetze wrote: I'm looking for candidates that might replace the semantic engine in Visual D, as D_Parser is unlikely to be developed further at the moment. Hmm I plan on cleaning DDMD up a bunch. Any chance you could use the DDMD

Re: D with CygWin

2016-11-18 Thread Stefan Koch via Digitalmars-d
On Friday, 18 November 2016 at 10:43:09 UTC, unDEFER wrote: [...] You have to link with the cygwin.dll to get the symbols. That is not not done by default I presume.

Re: {DMD-AST-Tool} For beginning DDMD hackers

2016-11-13 Thread Stefan Koch via Digitalmars-d
On Saturday, 12 November 2016 at 10:26:53 UTC, Stefan Koch wrote: Hi Guys, I have written a small utility called dmd-ast-tool. It can be used to quickly generate boilerplate code for dmd-ast-visitors. Originally it was only written for my personal use, it used to work with a handwritten

Re: CTFE Status

2016-11-11 Thread Stefan Koch via Digitalmars-d
On Thursday, 10 November 2016 at 20:51:01 UTC, Stefan Koch wrote: On Thursday, 10 November 2016 at 20:15:49 UTC, Jonathan M Davis wrote: On Thursday, November 10, 2016 18:40:03 Stefan Koch via Digitalmars-d wrote: On Thursday, 10 November 2016 at 01:17:48 UTC, Stefan Koch wrote: > Af

Re: CTFE Status

2016-11-20 Thread Stefan Koch via Digitalmars-d
On Saturday, 19 November 2016 at 11:22:18 UTC, Stefan Koch wrote: On Saturday, 19 November 2016 at 09:42:33 UTC, Stefan Koch wrote: Another small update. I got rid of the heapClearing overhead. By using ddmds allocator. Because of that I was able to shave off 20ms overhead. Allocation of

Re: CTFE C compiler

2016-11-21 Thread Stefan Koch via Digitalmars-d
On Monday, 21 November 2016 at 10:41:27 UTC, Johan Engelen wrote: In LLVMweekly [1], I read the following: "You may be be interested, amazed, and/or horrified to learn of constexpr-8cc [2]. It provides a compile-time C compiler implemented as C++14 constant expressions." The constexpr

Re: CTFE Status

2016-11-21 Thread Stefan Koch via Digitalmars-d
On Sunday, 20 November 2016 at 16:27:24 UTC, Stefan Koch wrote: On Sunday, 20 November 2016 at 15:37:50 UTC, Stefan Koch wrote: Furthermore I need to extend my bc_tests. to make sure the interpretation is the same. Such that this bug cannot happen again. before. I have extended my test-suite

Re: CTFE Status

2016-11-20 Thread Stefan Koch via Digitalmars-d
On Sunday, 20 November 2016 at 09:02:30 UTC, Stefan Koch wrote: On Saturday, 19 November 2016 at 11:22:18 UTC, Stefan Koch wrote: On Saturday, 19 November 2016 at 09:42:33 UTC, Stefan Koch wrote: Another small update. I got rid of the heapClearing overhead. By using ddmds allocator. Because of

Re: CTFE Status

2016-11-20 Thread Stefan Koch via Digitalmars-d
On Sunday, 20 November 2016 at 15:37:50 UTC, Stefan Koch wrote: Furthermore I need to extend my bc_tests. to make sure the interpretation is the same. Such that this bug cannot happen again. I have extended my test-suite to test this case. It is crucial that the c backend and the interpreter

Re: CTFE Status

2016-11-21 Thread Stefan Koch via Digitalmars-d
On Monday, 21 November 2016 at 10:51:01 UTC, Stefan Koch wrote: When writing do { ... } while(true/false) The IR generated would tell the interpreter to evaluate the condition flag. This Bug is now fixed. At the same time a superfluous jump could be eliminated. I have also fixed another bug

Re: CTFE Status

2016-11-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 November 2016 at 22:50:49 UTC, deadalnix wrote: On Tuesday, 15 November 2016 at 01:35:42 UTC, Stefan Koch wrote: However there is a a bug inside the code that does bounds-checking for array assignment. In rare cases it can trigger a out-bounds-error on newly created arrays.

{DMD-AST-Tool} For beginning DDMD hackers

2016-11-12 Thread Stefan Koch via Digitalmars-d
Hi Guys, I have written a small utility called dmd-ast-tool. It can be used to quickly generate boilerplate code for dmd-ast-visitors. Originally it was only written for my personal use, it used to work with a handwritten text-file representing dmds ast class hierarchy. However I recently

Re: CTFE Status

2016-11-13 Thread Stefan Koch via Digitalmars-d
Assignment to Array.length works now :) the following code : uint[] makeArr() { uint[] arr; arr.length = 5; return arr; } pragma(msg, makeArr()); results in : CTFE_DEBUG_MESSAGE : building Array of Length 5 [0u, 0u, 0u, 0u, 0u]

Re: Pattern matching in D?

2016-10-21 Thread Stefan Koch via Digitalmars-d
On Friday, 21 October 2016 at 02:16:44 UTC, Chris M. wrote: So I know you can do some pattern matching with templates in D, but has there been any discussion about implementing it as a language feature, maybe something similar to Rust's match keyword

Re: CTFE and minimizing the GC

2016-10-31 Thread Stefan Koch via Digitalmars-d
On Monday, 31 October 2016 at 20:23:13 UTC, Jacob Carlborg wrote: One of the big features of D and a feature that is show cased is CTFE. The regex module and the PEG parser generator are projects that are often mentioned when talking about what CTFE can do. One of the, or _the_, major goal

Re: CTFE Status

2016-11-01 Thread Stefan Koch via Digitalmars-d
On Monday, 31 October 2016 at 20:49:58 UTC, Steven Schveighoffer wrote: On 10/31/16 9:29 AM, Stefan Koch wrote: Hi Guys, since I got a few complaints about giving minor status updates in the announce group, I am opening this thread. I will start with giving an overview of what works and what

Re: CTFE Status

2016-11-01 Thread Stefan Koch via Digitalmars-d
On Tuesday, 1 November 2016 at 16:44:14 UTC, Nordlöw wrote: On Monday, 31 October 2016 at 13:29:01 UTC, Stefan Koch wrote: These are the constructs that will work. - foreach on static arrays strings and range-foreach (those kinds (0 .. 64)). - switches (even deeply nested ones) - for and

Re: CTFE Status

2016-11-01 Thread Stefan Koch via Digitalmars-d
On Tuesday, 1 November 2016 at 15:50:06 UTC, Stefan Koch wrote: Very recent news: NEW CTFE PASSES THE DRUNTIME UNITESTS Now a phobos unittest miscompiles :( Again passing the unittests does not mean too much. I just means I bail out before I generate invalid code :)

Re: CTFE Status

2016-11-02 Thread Stefan Koch via Digitalmars-d
On Tuesday, 1 November 2016 at 21:12:06 UTC, Nordlöw wrote: On Tuesday, 1 November 2016 at 19:28:03 UTC, Stefan Koch wrote: Now a phobos unittest miscompiles :( Again passing the unittests does not mean too much. I just means I bail out before I generate invalid code :) Keep up! I am now

CTFE Status

2016-10-31 Thread Stefan Koch via Digitalmars-d
Hi Guys, since I got a few complaints about giving minor status updates in the announce group, I am opening this thread. I will start with giving an overview of what works and what does not work. Currently the only basic type you can do arithmetic on is int. Altough you can compare longs

Re: CTFE Status

2016-11-03 Thread Stefan Koch via Digitalmars-d
On Thursday, 3 November 2016 at 15:44:20 UTC, Marc Schütz wrote: On Tuesday, 1 November 2016 at 17:41:35 UTC, Stefan Koch wrote: I intend to keep the current implemntation around as a fallback. For things that are used rarely. like floating point and others :) Is that a good idea? It means

Re: If Statement with Declaration

2016-11-03 Thread Stefan Koch via Digitalmars-d
On Thursday, 3 November 2016 at 22:29:34 UTC, Jerry wrote: So I was thinking of a way of extending if statements that have declarations. The following being as example of the current use of if statements with declarations: [...] Just Introduce another block { int i = someFunc(); if (i

Re: CTFE Status

2016-11-02 Thread Stefan Koch via Digitalmars-d
On Wednesday, 2 November 2016 at 23:48:46 UTC, Nordlöw wrote: On Wednesday, 2 November 2016 at 11:01:55 UTC, Stefan Koch wrote: I am now passing phobos unittests! I can't wait to see this in action! Keep on going and I'll keep praying...  No need for prayer. I am trying my best to be

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 14:24:56 UTC, Andrei Alexandrescu wrote: On 10/11/2016 03:30 AM, Matthias Bentrup wrote: A branch-free version: void popFront4(ref char[] s) @trusted pure nothrow { immutable c = s[0]; uint char_length = 1 + (c >= 192) + (c >= 240) + (c >= 248); s =

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 14:49:28 UTC, Matthias Bentrup wrote: This is the result I'd like to get, but I can't find a way to write it without inline assembly :( void popFrontAsmIntel(ref char[] s) @trusted pure nothrow { immutable c = s[0]; if (c < 0x80) { s = s[1 .. $]; }

<    1   2   3   4   5   6   7   8   9   10   >