Re: Evaluation order of "+="

2016-07-11 Thread Patrick Schluter via Digitalmars-d
On Tuesday, 12 July 2016 at 05:46:58 UTC, Patrick Schluter wrote: On Tuesday, 12 July 2016 at 00:16:58 UTC, deadalnix wrote: On Monday, 11 July 2016 at 23:31:40 UTC, Danika wrote: On Monday, 11 July 2016 at 23:04:00 UTC, Johan Engelen wrote: LDC recently changed the evaluation order of "+=" (I

Re: Evaluation order of "+="

2016-07-11 Thread Patrick Schluter via Digitalmars-d
On Tuesday, 12 July 2016 at 00:16:58 UTC, deadalnix wrote: On Monday, 11 July 2016 at 23:31:40 UTC, Danika wrote: On Monday, 11 July 2016 at 23:04:00 UTC, Johan Engelen wrote: LDC recently changed the evaluation order of "+=" (I think unintentionally, some other eval order problems were

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 12 July 2016 at 05:30:57 UTC, Walter Bright wrote: On 7/11/2016 10:01 PM, Ola Fosheim Grøstad wrote: Of course logic programming has had a big impact on state of the art. Prolog -> Datalog Datalog -> magic sets magic sets -> inference engines inference engines -> static analysis

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 10:15 PM, Shachar Shemesh wrote: D says any such cast is UB. That's why such casts are not allowed in @safe code. There's also no way to write a storage allocator in @safe code. Code that is not checkably safe is needed in real world programming. The difference between D and

Re: UB in D

2016-07-11 Thread Shachar Shemesh via Digitalmars-d
On 10/07/16 02:44, H. S. Teoh via Digitalmars-d wrote: I find this rather disturbing, actually. There is a fine line between taking advantage of assert's to elide stuff that the programmer promises will not happen, and eliding something that's defined to be UB and thereby resulting in memory

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Andrei Alexandrescu via Digitalmars-d
On 07/12/2016 01:15 AM, Shachar Shemesh wrote: On 08/07/16 22:26, Andrei Alexandrescu wrote: I agree with that. What would be a good example? Where is the reference to Walter's promotion of UB in @safe code? Andrei I don't have an example by Walter, but I can give you an example by Andrei.

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 10:01 PM, Ola Fosheim Grøstad wrote: Of course logic programming has had a big impact on state of the art. Prolog -> Datalog Datalog -> magic sets magic sets -> inference engines inference engines -> static analysis And that is only a small part of it. Can you trace any Prolog

Re: Is this a bug ?

2016-07-11 Thread Chang Long via Digitalmars-d-learn
On Tuesday, 12 July 2016 at 04:38:42 UTC, Chang Long wrote: test.d = template newType(size_t N){ class NewType { enum Type = N ; } } just find it should be this: template newType(size_t N){ class NewType {

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Jack Stouffer via Digitalmars-d
On Tuesday, 12 July 2016 at 04:37:06 UTC, Walter Bright wrote: If I may rant a bit, lots of posters here posit that with "more process", everything will go better. Gah, I hate this idea. It's pervasive in every office in the country. "Oh if we just had better tools we could manage our

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Shachar Shemesh via Digitalmars-d
On 08/07/16 22:26, Andrei Alexandrescu wrote: I agree with that. What would be a good example? Where is the reference to Walter's promotion of UB in @safe code? Andrei I don't have an example by Walter, but I can give you an example by Andrei. In D-Conf. On Stage. During the keynotes.

adding toString to struct

2016-07-11 Thread Adam Sansier via Digitalmars-d-learn
windows libs have a lot of structs and it would be nice to have the ability to convert them to a string to see them in the debugger(e.g., CLSID). Is there a way to do this? I've tried to pull out the code from the libs but it if a total clusterfuck.

Re: sorting std.container

2016-07-11 Thread WhatMeWorry via Digitalmars-d-learn
On Monday, 11 July 2016 at 19:07:51 UTC, ketmar wrote: list slices are not random-access ranges, thus they can't be sorted in-place (this is what std.algorithm.sort does). so the only way is to convert list to array, sort it, and make a list from sorted array. probably not something you want.

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 12 July 2016 at 04:52:14 UTC, Walter Bright wrote: "Prolog and other logic programming languages have not had a significant impact on the computer industry in general." https://en.wikipedia.org/wiki/Prolog#Limitations So, no. That appears to be a 1995 reference from a logic

Re: exceptions vs error codes

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 9:10 PM, Chris Wright wrote: On Mon, 11 Jul 2016 06:13:00 -0700, Walter Bright wrote: On 7/9/2016 8:02 PM, Superstar64 wrote: Would it be possible and a good idea to have a language feature that allows some exceptions to use error code code generation. If you want to return an

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 7:46 PM, Ola Fosheim Grøstad wrote: On Monday, 11 July 2016 at 22:09:11 UTC, Walter Bright wrote: at one or more of the factors, Scheme included. Not Prolog either, a singularly useless, obscure and failed language. Err... Prolog is in use and has been far more influential on the

[Issue 16264] BigInt multiplication crashes on 64-bit (biguintnoasm.d(276): Range violation)

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16264 --- Comment #5 from Kirill Kryukov --- Looks like it might be the same issue with #11599 ( https://issues.dlang.org/show_bug.cgi?id=11599 ) If so, "Asymmetric Karatsuba" bug is known since 2013, and stays unfixed. Which

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 7:23 PM, deadalnix wrote: On Tuesday, 12 July 2016 at 01:28:31 UTC, Walter Bright wrote: I don't see anything actionable in your comment. Defining by which way @safe actually ensure safety would be a good start. I'm sorry for the frustration, but the "mention a problem, get

Is this a bug ?

2016-07-11 Thread Chang Long via Digitalmars-d-learn
test.d = template newType(size_t N){ class NewType { enum Type = N ; } } class A{} alias Type = newType!1 ; N New(N)(){ return new N(); } void main(){ auto a = New!A; auto n = New!Type; }

Re: How to create nogc code?

2016-07-11 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Monday, 11 July 2016 at 21:28:58 UTC, Jonathan M Davis wrote: If all you're doing is passing around int* and the like, then the situation is the same as in C and is fine. But stuff like int[] becomes problematic, because it assumes that you're using the GC. But that's stuff that doesn't

Docs for `Group` type

2016-07-11 Thread Bahman Movaqar via Digitalmars-d-learn
When using `chunkBy` (unary pred) the result is a list of tuples. Each tuple holds a key and a `Group` which belong to that key. Where can I find the docs for this `Group` type (I have already tried searching library on dlang.org)? Thanks, -- Bahman

Simple overloading without complications

2016-07-11 Thread Adam Sansier via Digitalmars-d-learn
I have a function that does some weird stuff, and can't really change it to make life easier(due to how windows work, COM, etc..). The function normally takes a string, a name, and does its think(which is the complex part that I can't change). But I also want to overload it so the function

[Issue 16266] @safe functions may dereference non-dereferenceable pointers

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16266 --- Comment #3 from Andrei Alexandrescu --- My bad --

[Issue 16266] @safe functions may dereference non-dereferenceable pointers

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16266 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 11176] array.ptr in @safe code may point past end of array

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11176 Walter Bright changed: What|Removed |Added CC||and...@erdani.com

Re: exceptions vs error codes

2016-07-11 Thread Chris Wright via Digitalmars-d
On Mon, 11 Jul 2016 06:13:00 -0700, Walter Bright wrote: > On 7/9/2016 8:02 PM, Superstar64 wrote: >> Would it be possible and a good idea to have a language feature that >> allows some exceptions to use error code code generation. > > If you want to return an error code, return an error code.

Re: DIP1001: Exception Handling Extensions

2016-07-11 Thread Chris Wright via Digitalmars-d-announce
On Sun, 10 Jul 2016 21:55:04 +, Superstar64 wrote: > You could use both c style and d stack unwinding: I misread that. The tagged union part applies even if the function can throw some types that don't participate in the compile-time error system.

Re: Associative Array c'tor

2016-07-11 Thread Bahman Movaqar via Digitalmars-d-learn
On 07/11/2016 07:15 PM, Ali Çehreli wrote: > Both AAs and slices behave like reference types even when passed by > value: When a function adds an element, the argument sees that element > as well. This is not the case when the argument is an empty (more > correctly, null) AA or slice: > > void

[Issue 16264] BigInt multiplication crashes on 64-bit (biguintnoasm.d(276): Range violation)

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16264 --- Comment #4 from Kirill Kryukov --- Actually I've no idea why the 32-bit compile works with my initial test. If I add the following unittest into biguintcore.d, and compile in 32-bit (dmd.exe -main -unittest biguintcore.d), it

Re: D is crap

2016-07-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 11 July 2016 at 18:14:11 UTC, Paulo Pinto wrote: Actually NeXTStep drivers were written in Objective-C. NeXT was a cool concept, but it was sad that they picked such an annoying language to build it. They are not alone, as of Android N, Google is making it pretty clear that if

Re: How to use `format` to repeat a character

2016-07-11 Thread Bahman Movaqar via Digitalmars-d-learn
On 07/11/2016 03:02 PM, Mike Parker wrote: > You can do it in D with custom format specifiers. See: > > https://wiki.dlang.org/Defining_custom_print_format_specifiers Thanks for the pointer. I'll keep that in mind. -- Bahman

Re: DIP: Tail call optimization

2016-07-11 Thread Dietrich Daroch via Digitalmars-d-announce
On Tuesday, 12 July 2016 at 01:42:13 UTC, Andrew Godfrey wrote: On Monday, 11 July 2016 at 17:31:23 UTC, Dietrich Daroch wrote: On Monday, 11 July 2016 at 16:27:38 UTC, Andrew Godfrey wrote: [...] * It must not be ignorable by the compiler. * It must generate an error if that compiler would

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 11 July 2016 at 22:09:11 UTC, Walter Bright wrote: at one or more of the factors, Scheme included. Not Prolog either, a singularly useless, obscure and failed language. Err... Prolog is in use and has been far more influential on the state of art than C++ or D ever will. I think

[Issue 16267] New: Windows modules are missing key information

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16267 Issue ID: 16267 Summary: Windows modules are missing key information Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: trivial

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Andrei Alexandrescu via Digitalmars-d
On 07/11/2016 01:50 PM, deadalnix wrote: On Friday, 8 July 2016 at 19:26:59 UTC, Andrei Alexandrescu wrote: On 07/08/2016 02:42 PM, deadalnix wrote: It is meaningless because sometime, you have A and B that are both safe on their own, but doing both is unsafe. In which case A or B need to be

[Issue 16266] @safe functions may dereference non-dereferenceable pointers

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16266 Andrei Alexandrescu changed: What|Removed |Added Keywords||safe --

[Issue 16266] New: @safe functions may dereference non-dereferenceable pointers

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16266 Issue ID: 16266 Summary: @safe functions may dereference non-dereferenceable pointers Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Re: Evaluation order of "+="

2016-07-11 Thread deadalnix via Digitalmars-d
On Monday, 11 July 2016 at 23:04:00 UTC, Johan Engelen wrote: LDC recently changed the evaluation order of "+=" (I think unintentionally, some other eval order problems were fixed). Now, it is different from DMD. I am going to argue that I think DMD's order is more useful in the context of

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread deadalnix via Digitalmars-d
On Tuesday, 12 July 2016 at 01:28:31 UTC, Walter Bright wrote: I don't see anything actionable in your comment. Defining by which way @safe actually ensure safety would be a good start. I'm sorry for the frustration, but the "mention a problem, get asked for an example, provide example,

[Issue 16264] BigInt multiplication crashes on 64-bit (biguintnoasm.d(276): Range violation)

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16264 --- Comment #3 from Kirill Kryukov --- Here is the reason 32-bit BigUint multiplication works: std/internal/math/biguintcore.d has the following: version(D_InlineAsm_X86) { import std.internal.math.biguintx86; } else {

[Issue 12558] try/catch allows implicit catching of Errors without specifying any Exception type

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12558 --- Comment #17 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b10643986838584198db382c63e488aab4e5b343 Issue 12558 - Document implicit catch statement deprecation

Re: DIP: Tail call optimization

2016-07-11 Thread Andrew Godfrey via Digitalmars-d-announce
On Monday, 11 July 2016 at 17:31:23 UTC, Dietrich Daroch wrote: On Monday, 11 July 2016 at 16:27:38 UTC, Andrew Godfrey wrote: [...] * It must not be ignorable by the compiler. * It must generate an error if that compiler would be unable to do the TCO. Otherwise, the compiler *may* (not

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 5:34 PM, sarn wrote: Walter said "all programming languages", but he's obviously referring to the programming market D is in. I said "all USEFUL programming languages", thereby excluding toys, research projects, etc. Of course, "useful" is a slippery concept, but a good proxy

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 5:15 PM, deadalnix wrote: On Monday, 11 July 2016 at 21:52:36 UTC, Walter Bright wrote: The root problem is that "@safe guarantee memory safety and if it doesn't it is a bug" provides no information as to what is the bug here and no actionable items as to how to fix it, or even as

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread deadalnix via Digitalmars-d
On Tuesday, 12 July 2016 at 00:34:12 UTC, sarn wrote: On Monday, 11 July 2016 at 22:09:11 UTC, Walter Bright wrote: On 7/10/2016 10:07 PM, Ola Fosheim Grøstad wrote: [Snip stuff about Scheme] Scheme is a really nice, elegant language that's fun to hack with, but at the end of the day, if

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread sarn via Digitalmars-d
On Monday, 11 July 2016 at 22:09:11 UTC, Walter Bright wrote: On 7/10/2016 10:07 PM, Ola Fosheim Grøstad wrote: [Snip stuff about Scheme] Scheme is a really nice, elegant language that's fun to hack with, but at the end of the day, if people were writing Nginx, or the Windows kernel, or HFT

structure alignment

2016-07-11 Thread Adam Sansier via Digitalmars-d-learn
I need to align every member of every struct in a module. I can't simply add align(n) inside every struct because that seems ridiculous. I could search and paste, but then D is missing a relatively important aspect of alignment. I have about 100 struct's to align, member wise. From what I've

[Issue 14450] Incorrect overloading of immutable constructor for template struct

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14450 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 14450] Incorrect overloading of immutable constructor for template struct

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14450 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/9da3b92799d25c5459c4e35b47114596d9ec5720 fix Issue 14450 - Incorrect overloading of immutable

Re: Evaluation order of "+="

2016-07-11 Thread deadalnix via Digitalmars-d
On Monday, 11 July 2016 at 23:31:40 UTC, Danika wrote: On Monday, 11 July 2016 at 23:04:00 UTC, Johan Engelen wrote: LDC recently changed the evaluation order of "+=" (I think unintentionally, some other eval order problems were fixed). Now, it is different from DMD. I am going to argue that I

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread deadalnix via Digitalmars-d
On Monday, 11 July 2016 at 21:52:36 UTC, Walter Bright wrote: The root problem is that "@safe guarantee memory safety and if it doesn't it is a bug" provides no information as to what is the bug here and no actionable items as to how to fix it, or even as to what needs fixing. It's kind of

Re: how to mark an extern function @nogc?

2016-07-11 Thread Adam Sansier via Digitalmars-d-learn
On Monday, 11 July 2016 at 15:54:02 UTC, Seb wrote: On Monday, 11 July 2016 at 01:59:51 UTC, Adam Sansier wrote: On Monday, 11 July 2016 at 01:58:23 UTC, Adam Sansier wrote: I'm using some win functions that don't use the gc and are not marked, specifically CLSIDFromString that I imported

Re: Evaluation order of "+="

2016-07-11 Thread Danika via Digitalmars-d
On Monday, 11 July 2016 at 23:04:00 UTC, Johan Engelen wrote: LDC recently changed the evaluation order of "+=" (I think unintentionally, some other eval order problems were fixed). Now, it is different from DMD. I am going to argue that I think DMD's order is more useful in the context of

Evaluation order of "+="

2016-07-11 Thread Johan Engelen via Digitalmars-d
LDC recently changed the evaluation order of "+=" (I think unintentionally, some other eval order problems were fixed). Now, it is different from DMD. I am going to argue that I think DMD's order is more useful in the context of fibers, and would like your opinion. Consider this code: ``` int

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/10/2016 10:07 PM, Ola Fosheim Grøstad wrote: Face it, your argument is destroyed :-) Of course not. Trying to reparse and reframe your answers isn't going to help. I know all those rhetorical tricks . I wrote: > All useful computer languages are unprincipled and complex due to a

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 11:57 AM, deadalnix wrote: Alright, but keep in mind that is an example, not the actual problem I'm talking about. There are many reasonable way to make the example above safe: disallow dereferencing pointers from unknown source, Once you're in @safe code, the assumption is that

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 10:50 AM, deadalnix wrote: foo assume that creating an invalid pointer is not safe, while bar assume that .ptr is safe as it doesn't access memory. If the slice's size is 0, that is not safe. There's a PR to fix this: https://github.com/dlang/dmd/pull/5860

Re: UB in D

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 11:47 AM, deadalnix wrote: As you can see the behavior of each component here is fairly reasonable. However, the end result may not be. As was mentioned elsewhere, integers getting indeterminate values only results in memory corruption if the language has an unsafe memory model.

[Issue 16197] Constructors/postblits and destructors don't match up for array initialisation

2016-07-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16197 Andrei Alexandrescu changed: What|Removed |Added CC||and...@erdani.com

Re: Card on fire

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 7:49 AM, Meta wrote: It wouldn't happen to be an nVidia card, would it? MSI GeForce GT 720 DirectX 12 N720-1GD3HLP 1GB 64-Bit DDR3 PCI Express 2.0 x16 HDCP Ready Video Card The fire happened at the junction between the graphics card and the motherboard. I'm not totally sure

Re: How to create nogc code?

2016-07-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, July 11, 2016 03:51:27 Adam Sansier via Digitalmars-d-learn wrote: > You know, you don't see your argument much in C++ forums. In > fact, it's probably the opposite ;) C++ doesn't have a GC built-in and does not have features that rely on it. So, it's in a very different situation. And

Re: Card on fire

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/11/2016 6:06 AM, Steven Schveighoffer wrote: That's kind of scary. It's one of those things you don't think about happening -- like what if you weren't home if this happened. Could have been a lot worse. Yeah, I consider myself very lucky, as I leave the machine on all the time. I was

Re: Card on fire

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/9/2016 7:43 PM, Andrei Alexandrescu wrote: Got a text from Walter - his famous fanless graphics card caught fire along with the motherboard. He'll be outta commission for a few days. -- I can do email and such with my laptop, but it is not suitable for development. I spent yesterday

Re: Card on fire

2016-07-11 Thread Walter Bright via Digitalmars-d
On 7/9/2016 9:11 PM, A.B wrote: https://www.youtube.com/watch?v=NOErZuzZpS8 You must be older than me to think of that song!

How can you call a stored function in an AA with proper number of arguments converted to the proper type?

2016-07-11 Thread Zekereth via Digitalmars-d-learn
Here's the basic code I'm playing with: struct MyCmd { Variant func; // Has other members. } MyCmd[string] functions_; void addCommand(T)(const string name, T func) { MyCmd cmd; cmd.func = Variant(func); functions_[name] = cmd; } void process(string[]

Re: Announcing new DIP handling process

2016-07-11 Thread Seb via Digitalmars-d-announce
On Saturday, 9 July 2016 at 12:56:48 UTC, Dicebot wrote: After quite some preliminary discussions and preparations, new D Improvement Proposals handling process is finally happenning. Please read description and explanation here: [...] On reddit Steve Klabnik from the Rust team mentioned

Re: DIP1001: Exception Handling Extensions

2016-07-11 Thread Superstar64 via Digitalmars-d-announce
On Sunday, 10 July 2016 at 19:55:37 UTC, Superstar64 wrote: link: https://github.com/dlang/DIPs/pull/9 file: https://github.com/Superstar64/DIPs/blob/exception_extensions/DIPs/DIP1001.md I'm not too familiar with stack unwinding generation, but would generating a separate unwind table for

Re: D is crap

2016-07-11 Thread Charles Hixson via Digitalmars-d
Garbage collection allows many syntax "liberalizations" that lack of garbage collection renders either impossible or highly dangerous. (In this definition of "garbage collection" I'm including variations like reference counting.) For an example of this consider the dynamic array type. You

Re: sorting std.container

2016-07-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/11/16 2:54 PM, George M wrote: Hello everybody, sorry for my bad english(nativ german). D is a very nice language and easy to learn because i am a c# (only private) developer. The only bad is to find examples is very hard. My question: How can i sort a slist or dlist with custom types and

Re: sorting std.container

2016-07-11 Thread George M via Digitalmars-d-learn
On Monday, 11 July 2016 at 19:12:13 UTC, ketmar wrote: p.s. i mean simple D dynamic arrays, like `MyType[] arr;`, not std.array.array. ;-) Ok thank you all for the fast help. I will use Dynamic arrys. For this case my code is working. Super language and super forum :-) Thanks!!

Re: D is crap

2016-07-11 Thread Jacob Carlborg via Digitalmars-d
On 2016-07-11 14:23, Luís Marques wrote: Doesn't seem to work for me on 10.11.5. Maybe you need to enable that on the latest OSes? It works for me. I don't recall specifically enabling crash reports. Are you looking at "All Messages"? You can also look at ~/Library/Logs/DiagnosticReports to

Re: Go's march to low-latency GC

2016-07-11 Thread deadalnix via Digitalmars-d
On Monday, 11 July 2016 at 13:05:09 UTC, Russel Winder wrote: Agreed. I don't know why golang guys bother about it. Because they have nothing else to propose than massive goroutine orgy so they kind of have to make it work. Maybe because they are developing a language for the 1980s? ;-)

Re: sorting std.container

2016-07-11 Thread ketmar via Digitalmars-d-learn
p.s. i mean simple D dynamic arrays, like `MyType[] arr;`, not std.array.array. ;-)

Re: sorting std.container

2016-07-11 Thread ketmar via Digitalmars-d-learn
list slices are not random-access ranges, thus they can't be sorted in-place (this is what std.algorithm.sort does). so the only way is to convert list to array, sort it, and make a list from sorted array. probably not something you want. ;-) this is common for any "traditional" linked list

Re: sorting std.container

2016-07-11 Thread Lodovico Giaretta via Digitalmars-d-learn
On Monday, 11 July 2016 at 18:54:44 UTC, George M wrote: Hello everybody, sorry for my bad english(nativ german). D is a very nice language and easy to learn because i am a c# (only private) developer. The only bad is to find examples is very hard. My question: How can i sort a slist or

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread deadalnix via Digitalmars-d
On Monday, 11 July 2016 at 18:00:20 UTC, Steven Schveighoffer wrote: On 7/11/16 1:50 PM, deadalnix wrote: On Friday, 8 July 2016 at 19:26:59 UTC, Andrei Alexandrescu wrote: On 07/08/2016 02:42 PM, deadalnix wrote: It is meaningless because sometime, you have A and B that are both safe on

sorting std.container

2016-07-11 Thread George M via Digitalmars-d-learn
Hello everybody, sorry for my bad english(nativ german). D is a very nice language and easy to learn because i am a c# (only private) developer. The only bad is to find examples is very hard. My question: How can i sort a slist or dlist with custom types and lambda expressions? The sort

Re: UB in D

2016-07-11 Thread deadalnix via Digitalmars-d
On Saturday, 9 July 2016 at 23:44:07 UTC, H. S. Teoh wrote: I find this rather disturbing, actually. There is a fine line between taking advantage of assert's to elide stuff that the programmer promises will not happen, and eliding something that's defined to be UB and thereby resulting in

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Jack Stouffer via Digitalmars-d
On Monday, 11 July 2016 at 18:18:22 UTC, deadalnix wrote: Lisp. Which one?

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread deadalnix via Digitalmars-d
On Saturday, 9 July 2016 at 00:14:34 UTC, Walter Bright wrote: On 7/8/2016 2:58 PM, Ola Fosheim Grøstad wrote: On Friday, 8 July 2016 at 21:24:04 UTC, Walter Bright wrote: On 7/7/2016 5:56 PM, deadalnix wrote: While this very true, it is clear that most D's complexity doesn't come from there.

Re: D is crap

2016-07-11 Thread Paulo Pinto via Digitalmars-d
On Monday, 11 July 2016 at 16:44:27 UTC, Ola Fosheim Grøstad wrote: On Monday, 11 July 2016 at 16:26:11 UTC, Paulo Pinto wrote: Happy not to disappoint. :) You never disappoint in the GC department ;-) OS vendors are the ones that eventually decided what is a systems programming language

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread Steven Schveighoffer via Digitalmars-d
On 7/11/16 1:50 PM, deadalnix wrote: On Friday, 8 July 2016 at 19:26:59 UTC, Andrei Alexandrescu wrote: On 07/08/2016 02:42 PM, deadalnix wrote: It is meaningless because sometime, you have A and B that are both safe on their own, but doing both is unsafe. In which case A or B need to be

Re: Vision for the D language - stabilizing complexity?

2016-07-11 Thread deadalnix via Digitalmars-d
On Friday, 8 July 2016 at 19:26:59 UTC, Andrei Alexandrescu wrote: On 07/08/2016 02:42 PM, deadalnix wrote: It is meaningless because sometime, you have A and B that are both safe on their own, but doing both is unsafe. In which case A or B need to be banned, but nothing allows to know which

Re: how to mark an extern function @nogc?

2016-07-11 Thread Anonymouse via Digitalmars-d-learn
On Monday, 11 July 2016 at 15:54:02 UTC, Seb wrote: On Monday, 11 July 2016 at 01:59:51 UTC, Adam Sansier wrote: On Monday, 11 July 2016 at 01:58:23 UTC, Adam Sansier wrote: I'm using some win functions that don't use the gc and are not marked, specifically CLSIDFromString that I imported

Re: DIP: Tail call optimization

2016-07-11 Thread Dietrich Daroch via Digitalmars-d-announce
On Monday, 11 July 2016 at 16:27:38 UTC, Andrew Godfrey wrote: [...] * It must not be ignorable by the compiler. * It must generate an error if that compiler would be unable to do the TCO. Otherwise, the compiler *may* (not "must") apply the TCO, unless compiled under (some optimization

Re: Go's march to low-latency GC

2016-07-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 11 July 2016 at 17:14:17 UTC, jmh530 wrote: On Monday, 11 July 2016 at 13:13:02 UTC, Patrick Schluter wrote: Because of attitudes like shown in that thread https://forum.dlang.org/post/ilbmfvywzktilhskp...@forum.dlang.org people who do not really understand why 32 bit systems are a

Re: Go's march to low-latency GC

2016-07-11 Thread jmh530 via Digitalmars-d
On Monday, 11 July 2016 at 13:13:02 UTC, Patrick Schluter wrote: Because of attitudes like shown in that thread https://forum.dlang.org/post/ilbmfvywzktilhskp...@forum.dlang.org people who do not really understand why 32 bit systems are a really problematic even if the apps don't use more than

Re: NanoSVG port

2016-07-11 Thread ketmar via Digitalmars-d-announce
also, i extended the original library a little: added rudimentary support for "style" tag and styling svg elements. nothing fancy, but many svgs found in internet are using that to avoid repeating "style" everywhere. it is a dirty hack (sorry), but makes even more svgs "renderable".

Re: Rant after trying Rust a bit

2016-07-11 Thread Max Samukha via Digitalmars-d
On Thursday, 6 August 2015 at 06:54:45 UTC, Walter Bright wrote: On 8/3/2015 2:19 AM, Max Samukha wrote: The point is that '+' for string concatenation is no more of an 'idiot thing' than '~'. Sure it is. What if you've got: T add(T)(T a, T b) { return a + b; } and some idiot overloaded

Re: D is crap

2016-07-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 11 July 2016 at 16:26:11 UTC, Paulo Pinto wrote: Happy not to disappoint. :) You never disappoint in the GC department ;-) OS vendors are the ones that eventually decided what is a systems programming language on their OSes. To a large extent on Apple and Microsoft OSes. Not so

Re: faster splitter

2016-07-11 Thread Henrique bucher via Digitalmars-d
On Monday, 30 May 2016 at 18:20:39 UTC, Andrei Alexandrescu wrote: On 05/30/2016 05:31 AM, qznc wrote: On Sunday, 29 May 2016 at 21:07:21 UTC, qznc wrote: worthwhile to use word loads [0] instead. Really fancy would be SSE. I wrote a splitter in SSE4.2 some time ago as acontribution to a

Re: D is crap

2016-07-11 Thread Guillaume Piolat via Digitalmars-d
On Monday, 11 July 2016 at 14:12:35 UTC, Chris wrote: You focus on a small niche where people use all kinds of performance tricks even in C and C++. A lot of software doesn't care about GC overheads, however, and without GC a lot of people wouldn't even have considered it. +1 A large

new cpuid is ready for comments

2016-07-11 Thread Ilya Yaroshenko via Digitalmars-d-announce
Hello :-) `cpuid` package is core.cpuid analog. It would be used by future D BLAS implementation. Why it is better? See https://github.com/libmir/cpuid#api-features https://github.com/libmir/cpuid#implementation-features https://issues.dlang.org/show_bug.cgi?id=16028 Please report your CPU

Re: DIP: Tail call optimization

2016-07-11 Thread Andrew Godfrey via Digitalmars-d-announce
On Monday, 11 July 2016 at 15:27:54 UTC, Dietrich Daroch wrote: On Monday, 11 July 2016 at 14:36:22 UTC, Andrew Godfrey wrote: On Monday, 11 July 2016 at 10:25:36 UTC, Tofu Ninja wrote: On Sunday, 10 July 2016 at 13:15:38 UTC, Andrew Godfrey wrote: Btw here's a thread from 2014 that touches on

Re: DIP: Tail call optimization

2016-07-11 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Monday, 11 July 2016 at 16:18:47 UTC, Dietrich Daroch wrote: Previous discussion seems to favour @unboundedStack as it can become a requirement to go beyond the stack-size-safe operations effectibly tracking where stack overflow may happen and encourage detailed review of those functions.

Re: D is crap

2016-07-11 Thread Paulo Pinto via Digitalmars-d
On Monday, 11 July 2016 at 14:58:16 UTC, Ola Fosheim Grøstad wrote: On Monday, 11 July 2016 at 14:45:56 UTC, Paulo Pinto wrote: The biggest problem with D isn't the GC, is lack of focus to make it stand out versus .NET Native, Swift, Rust, Ada, SPARK, Java, C++17. I knew you would chime

Re: DIP: Tail call optimization

2016-07-11 Thread Dietrich Daroch via Digitalmars-d-announce
On Monday, 11 July 2016 at 15:48:08 UTC, Ola Fosheim Grøstad wrote: On Monday, 11 July 2016 at 15:27:54 UTC, Dietrich Daroch wrote: I've been thinking about changing @tco for @boundedStack, as it'll really reflect guarantees on functions while implicitly asking for TCO on functions that

Re: How to use `format` to repeat a character

2016-07-11 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Jul 11, 2016 at 02:53:24PM +0430, Bahman Movaqar via Digitalmars-d-learn wrote: > On 07/11/2016 02:44 PM, ketmar wrote: [...] > > the fact that format can insert spaces. it is like: "ok, it can do > > spaces. i bet there should be some way to use any character instead > > of space. after

Re: How to use `format` to repeat a character

2016-07-11 Thread Meta via Digitalmars-d-learn
On Monday, 11 July 2016 at 09:02:12 UTC, Bahman Movaqar wrote: I'm sure I'm missing something very simple but how can I create a string like "" using `format`? I check the docs on `format` and tried many variations including `format("%.*c\n", 4, '-')` but got nowhere. I'd appreciate any

Re: Go's march to low-latency GC

2016-07-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 11 July 2016 at 13:05:09 UTC, Russel Winder wrote: Maybe because they are developing a language for the 1980s? ;-) It is quite common for web services to run with less than 1GB. 64bit would be very wasteful.

Re: how to mark an extern function @nogc?

2016-07-11 Thread Seb via Digitalmars-d-learn
On Monday, 11 July 2016 at 01:59:51 UTC, Adam Sansier wrote: On Monday, 11 July 2016 at 01:58:23 UTC, Adam Sansier wrote: I'm using some win functions that don't use the gc and are not marked, specifically CLSIDFromString that I imported myself(it's not marked nogc in objbase). I went ahead

  1   2   >