Re: Lexical, Syntatic and Semantic Merge of D Source Code

2014-07-13 Thread Stefan Koch via Digitalmars-d
On Saturday, 12 July 2014 at 10:08:35 UTC, Joakim wrote: It's a good idea, something I've thought would be nice before, and a first step towards the Dfix concept Andrei has endorsed: There is something I found a great insperation is coccinelle http://coccinelle.lip6.fr/ it looks like a

Re: Value Range Propigation Spec

2014-10-24 Thread Stefan Koch via Digitalmars-d
Hi, I am the guy who implemented the (currently incomplete) vrp for sdc. I see vrp as a tool to avoid _unnecessary_ casts. _Not_ as means to avoid _all_ casts. void main(in string[] args) { immutable size_t len = args.length % 10; ubyte x = len; ubyte[] a; foreach (immutable

Re: Value Range Propigation Spec

2014-10-24 Thread Stefan Koch via Digitalmars-d
you are right. I misread the code-snippt above. Of course this is staticly checkable!

Re: 'int' is enough for 'length' to migrate code from x86 to x64

2014-11-21 Thread Stefan Koch via Digitalmars-d
On Friday, 21 November 2014 at 09:37:50 UTC, Walter Bright wrote: I thought everyone hated foreach_reverse! I dislike foreach_reverse; 1. it's a keyword with an underscore in it; 2. complicates implementation of foreach and parsing. 3. key_word with under_score

Re: D Meetup in Berlin

2014-12-06 Thread Stefan Koch via Digitalmars-d
Nice! I will have to see if I can make it. BTW. is sociomantic still hiring ?

Re: Do everything in Java…

2014-12-06 Thread Stefan Koch via Digitalmars-d
Unittests are great to avoid regressions. Unitests give confidence. You can do radical changes to your codebase much easier if you know, that nothing breaks because of it. I not a fan of TDD. But I like it that I know directly that there are no regressions.

Which optimisations are are easier or perhaps only possible in the frontend ?

2014-12-10 Thread Stefan Koch via Digitalmars-d
Hello guys, I want to work on optimisations in the semantic analysis stage. Could you chime in with thoughts about what can only be there and not in llvm-ir for example ? Thanks Stefan

Re: No runtime attribute?

2014-12-10 Thread Stefan Koch via Digitalmars-d
On Wednesday, 10 December 2014 at 10:46:58 UTC, bearophile wrote: The #[no_std] attribute is used to avoid the runtime in Rust. Do we have any use for a @noruntime attribute in D? All @noruntime functions are also @nogc (so you don't need to put both attributes). This could give a

Re: Which optimisations are are easier or perhaps only possible in the frontend ?

2014-12-10 Thread Stefan Koch via Digitalmars-d
On Wednesday, 10 December 2014 at 14:02:43 UTC, Daniel Murphy wrote: DMD's inliner might be a good place to start. There is a lot to be done there. I am sure that would be interesting. But I gather PR's for DMD are not merged too frequently.

Re: Which optimisations are are easier or perhaps only possible in the frontend ?

2014-12-10 Thread Stefan Koch via Digitalmars-d
Could we come back to the topic ? :)

Re: Which optimisations are are easier or perhaps only possible in the frontend ?

2014-12-11 Thread Stefan Koch via Digitalmars-d
On Thursday, 11 December 2014 at 10:59:24 UTC, Daniel Murphy wrote: Why? If the inliner is out because of DMD's merging process, then so is the rest of the frontend. It is not out! But my question was not about dmd specific things, I meant it more generally.

Re: Which optimisations are are easier or perhaps only possible in the frontend ?

2014-12-11 Thread Stefan Koch via Digitalmars-d
On Thursday, 11 December 2014 at 12:20:50 UTC, Manu via Digitalmars-d wrote: I've often thought one of the biggest wins that would seem to affect my code would be comprehensive value range propagation. assert's and contracts can give value range information to the compiler, also comparison

Re: Which optimisations are are easier or perhaps only possible in the frontend ?

2014-12-11 Thread Stefan Koch via Digitalmars-d
On Friday, 12 December 2014 at 00:20:30 UTC, deadalnix wrote: More generally, you don't want to optimize anything in the frontend: - It is gonna create unscrutable code for debug. - You optimize before inlining, and so won't get the optimization allowed by inlining. You want to add

Re: Renaming DMD File Extensions from C to C++

2015-02-08 Thread Stefan Koch via Digitalmars-d
On Tuesday, 3 February 2015 at 01:33:32 UTC, deadalnix wrote: On Tuesday, 3 February 2015 at 00:59:26 UTC, Andrei Alexandrescu wrote: On 2/2/15 4:23 PM, eles wrote: On Monday, 2 February 2015 at 21:51:42 UTC, Nordlöw wrote: Can we please change the file extensions in DMD from .c to .cpp for

Re: Using import in map

2015-01-31 Thread Stefan Koch via Digitalmars-d
On Saturday, 31 January 2015 at 19:52:11 UTC, Jacob Carlborg wrote: Is this supposed to work: enum foo = [foo].map!((string e) = import(e)); When I compile the above code with 2.066.1 I get the following error: main.d(1): Error: variable e cannot be read at compile time main.d(1): Error:

Re: Is anyone working on a D source code formatting tool?

2015-01-11 Thread Stefan Koch via Digitalmars-d
I'm powerful writing a parser-generator, that will be able to transform the generated parse-tree back into source automatically. writing a rule-based formatter should be pretty doable.

pureity of closures

2015-03-22 Thread Stefan Koch via Digitalmars-d
dmd infers function closures impure if impure functions are defined within them. even if those are never called and can never be accessed outside of the closure. Example : int a; void closure() pure { impure_function() { a++; } } t.d(4): Error: pure function

Re: pureity of closures

2015-03-22 Thread Stefan Koch via Digitalmars-d
On Sunday, 22 March 2015 at 19:06:33 UTC, ketmar wrote: hm. i missed this part (about dead code). compiler doesn't do dead nested function removal before semantic analysis, afair, and attribute inference is in semantic stage. yet you can cheat compiler by turning `impure_function()` to

Re: pureity of closures

2015-03-22 Thread Stefan Koch via Digitalmars-d
On Sunday, 22 March 2015 at 18:24:31 UTC, ketmar wrote: you can't do anything with `impure_function` anyway. Precisely my point! a perfectly pure function is inferred impure because of dead code!

Re: pureity of closures

2015-03-24 Thread Stefan Koch via Digitalmars-d
On Monday, 23 March 2015 at 09:45:41 UTC, Dicebot wrote: I think this was not intended and is simply a side effect of limited D call graph analysis. Relaxing that limitation makes sense to me because unused impure function can be used for compile-time reflection or returned from pure function

Re: pureity of closures

2015-03-29 Thread Stefan Koch via Digitalmars-d
On Friday, 27 March 2015 at 17:47:26 UTC, H. S. Teoh wrote: What I'm more concerned about is whether the current compiler implementation may accidentally allow leakage of the pure function's internal context, which would break purity. T please explain your reasoning with a bit of example

Re: Last week for DConf 2015 submissions

2015-03-01 Thread Stefan Koch via Digitalmars-d
+1 for the compiler-dev table. I'd be happy to take part on that.

Re: pureity of closures

2015-03-27 Thread Stefan Koch via Digitalmars-d
On Friday, 27 March 2015 at 14:29:05 UTC, Shammah Chancellor wrote: Pure functions returning impure functions. *BOOM* My brain just exploded. -Shammah I am not sure when this would happen, but why disallow it ?

Re: pureity of closures

2015-03-23 Thread Stefan Koch via Digitalmars-d
On Sunday, 22 March 2015 at 21:21:59 UTC, ketmar wrote: i believe that both ways is right (i.e. both generating error and not generating error). I am sorry but, this is not an helpful answer. I will stick to my callgraph analysis for now.

why are opCmp and opEquals not pure.

2015-09-17 Thread Stefan Koch via Digitalmars-d
Hi, is there any reason why opCmp and opEquals are not pure ? I would argue it is very counter-intuitive to mutate any state when comparing objects. opCmp and opEquals not being annotated pure is a major problem for me in writing ctfe-able code. since any call to Object.opEquals need to be

Re: why are opCmp and opEquals not pure.

2015-09-17 Thread Stefan Koch via Digitalmars-d
On Thursday, 17 September 2015 at 19:47:05 UTC, Timon Gehr wrote: I don't get this point. You don't need any annotations to write ctfe-able code. ctfe only works with pure functions. annotating your functions with the pure attribute helps you to pinpoint problems early. without having to do

Re: D could catch this wave: web assembly

2015-12-24 Thread Stefan Koch via Digitalmars-d
On Thursday, 18 June 2015 at 08:05:48 UTC, John Colvin wrote: This appears to have involvement from all major browser vendors, which provides hope it might actually catch on properly. An llvm backend will be created which will compile to "wasm", hopefully LDC and/or SDC could glue to this.

Re: C++ to add import, module and export

2015-11-25 Thread Stefan Koch via Digitalmars-d
On Wednesday, 25 November 2015 at 15:30:30 UTC, Daniel Murphy wrote: On 25/11/2015 11:53 AM, deadalnix wrote: On Tuesday, 24 November 2015 at 23:14:28 UTC, deadalnix wrote: According to this: https://www.youtube.com/watch?v=RwdQA0pGWa4 There are plan to add these keyword in C++'s module

Improving DMD's memory management

2016-06-03 Thread Stefan Koch via Digitalmars-d
Hi, I just saw something in the Vision 2016 H2 Document, which is very dear to me. Improving the Memory Management in the compiler. I think we need at least three different allocation primitives. One for allocating Temporary Memory to which no one should keep references that have a longer

Re: Lifetime tracking

2016-06-02 Thread Stefan Koch via Digitalmars-d
On Friday, 3 June 2016 at 00:31:31 UTC, Walter Bright wrote: If they cover the cases that matter, it's good. Rust has the type system annotations you want, but Rust has a reputation for being difficult to write code for. I think we can incorporate typesafe borrowing without making it

Re: Lifetime tracking

2016-06-02 Thread Stefan Koch via Digitalmars-d
On Thursday, 2 June 2016 at 23:05:40 UTC, Timon Gehr wrote: On 03.06.2016 00:29, Walter Bright wrote: On 6/2/2016 3:10 PM, Marco Leise wrote: we haven't looked into borrowing/scoped enough That's my fault. As for scoped, the idea is to make scope work analogously to DIP25's 'return ref'. I

Re: Passing private functions to template algorithms

2016-06-07 Thread Stefan Koch via Digitalmars-d
On Tuesday, 7 June 2016 at 18:59:03 UTC, Timon Gehr wrote: I think it is obvious that this should work. Visibility checks need to happen during identifier lookup. This lookup is happening in the module where isFileNothrow is visible. I agree with you. However something in the back of my

Long Symbol names

2016-06-07 Thread Stefan Koch via Digitalmars-d
Hi, I just wanted to tell you that I am taking a shot at solving this issue. It is critical not to produce such long mangles in the first place instead of compressing after the fact. The name blow-up after this fix will still be exponential. (I guess.) However with a much much smaller n.

Re: Passing private functions to template algorithms

2016-06-07 Thread Stefan Koch via Digitalmars-d
On Wednesday, 8 June 2016 at 00:58:41 UTC, deadalnix wrote: On Wednesday, 8 June 2016 at 00:48:00 UTC, Stefan Koch wrote: I agree with you. However something in the back of my mind tells me that we'll be hitting nasty corner cases if we change the behavior. Unless you can provide such corner

Re: D's memory-hungry templates

2016-06-10 Thread Stefan Koch via Digitalmars-d
On Friday, 10 June 2016 at 11:09:58 UTC, maik klein wrote: Not in a presentable form, I still have a framework on my other machine. I basically generated new D files from within D and then compiled them using ldc/dmd. I could clean it up and upload it when I have some time. Yes please.

Re: Improving DMD's memory management

2016-06-03 Thread Stefan Koch via Digitalmars-d
On Friday, 3 June 2016 at 15:04:59 UTC, Stefan Koch wrote: Hi, I just saw something in the Vision 2016 H2 Document, which is very dear to me. Improving the Memory Management in the compiler. I think we need at least three different allocation primitives. One for allocating Temporary Memory

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Stefan Koch via Digitalmars-d
On Monday, 6 June 2016 at 22:25:34 UTC, Walter Bright wrote: On 6/6/2016 9:40 AM, jmh530 wrote: Also, it's not like all energy will be poured into one or two of them - ideally several could be worked on. Consider the recent gigantic thread on autodecoding. Is anyone working on any PRs for

Re: Transient ranges

2016-05-28 Thread Stefan Koch via Digitalmars-d
On Saturday, 28 May 2016 at 17:27:17 UTC, Joseph Rushton Wakeling wrote: On Saturday, 28 May 2016 at 01:48:08 UTC, Jonathan M Davis wrote: On Friday, May 27, 2016 23:42:24 Seb via Digitalmars-d wrote: So what about the convention to explicitely declare a `.transient` enum member on a range, if

Re: Dealing with Autodecode

2016-05-31 Thread Stefan Koch via Digitalmars-d
On Wednesday, 1 June 2016 at 00:46:04 UTC, Walter Bright wrote: It is not practical to just delete or deprecate autodecode - it is too embedded into things. Which Things ? The way to deal with it is to replace reliance on autodecode with .byDchar (.byDchar has a bonus of not throwing an

Re: Transient ranges

2016-05-29 Thread Stefan Koch via Digitalmars-d
On Sunday, 29 May 2016 at 15:45:14 UTC, Joseph Rushton Wakeling wrote: What's the problem with introspecting that? There is none :) it could be implemented today.

Re: static if enhancement

2016-06-24 Thread Stefan Koch via Digitalmars-d
On Friday, 24 June 2016 at 15:34:42 UTC, Stefan Koch wrote: On Friday, 24 June 2016 at 15:24:48 UTC, Andrei Alexandrescu wrote: Does anyone else find this annoying? https://issues.dlang.org/show_bug.cgi?id=16201 -- Andrei This would mean treating static if's differently if they alter control

Re: static if enhancement

2016-06-24 Thread Stefan Koch via Digitalmars-d
On Friday, 24 June 2016 at 15:24:48 UTC, Andrei Alexandrescu wrote: Does anyone else find this annoying? https://issues.dlang.org/show_bug.cgi?id=16201 -- Andrei This would mean treating static if's differently if they alter control flow in a scope larger then themselves. Special casing a

Re: Please rid me of this goto

2016-06-23 Thread Stefan Koch via Digitalmars-d
On Thursday, 23 June 2016 at 18:05:07 UTC, Andrei Alexandrescu wrote: On 06/23/2016 01:34 PM, H. S. Teoh via Digitalmars-d wrote: I don't understand why that goto is necessary. Eh, thank you all who set me straight! I've been in my head for too long. So where is the current implementation of

Re: static if enhancement

2016-06-27 Thread Stefan Koch via Digitalmars-d
On Monday, 27 June 2016 at 22:56:41 UTC, Jonathan M Davis wrote: On Monday, June 27, 2016 18:55:48 deadalnix via Digitalmars-d wrote: On Monday, 27 June 2016 at 18:14:26 UTC, Timon Gehr wrote: > [...] Alright, I have to range myself with most here. While I'm all for not warning about

Re: Regex in ctfe?

2016-01-26 Thread Stefan Koch via Digitalmars-d
On Tuesday, 26 January 2016 at 11:35:24 UTC, Era Scarecrow wrote: On Tuesday, 26 January 2016 at 05:10:58 UTC, Manu wrote: I thought DMD was fully converted to D? The compiler could make use of std.regex if it wanted to... My experience is at least a year or two out of date; One of the

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-22 Thread Stefan Koch via Digitalmars-d
Another small update. So far ldc has the lead in my performance test ldc2 produces significantly faster results then gdc or dmd. I will have a look at the IR and see how I can "port" the optimisations it does to the sourceCode.

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-27 Thread Stefan Koch via Digitalmars-d
On Sunday, 28 February 2016 at 01:45:48 UTC, Laeeth Isharc wrote: Great project, Stefan. Any idea what kind of maximum database size will be feasible ? I realise it is early days so far and not your main focus. Laeeth The limits will be almost the same as in sqlite. So a few 100TB

Re: good form? posting semi D-related part-time contract job to announce?

2016-02-28 Thread Stefan Koch via Digitalmars-d
On Monday, 29 February 2016 at 01:05:55 UTC, Laeeth Isharc wrote: Hi. Just to check if it's good form. I'm looking for someone to help (initially) part-time with linux server admin. Happy if scripts are written in D and it's for a project where most code is in D. Is it okay to post to

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-26 Thread Stefan Koch via Digitalmars-d
On Monday, 22 February 2016 at 14:11:46 UTC, Stefan Koch wrote: Another small update. So far ldc has the lead in my performance test ldc2 produces significantly faster results then gdc or dmd. I will have a look at the IR and see how I can "port" the optimisations it does to the sourceCode.

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-26 Thread Stefan Koch via Digitalmars-d
On Friday, 26 February 2016 at 09:53:46 UTC, Stefan Koch wrote: Write support is coming! After that is finished let's see by how much I can beat sqlite dong bulk inserts. dong => doing. - anyone who wants to help bench-marking please write me. uplink DOT coder AT gmail C O M

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-27 Thread Stefan Koch via Digitalmars-d
Another update : Performance is now 3 times better then with my initial version. Tip of the Day : constantly reevaluate your design-decisions.

[WIP] Native SQLite Database reader (works at CTFE)

2016-02-18 Thread Stefan Koch via Digitalmars-d
Hello, It is not quite ready to post in Announce, but I would like to inform you that I am planing to open-source my native-sqlite database driver. (well currently it just reads them). However it works fully at CTFE. so if you want to you can extract sourceCode out of a sql-database and

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-19 Thread Stefan Koch via Digitalmars-d
On Friday, 19 February 2016 at 01:28:11 UTC, Andrei Alexandrescu wrote: That's very exciting! Are you planning a DConf talk on the topic? -- Andrei I would love to give a talk on this.

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-19 Thread Stefan Koch via Digitalmars-d
On Friday, 19 February 2016 at 06:40:08 UTC, Era Scarecrow wrote: Interesting... I'd almost want a page with the ddoc information to glance over the API, and a couple code snippets of how you'd see it working. I'll look forward to seeing this when it's out :) Well I can do that :)

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-19 Thread Stefan Koch via Digitalmars-d
On Friday, 19 February 2016 at 16:20:50 UTC, Stefan Koch wrote: On Friday, 19 February 2016 at 06:40:08 UTC, Era Scarecrow wrote: Interesting... I'd almost want a page with the ddoc information to glance over the API, and a couple code snippets of how you'd see it working. I'll look

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-21 Thread Stefan Koch via Digitalmars-d
just a small update on the API It could look something like this auto table = db.tables("personal"); auto results = table.select("name","surname").where!("age","sex", (age, sex) => sex.as!Sex == Sex.female, age.as!uint < 40)); auto names = results[0].as!string; auto surnames =

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-21 Thread Stefan Koch via Digitalmars-d
On Sunday, 21 February 2016 at 18:08:30 UTC, Chris Wright wrote: That means never using an index. How so ?

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-21 Thread Stefan Koch via Digitalmars-d
On Sunday, 21 February 2016 at 18:32:29 UTC, Chris Wright wrote: Or rather, parsing a query to use an index becomes exponential unless you parse X86 instructions. D doesn't let you access the contents of a lambda expression. (C# does.) So in order to evaluate the lambda, you have to invoke

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-21 Thread Stefan Koch via Digitalmars-d
On Sunday, 21 February 2016 at 19:55:38 UTC, Any wrote: On Sunday, 21 February 2016 at 19:21:31 UTC, Stefan Koch wrote: where n is the number of rows. That means your doing a full table scan. When the table gets large enough, this gets problematic. When the table get's large enough you

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-21 Thread Stefan Koch via Digitalmars-d
On Monday, 22 February 2016 at 02:52:41 UTC, Era Scarecrow wrote: Looks good! Although took me a little bit to notice the Lambda :P The result from names, surnames, once you access the entry it consumes it? That seems wrong. Hmmm is there a short example of how the left/right/natural

Re: [WIP] Native SQLite Database reader (works at CTFE)

2016-02-21 Thread Stefan Koch via Digitalmars-d
On Monday, 22 February 2016 at 03:33:27 UTC, Chris Wright wrote: On Sun, 21 Feb 2016 21:15:01 +, Stefan Koch wrote: On Sunday, 21 February 2016 at 19:55:38 UTC, Any wrote: On Sunday, 21 February 2016 at 19:21:31 UTC, Stefan Koch wrote: where n is the number of rows. That means your

Re: Walter, I need a __trait please.

2016-03-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 March 2016 at 08:02:34 UTC, Jaocb Carlborg wrote: On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: [...] To get the parameters as as strings, I think this [1] will allow you to that. To get the body as a string, that sounds almost as AST macros :) [1]

Re: Walter, I need a __trait please.

2016-03-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 March 2016 at 03:10:46 UTC, Nicholas Wilson wrote: On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the

Re: [Request] A way to extract all instance of X from a range

2016-03-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 March 2016 at 04:05:11 UTC, Meta wrote: I believe this should work with the latest DMD: alias castRange(T) = t => t.map!(x => cast(T) x).filter!(x => x !is null); No it does not. However this works : auto typeFilter(T, Range)(Range range) { import

Re: Walter, I need a __trait please.

2016-03-15 Thread Stefan Koch via Digitalmars-d
foreach (p;__traits(lambda, (x,y) => x < y)) { writeln(p); } would output x y x < y If something like that would be merged I can implement this now I guess. thanks for the PR link Jacob

Re: [Request] A way to extract all instance of X from a range

2016-03-14 Thread Stefan Koch via Digitalmars-d
On Monday, 14 March 2016 at 08:04:18 UTC, deadalnix wrote: Right now, I'm repeating the following pattern many times : range.map!(x => cast(Foo) x).filter!(x => x !is null) Which is kind of annoying. Could we get something in phobos to do this ? you could use an alias. alias NullFliter =

Re: [Request] A way to extract all instance of X from a range

2016-03-14 Thread Stefan Koch via Digitalmars-d
On Monday, 14 March 2016 at 08:04:18 UTC, deadalnix wrote: Right now, I'm repeating the following pattern many times : range.map!(x => cast(Foo) x).filter!(x => x !is null) Which is kind of annoying. Could we get something in phobos to do this ? There you go ;) alias castRange(T) = map!(x

Re: [Request] A way to extract all instance of X from a range

2016-03-14 Thread Stefan Koch via Digitalmars-d
On Monday, 14 March 2016 at 23:34:37 UTC, Stefan Koch wrote: On Monday, 14 March 2016 at 08:04:18 UTC, deadalnix wrote: Right now, I'm repeating the following pattern many times : range.map!(x => cast(Foo) x).filter!(x => x !is null) Which is kind of annoying. Could we get something in phobos

Walter, I need a __trait please.

2016-03-14 Thread Stefan Koch via Digitalmars-d
Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the parmeters of a lambda as AliasSequence. e.g foreach (p;__traits(lambda, (x,y) => x < y)) { writeln(p); } would output x y x < y I

Re: Deduction regression or improvement?

2016-03-08 Thread Stefan Koch via Digitalmars-d
On Tuesday, 8 March 2016 at 21:22:35 UTC, Johan Engelen wrote: Hi all, Should the following compile or not? auto foo(T)(T start, T end) {} void main() { const SomeStruct a; SomeStruct b; foo(a,b); } See http://dpaste.dzfl.pl/15581af64747 DMD 2.068.2 compiles and does not

Re: DIP81: Writing files at compile time

2016-03-08 Thread Stefan Koch via Digitalmars-d
On Wednesday, 12 August 2015 at 18:37:40 UTC, JDemler wrote: Triggered by the original forum thread I wrote a DIP to further explain the idea of the writing files at compile time feature and its implications. http://wiki.dlang.org/DIP81 Please discuss! I like the idea of being able to

Re: std.database

2016-03-02 Thread Stefan Koch via Digitalmars-d
On Tuesday, 1 March 2016 at 21:00:30 UTC, Erik Smith wrote: I'm back to actively working on a std.database specification & implementation. It's still unstable, minimally tested, and there is plenty of work to do, but I wanted to share an update on my progress. [...] Hi Erik, As soon as

Re: std.database

2016-03-02 Thread Stefan Koch via Digitalmars-d
On Wednesday, 2 March 2016 at 15:41:56 UTC, Piotrek wrote: On Tuesday, 1 March 2016 at 21:00:30 UTC, Erik Smith wrote: [...] My quick comments: 1. In my opinion it should not be called std.database, but let's say "std.dbc". This is because it looks like a wrapper over db clients. Moreover

Re: Compile time performance for metaprogramming is somewhat inconsistent

2016-03-03 Thread Stefan Koch via Digitalmars-d
On Thursday, 3 March 2016 at 02:03:01 UTC, maik klein wrote: Consider the following code void main() { import std.stdio; import std.range: iota, join; import std.algorithm.iteration: map; import std.conv: to; import std.meta: aliasSeqOf, staticMap, AliasSeq; enum types =

Re: String lambdas

2016-04-27 Thread Stefan Koch via Digitalmars-d
On Thursday, 28 April 2016 at 00:14:41 UTC, deadalnix wrote: On Wednesday, 27 April 2016 at 17:04:47 UTC, Andrei Alexandrescu wrote: Yes, you get it exactly right. I think a DIP would be warranted here to clarify how lambda equivalence is computed. Could you please draft one? -- Andrei More

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Stefan Koch via Digitalmars-d
On Friday, 29 April 2016 at 01:36:26 UTC, Walter Bright wrote: That's because in dmd there's the line: if (strcmp(user, "Daniel") == 0) setScoping(false); It's a feature! That one was really funny! ... or maybe I am just thinking this because it is 3 am here...

Re: One more simple idea for simplifying constraints

2016-04-25 Thread Stefan Koch via Digitalmars-d
On Monday, 25 April 2016 at 18:50:28 UTC, Andrei Alexandrescu wrote: Sometimes we use constraints to distinguish different approach to implementation, e.g. find for a string is different than find for forward ranges is different from find for input ranges etc. One simple idea here (which

Re: Some questions on latest work

2016-04-25 Thread Stefan Koch via Digitalmars-d
On Tuesday, 26 April 2016 at 01:04:21 UTC, Bill Hicks wrote: On Monday, 25 April 2016 at 21:20:04 UTC, Bienlein wrote: [...] To be frank, if you are using D for anything more than a throwaway hobby project, I have to tell you, D is a failed language, so stop wasting your time. The people

Re: Need a Faster Compressor

2016-05-23 Thread Stefan Koch via Digitalmars-d
On Monday, 23 May 2016 at 15:33:45 UTC, Walter Bright wrote: Also, the LZ4 compressor posted here has a 64K string limit, which won't work for D because there are reported 8Mb identifier strings. This is only partially true. The 64k limit does not apply to the input string. It does only

Re: Chat with Stefan Koch about CTFE reimplementation

2016-05-23 Thread Stefan Koch via Digitalmars-d
On Monday, 23 May 2016 at 16:32:30 UTC, deadalnix wrote: It is like we have a car with square wheels, and you guys a reinventing a whole new car without even trying to maybe put round wheel on the existing one and see how it goes. I this particular model of car. The bolts of the wheels are

Re: Chat with Stefan Koch about CTFE reimplementation

2016-05-23 Thread Stefan Koch via Digitalmars-d
On Monday, 23 May 2016 at 16:32:30 UTC, deadalnix wrote: On Monday, 23 May 2016 at 15:57:42 UTC, rikki cattermole wrote: Hello! [...] Call me party pooper or something but this whole things seems to get way out of control. In order to asses the quality of the new design, one need to

Re: Need a Faster Compressor

2016-05-23 Thread Stefan Koch via Digitalmars-d
Just a heads up on the LZ4. I have spent roughly 3 hours optimizing my decompresser. And while I had stunning success, a speed-up of about 400%. I am still about 600x slower then the C variant. It is still a mystery to me why that is :) Since the generated code both smaller and works almost

Re: Need a Faster Compressor

2016-05-22 Thread Stefan Koch via Digitalmars-d
On Sunday, 22 May 2016 at 18:18:46 UTC, Marco Leise wrote: If you provide the decompressor, we're set. :) I am already working on a non-ctfeable version that does not use slices. And therefore should be faster. But decompression is only needed for demangling.

Re: Need a Faster Compressor

2016-05-22 Thread Stefan Koch via Digitalmars-d
On Sunday, 22 May 2016 at 12:12:09 UTC, Martin Nowak wrote: Yes, LZO, LZ4, or snappy would be good choices. They are real-time compression algorithms, i.e. it's faster to compress and write to main memory than w/o compression. Yes the LZ compressors are very good for this usecase Please

Re: Need a Faster Compressor

2016-05-22 Thread Stefan Koch via Digitalmars-d
On Sunday, 22 May 2016 at 14:05:23 UTC, Marco Leise wrote: ⬅ Download proof of concept This is a proof of concept micro-benchmark compressing the 37_640 bytes symbol from the bug report linked above with both id_compress from the dmd backend and lz4 (without dictionary). The lz4 result is

Re: Need a Faster Compressor

2016-05-22 Thread Stefan Koch via Digitalmars-d
On Sunday, 22 May 2016 at 16:06:07 UTC, Marco Leise wrote: There are a few open questions, for me at least. Are there other proposals with good properties? Are there any objections against the benchmarking method or the license? Can the implementation be in D? If not, should we link against

Re: Need a Faster Compressor

2016-05-23 Thread Stefan Koch via Digitalmars-d
Am Sun, 22 May 2016 23:42:33 -0700 schrieb Walter Bright : The file format: http://cyan4973.github.io/lz4/lz4_Block_format.html It doesn't look too difficult. If we implement our own LZ4 compressor based on that, from scratch, we can boost license it. That it

Re: Need a Faster Compressor

2016-05-24 Thread Stefan Koch via Digitalmars-d
On Tuesday, 24 May 2016 at 16:22:56 UTC, Timon Gehr wrote: On 24.05.2016 01:02, Walter Bright wrote: [...] Speed. The title of this thread is "Need a faster compressor". [...] No. Just increase the recursion depth by a small number of levels to completely kill the speedups gained by

Re: Need a Faster Compressor

2016-05-21 Thread Stefan Koch via Digitalmars-d
On Saturday, 21 May 2016 at 22:41:49 UTC, Guillaume Boucher wrote: It's almost as if using information about the actual data leads to a better compression scheme. Exactly. It always is. Since you know where to look for redundancy instead of blindly comparing bytes.

Re: Identifier-name compression.

2016-05-21 Thread Stefan Koch via Digitalmars-d
On Saturday, 21 May 2016 at 22:59:48 UTC, Walter Bright wrote: On 5/21/2016 3:50 PM, Stefan Koch wrote: [...] It won't be reproducible from run to run, and worse, if you use separate compilation, duplicates are inevitable. please elaborate why wouldn't it be reproduceble from run to run ?

Re: Identifier-name compression.

2016-05-21 Thread Stefan Koch via Digitalmars-d
On Saturday, 21 May 2016 at 22:59:48 UTC, Walter Bright wrote: On 5/21/2016 3:50 PM, Stefan Koch wrote: [...] It won't be reproducible from run to run, and worse, if you use separate compilation, duplicates are inevitable. There will not be duplicates since you would not compile the same

Re: Identifier-name compression.

2016-05-21 Thread Stefan Koch via Digitalmars-d
On Saturday, 21 May 2016 at 23:43:48 UTC, Walter Bright wrote: On 5/21/2016 4:30 PM, Stefan Koch wrote: Of course the table would have to build by the compiler and inserted as data into the object-file. You'd have to build your own linker, too. Not if dmd is used to build the executable.

Re: Need a Faster Compressor

2016-05-21 Thread Stefan Koch via Digitalmars-d
On Saturday, 21 May 2016 at 21:12:15 UTC, Walter Bright wrote: The current one is effective, but slow: https://github.com/dlang/dmd/blob/master/src/backend/compress.c Anyone want to make a stab at making it faster? Changing the format is fair game, as well as down and dirty assembler if

Re: Identifier-name compression.

2016-05-21 Thread Stefan Koch via Digitalmars-d
On Saturday, 21 May 2016 at 23:22:22 UTC, Walter Bright wrote: On 5/21/2016 4:08 PM, Stefan Koch wrote: A symbol can be uniquely identified with the module it is defined in and a numerical id. I've used such for temporaries, but they caused problems and people complained. I see. But

Re: Identifier-name compression.

2016-05-21 Thread Stefan Koch via Digitalmars-d
On Saturday, 21 May 2016 at 23:52:59 UTC, Walter Bright wrote: On 5/21/2016 4:45 PM, Stefan Koch wrote: On Saturday, 21 May 2016 at 23:43:48 UTC, Walter Bright wrote: On 5/21/2016 4:30 PM, Stefan Koch wrote: Of course the table would have to build by the compiler and inserted as data into

Re: Need a Faster Compressor

2016-05-21 Thread Stefan Koch via Digitalmars-d
On Saturday, 21 May 2016 at 21:12:15 UTC, Walter Bright wrote: The current one is effective, but slow: https://github.com/dlang/dmd/blob/master/src/backend/compress.c Anyone want to make a stab at making it faster? Changing the format is fair game, as well as down and dirty assembler if

Identifier-name compression.

2016-05-21 Thread Stefan Koch via Digitalmars-d
Hi, I just had a nice idea. However due to my lack of obj-file-format knowlege I don't know how feasible it is. As far as I can see Identifiers are already in a hashed format while inside the symbol-table of the compiler. The Idea would be to safe a hash-table from id to clear-text-name or

Re: Identifier-name compression.

2016-05-21 Thread Stefan Koch via Digitalmars-d
On Saturday, 21 May 2016 at 22:40:44 UTC, Stefan Koch wrote: Hi, I just had a nice idea. However due to my lack of obj-file-format knowlege I don't know how feasible it is. As far as I can see Identifiers are already in a hashed format while inside the symbol-table of the compiler. The Idea

Re: Identifier-name compression.

2016-05-21 Thread Stefan Koch via Digitalmars-d
On Saturday, 21 May 2016 at 23:20:53 UTC, Walter Bright wrote: On 5/21/2016 4:02 PM, Stefan Koch wrote: and at link time the id-to-identifier translation-table would be consulted ? There's no such table. Of course the table would have to build by the compiler and inserted as data into

Re: Need a Faster Compressor

2016-05-22 Thread Stefan Koch via Digitalmars-d
On Sunday, 22 May 2016 at 09:43:29 UTC, Era Scarecrow wrote: And shrinking the lookback to a mere 127 increases it faster but compression starts taking a hit. Can't shrink it anymore anyways. modified id_compress2: TickDuration(230528074) 41% faster!! Nice results.

  1   2   3   4   5   6   7   8   9   10   >