Re: Usability of D on windows?

2016-08-25 Thread David Nadlinger via Digitalmars-d
On Thursday, 25 August 2016 at 20:31:59 UTC, John Burton wrote: I'll try to get a self contained report tomorrow. Please do – the -deps switch is certainly not the most well-tested part of LDC. It mostly inherits this part of the code from DMD, but there might be a subtle, unintentional diffe

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-06 Thread David Nadlinger via Digitalmars-d
On Saturday, 6 August 2016 at 21:56:06 UTC, Walter Bright wrote: Let me rephrase the question - how does fusing them alter the result? There is just one rounding operation instead of two. Of course, if floating point values are strictly defined as having only a minimum precision, then folding

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-06 Thread David Nadlinger via Digitalmars-d
On Saturday, 6 August 2016 at 09:35:32 UTC, Walter Bright wrote: The LDC fastmath bothers me a lot. It throws away proper NaN and infinity handling, and throws away precision by allowing reciprocal and algebraic transformations. This is true – and precisely the reason why it is actually defin

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-06 Thread David Nadlinger via Digitalmars-d
On Saturday, 6 August 2016 at 12:48:26 UTC, Iain Buclaw wrote: There are compiler switches for that. Maybe there should be one pragma to tweak these compiler switches on a per-function basis, rather than separately named pragmas. This might be a solution for inherently compiler-specific sett

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-06 Thread David Nadlinger via Digitalmars-d
On Saturday, 6 August 2016 at 10:02:25 UTC, Iain Buclaw wrote: No pragmas tied to a specific architecture should be allowed in the language spec, please. I wholeheartedly agree. However, it's not like FP optimisation pragmas would be specific to any particular architecture. They just describe

Re: Please rid me of this goto

2016-06-23 Thread David Nadlinger via Digitalmars-d
On Friday, 24 June 2016 at 00:26:52 UTC, John Colvin wrote: My biggest bugbear is actually the opposite of what you are point out here: people doing careful benchmarking and asm-inspection of small code-fragments in isolation when in reality it is always going to be inlined and optimised in co

Re: Please rid me of this goto

2016-06-23 Thread David Nadlinger via Digitalmars-d
On Thursday, 23 June 2016 at 23:34:54 UTC, David Nadlinger wrote: I get the following results: (This is of course not intended to be a comprehensive analysis. For example, the codegen for the two functions is actually identical on GDC and LDC, the relative differences are due to measurement

Re: Please rid me of this goto

2016-06-23 Thread David Nadlinger via Digitalmars-d
On Thursday, 23 June 2016 at 22:08:20 UTC, Seb wrote: [1] https://github.com/wilzbach/perf-d/blob/master/test_pow.d [2] https://github.com/wilzbach/perf-d/blob/master/test_powi.d This is a bad way to benchmark. You are essentially testing the compiler's ability to propagate your constants into

Re: Is dmd fast?

2016-06-23 Thread David Nadlinger via Digitalmars-d
On Thursday, 23 June 2016 at 17:24:34 UTC, Andrei Alexandrescu wrote: On my Ubuntu, /usr/bin/ld -> x86_64-linux-gnu-ld. What does that mean? -- Andrei `ld --version` should clear that up. ;) — David

Re: Phobo's migration

2016-06-23 Thread David Nadlinger via Digitalmars-d
On Thursday, 23 June 2016 at 12:57:47 UTC, Steven Schveighoffer wrote: […] I believe Weka.io does not [use Phobos] either. Weka actually uses Phobos quite liberally – `fgrep -rI "import std." weka` yields several thousand results (I'm sure Liran will be happy to share more details). It's just

Re: problem using ldc 1.0.0 as D compiler

2016-06-22 Thread David Nadlinger via Digitalmars-d
On Tuesday, 21 June 2016 at 21:44:59 UTC, Dicebot wrote: Would you mind making a point release with it if fix is confirmed? That's Kai's territory, but I'm sure he'll agree that this a sensible thing to do. — David

Re: problem using ldc 1.0.0 as D compiler

2016-06-21 Thread David Nadlinger via Digitalmars-d
On Tuesday, 21 June 2016 at 16:26:14 UTC, Satoshi wrote: On Monday, 20 June 2016 at 11:28:58 UTC, Antonio Corbi wrote: Hi folks! I'm using ldc version: LDC - the LLVM D compiler (1.0.0): based on DMD v2.070.2 and LLVM 3.8.0 built with DMD64 D Compiler v2.071.0 Default target: x86_64-unkno

Re: Fiber implementation questions

2016-06-21 Thread David Nadlinger via Digitalmars-d
On Tuesday, 21 June 2016 at 16:12:13 UTC, Steven Schveighoffer wrote: On 6/21/16 11:43 AM, Dicebot wrote: On Tuesday, 21 June 2016 at 12:18:37 UTC, Steven Schveighoffer wrote: On 6/21/16 6:14 AM, Dicebot wrote: httpthub.com/dlang/druntime/blob/master/src/core/thread.d#L1611 I suspected somet

Re: Phobos: __FILE__ as template default parameter

2016-06-21 Thread David Nadlinger via Digitalmars-d
On Monday, 20 June 2016 at 08:10:19 UTC, Dicebot wrote: How about defining semantics like "try inlining if possible, fallback to always emitting symbol to object file otherwise"? That would also allow compatible implementation in dmd. This would get rid of the undefined symbols, but there is a

Re: problem using ldc 1.0.0 as D compiler

2016-06-20 Thread David Nadlinger via Digitalmars-d
Hi Antonio, On Monday, 20 June 2016 at 11:28:58 UTC, Antonio Corbi wrote: ./ldcfail Fatal Error while loading '/usr/lib/libphobos2-ldc.so.70': The module 'std.regex.internal.parser' is already defined in './ldcfail'. […] Is this a bug in ldc or is it somehow related to my code? Thank

Re: Parameterized inheritence issues, bug or ignorance?

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Monday, 20 June 2016 at 00:34:18 UTC, Joerg Joergonson wrote: Can I just force the cast in some way if I know good an well it works for ever? Or do I have to write extra code to get around axiom: "We did this to save you trouble because we know better than you what you are doing. Go forth an

Re: Parameterized inheritence issues, bug or ignorance?

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Monday, 20 June 2016 at 00:01:58 UTC, Joerg Joergonson wrote: class a { } class b : a { } class A(T : a) { T x; } void main(string[] argv) { auto y = new A!a(); auto z = new A!b(); y.x = new a(); z.x = new b(); auto p1 = cast(A!a)y; auto

Re: Phobos: __FILE__ as template default parameter

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Sunday, 19 June 2016 at 21:13:00 UTC, Johan Engelen wrote: On Sunday, 19 June 2016 at 21:11:59 UTC, Johan Engelen wrote: (I think we can pretty much inline anything the user throws at us) (as long as it is not a naked asm function) Another example is `alloca`, which you might not want to

Re: GPGPU work and Identifiers

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Sunday, 19 June 2016 at 20:20:38 UTC, David Nadlinger wrote: Such a separate driver could then also be used as part of the regular distribution to improve the performance on memory-constrained all-at-once builds, by freeing all the frontend/LLVM memory (i.e., terminating the process) before

Re: GPGPU work and Identifiers

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Sunday, 19 June 2016 at 18:23:06 UTC, Jakob Bornecrantz wrote: That will be annoying, the LDC that works with SPIR-V wont be able to produce MSVC compatible exes. Lets hope they mainline it soon. One possible solution for this would be a thin driver executable that parses just enough of th

Re: Weird compiler

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote: It's awful that I compile a little 64bit program(or -m32mscoff) in windows must have visual studio which has tremendous size installed even though I only need a linker. It's weird that a compiler compiles to binary targets needs another compi

Re: Version identifier for PS4

2016-06-11 Thread David Nadlinger via Digitalmars-d
On Friday, 10 June 2016 at 14:37:23 UTC, Markus Pursche wrote: If this is the case we would want to use Orbis. As Seb also pointed out on GitHub, I've seen LLVM use "PS4" internally, and it always seemed rather natural to me. On the other hand, with Orbis I would have had no idea what the cod

Re: Let's avoid range specializations - make ranges great again!

2016-06-04 Thread David Nadlinger via Digitalmars-d
On Saturday, 4 June 2016 at 17:35:23 UTC, Seb wrote: ldc does the job (nearly) correctly. Scratch the "nearly" – at least you can't infer that from the performance results alone, the differences are well within the run-to-run noise. dmd -release -O -boundscheck=off test_looping.d && ./test

Re: faster splitter

2016-05-31 Thread David Nadlinger via Digitalmars-d
On Tuesday, 31 May 2016 at 21:29:34 UTC, Andrei Alexandrescu wrote: You may want to then try https://dpaste.dzfl.pl/392710b765a9, which generates inline code on all compilers. -- Andrei In general, it might be beneficial to use ldc.intrinsics.llvm_expect (cf. __builtin_expect) for things like

Re: The Case Against Autodecode

2016-05-27 Thread David Nadlinger via Digitalmars-d
On Friday, 27 May 2016 at 22:12:57 UTC, Minas Mina wrote: Those should be the same though, i.e compare the same. In order to do that, there is normalization. What is does is to _expand_ the single codepoint Ä into A + ¨ Unless I'm mistaken, this depends on the form used. For example, in NFKC

Re: faster splitter

2016-05-27 Thread David Nadlinger via Digitalmars-d
On Friday, 27 May 2016 at 14:06:09 UTC, Chris wrote: I have to correct myself. A manual loop is faster, I couldn't believe it either, so I benchmarked the same function with `foreach` and `for`. Turns out that `for` is _way_ faster. Just about the only reason I could think of for this to happe

Re: Why doesn't dlang-bot use the GitHub conventions?

2016-05-18 Thread David Nadlinger via Digitalmars-d
On Wednesday, 18 May 2016 at 14:27:22 UTC, Jacob Carlborg wrote: Apparently dlang-bot doesn't recognize the GitHub syntax/conventions [1] to link and close issues from pull requests. Instead one have to use "Fix issue ...". I don't see a point in inventing new conventions for this. Can we ple

Re: File size of exe: DMD vs LDC

2016-05-12 Thread David Nadlinger via Digitalmars-d
On Thursday, 12 May 2016 at 17:27:37 UTC, Nick Sabalausky wrote: FWIW, keep in mind that doesn't necessarily imply the same 2x scale will still hold for larger programs. Could be as much as 2x, could be as little as a constant +3MB. In typical programs, it is indeed a factor, and can be consi

Re: File size of exe: DMD vs LDC

2016-05-12 Thread David Nadlinger via Digitalmars-d
On Thursday, 12 May 2016 at 21:35:12 UTC, David Nadlinger wrote: In typical programs it is indeed a factor, and can be considerably more than 2x too. […] To expand on that a bit, if you write template- and CTFE-less programs with no unused code and no inlined functions, you would obviously ex

Re: File size of exe: DMD vs LDC

2016-05-09 Thread David Nadlinger via Digitalmars-d
On Monday, 9 May 2016 at 13:53:45 UTC, Dicebot wrote: On Monday, 9 May 2016 at 13:48:50 UTC, Walter Bright wrote: On 5/9/2016 5:24 AM, Jacob Carlborg wrote: LDC can strip sections which DMD cannot. Why not? AFAIR, because of how ModuleInfo/TypeInfo is emitted which makes linker never colle

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

2016-04-28 Thread David Nadlinger via Digitalmars-d
On Thursday, 28 April 2016 at 18:49:54 UTC, Steven Schveighoffer wrote: Please, D, don't ever do this kind of stuff! I just gained about 45 warnings in my iOS project. … and what? This statement alone is hardly an argument. Both those warnings are trivial to fix in an automated fashion; in fa

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread David Nadlinger via Digitalmars-d
On Sunday, 24 April 2016 at 23:00:56 UTC, Temtaime wrote: Please no cmp. Just bool isPowerOf2(uint x) { return x && !(x & (x - 1)); } You do realise that this will (typically) emit a branch? — David

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread David Nadlinger via Digitalmars-d
On Saturday, 23 April 2016 at 20:34:52 UTC, Nordlöw wrote: So is there a way to check if popcnt builtin is available on current platform? As Andrei pointed out, it's not only popcnt being available, it's also it being fast. A function implementing the classic hand-written version compiles dow

Re: DMD internal: appendToModuleMember performance

2016-04-23 Thread David Nadlinger via Digitalmars-d
On Saturday, 23 April 2016 at 09:13:01 UTC, Johan Engelen wrote: Well, this 140k list has a removal very early on, so the linear search is going to happen >100k times from then on ;) No – only for searching the particular removed item (or other false positives due to hash collisions). — Dav

Re: DMD internal: appendToModuleMember performance

2016-04-22 Thread David Nadlinger via Digitalmars-d
On Friday, 22 April 2016 at 23:49:22 UTC, Walter Bright wrote: BTW, this looks like a particularly bad piece of engineering. The trouble is, it saves an index to the member, then does a bunch of semantic processing, then deletes what is on that index. But what if the members[] in the meantime s

Re: DMD internal: appendToModuleMember performance

2016-04-22 Thread David Nadlinger via Digitalmars-d
On Friday, 22 April 2016 at 21:38:41 UTC, Johan Engelen wrote: I don't understand exactly what you mean; do you propose to […] do a linear search when the shadow data structure says the item is present? That's the idea. As long as you can reduce the need to do a full linear search by, say, 1

Re: DMD internal: appendToModuleMember performance

2016-04-22 Thread David Nadlinger via Digitalmars-d
On Friday, 22 April 2016 at 22:10:47 UTC, Walter Bright wrote: On 4/22/2016 2:38 PM, Johan Engelen wrote: I don't understand exactly what you mean; do you propose to resort to linear search after a removal happened? Or only do a linear search when the shadow data structure says the item is pre

Re: DMD internal: appendToModuleMember performance

2016-04-22 Thread David Nadlinger via Digitalmars-d
On Friday, 22 April 2016 at 21:48:09 UTC, Walter Bright wrote: Why not just use a hash table? D's builtin one? Apparently, some parts rely on the insertion order, although I'm not convinced they should. Module::importAll is one of them, but in a way that's trivial to avoid. I didn't check any

Re: DMD internal: appendToModuleMember performance

2016-04-22 Thread David Nadlinger via Digitalmars-d
On Friday, 15 April 2016 at 18:33:44 UTC, Johan Engelen wrote: I'm thinking about removing the old array all-together. My question is: is it essential to keep an ordered list? (I see a `.shift(...)` call on the array, to put something in first position. If so, could that be solved by having *tw

Re: DMD internal: appendToModuleMember performance

2016-04-22 Thread David Nadlinger via Digitalmars-d
On Friday, 22 April 2016 at 18:51:57 UTC, David Nadlinger wrote: As long as elements are not removed too frequently (what do your numbers say?), the performance impact of doing a full linear search in those cases shouldn't be too bad. Note that a (properly tuned) probabilistic data structure l

Re: DMD internal: appendToModuleMember performance

2016-04-22 Thread David Nadlinger via Digitalmars-d
On Saturday, 16 April 2016 at 13:58:28 UTC, Johan Engelen wrote: On Friday, 15 April 2016 at 19:32:46 UTC, David Nadlinger wrote: Another "quick fix" if we have to keep the order would be to add a Bloom filter/… on the side to eliminate most array searches. In rare cases, symbols are removed

Re: Distributor's whishlist and questions for D

2016-04-22 Thread David Nadlinger via Digitalmars-d
On Friday, 22 April 2016 at 09:18:48 UTC, Kagamin wrote: RMW operations on shared data are deprecated. The template filter on atomicOp is a little different: https://dlang.org/phobos/core_atomic.html#.atomicOp Looks like an LDC bug. Yes, this was indeed an LDC issue. We have our own implemen

Re: DMD internal: appendToModuleMember performance

2016-04-15 Thread David Nadlinger via Digitalmars-d
On Friday, 15 April 2016 at 18:33:44 UTC, Johan Engelen wrote: Hi all, When building a unittest case in Weka.io's codebase, I measure that appendToModuleMember takes about 10% of the total compile time, and about 25% of total semantic analysis time. "appendToModuleMember" is the only functio

Re: Policy for exposing range structs

2016-03-27 Thread David Nadlinger via Digitalmars-d
On Saturday, 26 March 2016 at 05:22:56 UTC, Andrei Alexandrescu wrote: Compression of template names. -- Andrei Compression in the usual sense won't help. Sure, it might reduce the object file size, but the full string will again have to be generated first, still requiring absurd amounts time

Re: RFC: Units of measurement for D (Phobos?)

2016-03-19 Thread David Nadlinger via Digitalmars-d
On Wednesday, 16 March 2016 at 17:12:42 UTC, ZombineDev wrote: Sometimes a more gradual approach may be useful: […] How would this be any more than an informational annotation? If anything, you could build a custom lint tool to propagate and verify the unit annotations, but I don't quite see

Re: D could catch this wave: web assembly

2016-03-19 Thread David Nadlinger via Digitalmars-d
On Saturday, 19 March 2016 at 16:18:00 UTC, Adi wrote: I need help to write my proposal for gsoc. What exactly do you need help with? You can find some general hints at the GSoC student guide: http://write.flossmanuals.net/gsocstudentguide/writing-a-proposal/. There are currently no extra h

Re: RFC: Units of measurement for D (Phobos?)

2016-03-19 Thread David Nadlinger via Digitalmars-d
On Wednesday, 16 March 2016 at 22:16:20 UTC, Nordlöw wrote: How should then sin, cos, tan, expi be redesigned to support `ScaledUnit` aswell as `Quantity`? What you can do is to take an arbitrary quantity with an (angle.canConvert!radian) template constraint. Inside the function, you then sim

Re: RFC: Units of measurement for D (Phobos?)

2016-03-19 Thread David Nadlinger via Digitalmars-d
Hi Per, Many thanks for working on the code! Could you put it up as a separate Dub package to make it easier for people to try out? `justd` is an 68 MiB-heavy clone, which makes it somewhat cumbersome to play around with and contribute to it. You'd probably also want to add your name to the A

Re: RFC: Units of measurement for D (Phobos?)

2016-03-18 Thread David Nadlinger via Digitalmars-d
On Thursday, 17 March 2016 at 12:51:28 UTC, Nordlöw wrote: I believe `isConvertableTo` is a more Phobos-compliant naming, right? I went for canConvert since it is a bit shorter than isConvertible and there is precedent for it in Phobos as well (e.g. find/canFind). It's a matter of taste, thou

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread David Nadlinger via Digitalmars-d
On Tuesday, 15 March 2016 at 09:07:05 UTC, Nordlöw wrote: On Monday, 14 March 2016 at 18:51:45 UTC, Chris Wright wrote: Ohm my, that's awesome. Watt needs to happen to get this into Phobos? I'm cleaning up David's work right and will put up a PR today. Please make a really, really thorough p

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread David Nadlinger via Digitalmars-d
On Tuesday, 15 March 2016 at 14:46:30 UTC, D.Enguiyen wrote: Is it able to manage quantities with a non-linear transformations, for example when dealing with octet and byte ? (1024)!"byte" == 1!"kbyte"; There are no non-linear transformations going on here, following usual math terminology.

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread David Nadlinger via Digitalmars-d
On Monday, 14 March 2016 at 19:08:18 UTC, Robert burner Schadek wrote: have a look at this! https://github.com/biozic/quantities This has been brought up (and subsequently discussed) on the first page of this thread, more than two years ago. — David

Re: D could catch this wave: web assembly

2016-03-15 Thread David Nadlinger via Digitalmars-d
On Tuesday, 15 March 2016 at 20:18:40 UTC, deadalnix wrote: I can. I know LLVM fairly well (I'm not a committer), but I do not have that much experience with WebAssembly. Yes, please! I'd volunteer myself, but this summer will be too busy for me academically. — David

Re: dmd-built dmd is faster that ldc-built dmd or gdc-built dmd?

2016-03-11 Thread David Nadlinger via Digitalmars-d
On Friday, 11 March 2016 at 15:09:26 UTC, Iain Buclaw wrote: Yes, I know. And if I were to say which behaviour is desired. I'd say GDC is doing the right thing. Marking all functions as 'weak' is a terrible idea on both DMD's and LDC's part. I distinctly remember Daniel and me having to re

Re: Official compiler

2016-02-26 Thread David Nadlinger via Digitalmars-d
On Friday, 26 February 2016 at 18:53:21 UTC, Andrei Alexandrescu wrote: My understanding is the main problem is the _same_ templates are repeatedly instantiated with the same exact parameters - the epitome of redundant work. -- Andrei Within one compiler execution, there might be some optimiza

Re: Official compiler

2016-02-26 Thread David Nadlinger via Digitalmars-d
On Friday, 26 February 2016 at 18:19:57 UTC, Steven Schveighoffer wrote: The idea is that ldc and gdc will get plenty of warning if something breaks. As stated, this in itself would be utterly useless. Right now, you can be absolutely certain that the AST semantics will change in between each

Re: Official compiler

2016-02-26 Thread David Nadlinger via Digitalmars-d
On Thursday, 25 February 2016 at 23:06:43 UTC, H. S. Teoh wrote: Are there any low-hanging fruit left that could make dmd faster? A big one would be overhauling the template mangling scheme so it does not generate mangled names a few hundred kilo (!) bytes in size anymore for code that uses t

Re: Official compiler

2016-02-26 Thread David Nadlinger via Digitalmars-d
On Friday, 26 February 2016 at 11:50:27 UTC, Russel Winder wrote: On Fri, 2016-02-26 at 11:12 +, BBasile via Digitalmars-d wrote: […] BTW Malicious people can cheat and commit in the past, according to https://github.com/gelstudios/gitfiti commitment date is not reliable. Indeed, which

Re: Official compiler

2016-02-25 Thread David Nadlinger via Digitalmars-d
On Thursday, 25 February 2016 at 22:03:47 UTC, Walter Bright wrote: DMD did slow down because it was now being compiled by DMD instead of g++. You can compile it using LDC just fine now. ;) Also, dmd was doing multithreaded file I/O, but that was removed because speed didn't matter . Did we

Re: Official compiler

2016-02-25 Thread David Nadlinger via Digitalmars-d
On Thursday, 25 February 2016 at 03:05:21 UTC, Walter Bright wrote: On 2/18/2016 9:52 AM, Kai Nacke wrote: I really like the compiler diversity. Me too. Having 3 major implementations is a great source of strength for D. I like it too. I just think that we can't afford it at this point, an

Re: Official compiler

2016-02-25 Thread David Nadlinger via Digitalmars-d
On Thursday, 25 February 2016 at 02:58:08 UTC, Walter Bright wrote: A big chunk of that was getting D to catch C++ exceptions. And before I did this work, neither GDC nor LDC did, either. It's not a simple matter of just turning it on given Dwarf EH. That's beside the point, the C++ interop ne

Re: Official compiler

2016-02-25 Thread David Nadlinger via Digitalmars-d
On Thursday, 25 February 2016 at 09:04:17 UTC, Russel Winder wrote: I wonder if anyone has noticed, or appreciated that, all the trendy, hipster cloud based CI servers support Go, sometimes C++ and C (sort of), but not Rust, or D. Travis CI, which is probably the one "trendy, hipster" service

Re: Swift deprecate i++ and c-style for loop

2016-02-24 Thread David Nadlinger via Digitalmars-d
On Wednesday, 24 February 2016 at 16:37:04 UTC, Suliman wrote: func slices() { var array = ["First", "Second", "Third", "Fourth"] array.removeLast() array.removeFirst() } also look very intuitive. Have a look at http://dlang.org/phobos/std_range.html#dropOne. — David

Re: C++ UFCS update

2016-02-19 Thread David Nadlinger via Digitalmars-d
On Friday, 19 February 2016 at 16:18:12 UTC, Dejan Lekic wrote: I have to go through each piece separated by dots to understand what it is... Let me play devil's advocate here: How would this be any different if UFCS were not used? — David

Re: Official compiler

2016-02-18 Thread David Nadlinger via Digitalmars-d
On Thursday, 18 February 2016 at 17:56:32 UTC, Jonathan M Davis wrote: […] if you want to be writing scripts in D (which is really useful), you need rdmd, which means using dmd You can use rdmd with ldmd2 just as well (and presumably gdmd too). New users are frequently impressed by how fast

Re: Official compiler

2016-02-18 Thread David Nadlinger via Digitalmars-d
On Thursday, 18 February 2016 at 11:12:57 UTC, Jonathan M Davis wrote: And actually, he'd risk legal problems if he did, because he doesn't want anyone to be able to accuse him of taking code from gcc or llvm. That's a silly strawman, and you should know better than putting that forward as an

[OT] Re: Official compiler

2016-02-18 Thread David Nadlinger via Digitalmars-d
On Wednesday, 17 February 2016 at 22:57:20 UTC, Márcio Martins wrote: […] On a completely unrelated note, you aren't by any chance the Márcio Martins who is giving a talk at ETH in a couple of days, are you? — David

Re: Official compiler

2016-02-18 Thread David Nadlinger via Digitalmars-d
On Thursday, 18 February 2016 at 11:41:26 UTC, Kai Nacke wrote: LLVM has about 2.5 million code lines. I am anything than sure if it is easy to improve compilation speed. I think you are a tad too pessimistic here. First, don't forget that there are some big LLVM customers for which low compil

Re: Official compiler

2016-02-18 Thread David Nadlinger via Digitalmars-d
On Thursday, 18 February 2016 at 12:23:18 UTC, Jonathan M Davis wrote: if the dmd backend were dropped, […] that would further slow down the development of the frontend and not necessarily improve things overall. How would that be? — David

Re: [suggestion] Automated one-stop compiler version chart

2016-02-07 Thread David Nadlinger via Digitalmars-d
On Sunday, 7 February 2016 at 21:26:36 UTC, Xinok wrote: On Sunday, 7 February 2016 at 18:46:48 UTC, Nick Sabalausky wrote: I was just updating a project's .travis.yml file and noticed: It doesn't seem we have any one-stop-shop location to check all the versions of DMD/LDC/GDC currently availab

Re: D's equivalent to C++'s std::move?

2016-02-03 Thread David Nadlinger via Digitalmars-d
On Wednesday, 3 February 2016 at 19:18:12 UTC, Minas Mina wrote: If this becomes the case, please make destructors nothrow so that people won't screw up (like they can very easily do in C++). This would be way too much of a restriction. Throwing in destructors is perfectly fine in D, there is

Literate programming tool (written in D) on Reddit

2016-01-30 Thread David Nadlinger via Digitalmars-d
Just noticed this on the /r/programming front page: https://www.reddit.com/r/programming/comments/43fvbv/literate_programming_tool_made_with_d/ — David

Re: extern(C++, ns)

2016-01-30 Thread David Nadlinger via Digitalmars-d
On Friday, 22 January 2016 at 17:04:00 UTC, Jacob Carlborg wrote: Unfortunately that's not how it works with D. If Andrei or Walter have a proposal it's up to the community to provide compelling evidence why it _should not_ be added. If the community has a proposal it's up to the community to p

Re: reduce -> fold?

2016-01-30 Thread David Nadlinger via Digitalmars-d
On Saturday, 30 January 2016 at 17:40:38 UTC, Andrei Alexandrescu wrote: I forgot the distinction between currying and partial application. Can we also define currying in current D? -- Andrei Currying is turning (A, B, C) -> D into A -> (B -> (C -> D)), i.e. a function with multiple arguments

Re: Idea: limited template expansion

2016-01-21 Thread David Nadlinger via Digitalmars-d
On Thursday, 21 January 2016 at 13:36:28 UTC, Steven Schveighoffer wrote: On 1/20/16 6:01 PM, David Nadlinger wrote: How would the client code be simpler with a built-in language feature? The use case I have in mind is a parser, let's say an xml parser. […] I still don't see how a languag

Re: extern(C++, ns)

2016-01-20 Thread David Nadlinger via Digitalmars-d
On Wednesday, 20 January 2016 at 23:21:49 UTC, Walter Bright wrote: On 1/20/2016 3:12 PM, Martin Drašar via Digitalmars-d wrote: The "serious" problem is that the decision to have a namespace introduce a new scope needlessly complicates writing D-like interfaces to C++ code, while catering for

Re: Request for new Deimos repository

2016-01-20 Thread David Nadlinger via Digitalmars-d
On Thursday, 21 January 2016 at 00:33:34 UTC, Brian Schott wrote: If somebody creates a repository for this I can get these bindings into Deimos pretty quickly. IIRC only Walter, Andrei and Brad have the necessary permissions to create new repositories. — David

Re: extern(C++, ns)

2016-01-20 Thread David Nadlinger via Digitalmars-d
On Tuesday, 19 January 2016 at 22:14:42 UTC, Walter Bright wrote: 1. C++ has namespaces. They went and invented a whole 'nother thing called modules. Evidently not even they think that modules and namespaces are the same thing. C++ modules (as per N4465, etc.) are a whole different story and

Re: extern(C++, ns)

2016-01-20 Thread David Nadlinger via Digitalmars-d
On Tuesday, 19 January 2016 at 21:46:07 UTC, Walter Bright wrote: On 1/19/2016 12:35 PM, David Nadlinger wrote: You'd run into all kinds of weird issues, as Manu pointed out – many of which have hopefully been fixed by Walter in the meantime. Please read the thread. I fixed them and posted h

Re: extern(C++, ns)

2016-01-20 Thread David Nadlinger via Digitalmars-d
On Tuesday, 19 January 2016 at 21:40:01 UTC, Walter Bright wrote: Please do not conflate not agreeing with my answers with not responding. I am not claiming that you weren't participating in the discussion threads or something like that. But in all your arguments you seem to presume that (bad

Re: Idea: limited template expansion

2016-01-20 Thread David Nadlinger via Digitalmars-d
On Wednesday, 20 January 2016 at 22:00:45 UTC, Steven Schveighoffer wrote: Imagine if you such a call returned something, and you simply used it throughout the rest of your function. The compiler could rewrite this as a template and compile all three versions and branch to the appropriate one,

Re: Idea: limited template expansion

2016-01-20 Thread David Nadlinger via Digitalmars-d
On Wednesday, 20 January 2016 at 21:27:15 UTC, Steven Schveighoffer wrote: It would be cool if the compiler could "expand" a finitely instantiable template (one with a finite number of ways it can be instantiated) based on a runtime value, and do the switch for me. Can't you just write a wrap

Re: extern(C++, ns)

2016-01-19 Thread David Nadlinger via Digitalmars-d
On Tuesday, 19 January 2016 at 20:03:47 UTC, Chris Wright wrote: I'm kind of surprised that people are insisting on complaining that there's an additional namespace that's trivial to ignore […] That's not what's happening here. At least when this thread was started, it was not at all possible

Re: extern(C++, ns)

2016-01-19 Thread David Nadlinger via Digitalmars-d
On Tuesday, 19 January 2016 at 13:56:54 UTC, Manu wrote: On 19 January 2016 at 18:54, Walter Bright via Digitalmars-d As the length of this thread testifies, this has been discussed at length already. No it hasn't. I don't feel like it's been discussed at all. I've explicitly asked both you an

Re: Wait-free thread communication

2016-01-10 Thread David Nadlinger via Digitalmars-d
On Saturday, 9 January 2016 at 22:44:53 UTC, Ola Fosheim Grøstad wrote: Yes. But my experience from writing custom multi-single queues is that it can end up harder than it looks to get it working and efficient. […] (Intuition is often wrong in this area...) I wholeheartedly agree with that sta

Re: Wait-free thread communication

2016-01-09 Thread David Nadlinger via Digitalmars-d
On Saturday, 9 January 2016 at 17:44:26 UTC, Andy Smith wrote: Unfortunately I'm not well versed enough on the internals of the three main compiler versions to give an opinion on whether this will be a problem or not :-( It might work on DMD, but I know from experience (one-to-many queues, i.

Re: Wait-free thread communication

2016-01-09 Thread David Nadlinger via Digitalmars-d
On Saturday, 9 January 2016 at 15:16:43 UTC, Ola Fosheim Grøstad wrote: On Saturday, 9 January 2016 at 14:20:18 UTC, Andy Smith wrote: I'm a little worried you have no volatile writes or fences around your code when you 'publish' an event using head/tail etc. It looks like it's working but how

Re: Wait-free thread communication

2016-01-09 Thread David Nadlinger via Digitalmars-d
On Saturday, 9 January 2016 at 16:22:12 UTC, Jin wrote: So i simple use atomicFence. Performance does not degrade. Either you are not calling it in the way you think you are, then, or your code is otherwise very unoptimized. You can definitely measure the impact of a full mfence on otherwise

Re: GC buckets in 2.067

2015-12-01 Thread David Nadlinger via Digitalmars-d
On Tuesday, 1 December 2015 at 08:47:03 UTC, Iain Buclaw wrote: David, did you get anything like this when moving to 2.067? It has been almost a year now, but I don't remember anything like that – are you sure that your GC root ranges (.data/stacks/TLS) are set correctly? — David

Re: I hate new DUB config format

2015-11-25 Thread David Nadlinger via Digitalmars-d
On Wednesday, 25 November 2015 at 20:24:36 UTC, Andrei Alexandrescu wrote: If it offers no leverage, entails boring work, requires a manual, or doesn't look good on the page - it's probably wrong. Interestingly, this applies to the JSON-based DUB configuration format much more so than to the S

Re: I hate new DUB config format

2015-11-25 Thread David Nadlinger via Digitalmars-d
On Wednesday, 25 November 2015 at 19:04:19 UTC, Walter Bright wrote: Sure it does: "comment" : "This is a comment", That only works in contexts where a dictionary is used, and also neither stands out visually by itself nor can be rendered differently by syntax highlighting. — Davi

Re: Dwarf Exception Handling question

2015-11-23 Thread David Nadlinger via Digitalmars-d
On Monday, 23 November 2015 at 21:05:29 UTC, Walter Bright wrote: The code looks quite good. I've been trying to adjust things, however, so there are no pushes and pops in the code, trying to preallocate everything needed in the function prolog. Wouldn't you still need to restore the stack bef

Re: Dwarf Exception Handling question

2015-11-23 Thread David Nadlinger via Digitalmars-d
On Monday, 23 November 2015 at 17:31:51 UTC, Walter Bright wrote: The calls to _d_dynamic cast appear to be redundant - shouldn't the value in RDX be sufficient? This is indeed the case, but of course you need to know in which order the compiler backend wrote the type info entries to the tabl

Re: Catching C++ std::exception in D

2015-11-14 Thread David Nadlinger via Digitalmars-d
On Friday, 13 November 2015 at 18:40:06 UTC, Iain Buclaw wrote: There may be a few other holes between how Fibers and EH interact. https://github.com/D-Programming-Language/druntime/commit/f6633abb43ea1f2464d3a772b8f8fe78216ffd8e The SJLJ stack switching should probably be added to this mech

Re: Signed integer overflow undefined behavior or not?

2015-11-13 Thread David Nadlinger via Digitalmars-d
On Friday, 13 November 2015 at 06:00:08 UTC, Walter Bright wrote: It's worth checking how LDC and GDC deal with this deep in their optimizer - is it considering it undefined behavior? Signed types will wrap around correctly for LDC. — David

Re: Our template emission strategy is broken

2015-11-12 Thread David Nadlinger via Digitalmars-d
On Thursday, 12 November 2015 at 02:13:04 UTC, Martin Nowak wrote: There shouldn't be anything quadratic left for template instantiation in the frontend. Maybe not for a single instantiation, but constructing the module member list is overall still quadratic in the number of members (which mi

Re: DMD is faster than LDC and GDC

2015-11-12 Thread David Nadlinger via Digitalmars-d
On Thursday, 12 November 2015 at 21:16:25 UTC, Walter Bright wrote: It's more than that - dmd's optimizer is designed to make use of the guarantees of a pure function. Since C/C++ do not have pure functions, ldc/gdc's optimizer may not have that capability. Oh, GCC has had similar notions as

Re: Catching C++ std::exception in D

2015-11-12 Thread David Nadlinger via Digitalmars-d
On Thursday, 12 November 2015 at 06:50:31 UTC, Walter Bright wrote: The tricky part with the personality function will likely be recognizing std::exception* exceptions. I wonder if forwarding the call to __gxx_personality_v0 will work. This should be rather simple; you know it is C++ because o

Re: Catching C++ std::exception in D

2015-11-12 Thread David Nadlinger via Digitalmars-d
On Thursday, 12 November 2015 at 16:55:09 UTC, Johannes Pfau wrote: To expand on this: I think we'd prefer one __d_personality_v0 which is implemented in upstream druntime and identical for all compilers. Making the compilers ABI compatible is probably not a high priority, but OTOH we shouldn

Re: Our template emission strategy is broken

2015-11-11 Thread David Nadlinger via Digitalmars-d
On Wednesday, 11 November 2015 at 15:04:01 UTC, Andrei Alexandrescu wrote: Liran Zvibel […] mentioned the package-at-a-time solved essentially all of their build problems. They were stuck at 2.066 until very recently, though, because of issues very similar to the one discussed here. Right now,

<    1   2   3   4   5   >