Can nice D code get a bit slow?

2023-03-08 Thread Markus via Digitalmars-d-learn
Hi, sorry for the broad and vague question. I have read in some reddit post about benchmarks, that some code didn't use the final keyword on methods in a sense that final would make it faster, I believe. I thought, without any D knowledge, it could be that with shorter code I might create

Re: Binary Literals Not Going Anywhere

2022-09-26 Thread Markus via Digitalmars-d-announce
On Monday, 26 September 2022 at 04:40:02 UTC, Mike Parker wrote: You may have seen [the long discussion about the deprecation of binary literals(https://forum.dlang.org/thread/vphguaninxedxopjk...@forum.dlang.org). A few hours ago, Walter and I recorded a second conversation for our YouTube

Re: DIP 1043---Shortened Method Syntax---Accepted

2022-09-21 Thread Markus via Digitalmars-d-announce
On Wednesday, 21 September 2022 at 10:39:27 UTC, Mike Parker wrote: For example: T front() => from; becomes: T front => from; I kind of agree with Max's contention, but nonetheless, I quite like it.

Re: I want an exception message but my threaded callback just dies or crashes

2019-06-12 Thread Markus via Digitalmars-d-learn
On Tuesday, 11 June 2019 at 05:15:17 UTC, Markus wrote: I have cleaned it up, kind of. Just in case you want to compile it. The Zip contains some DLL from https://github.com/spatialaudio/portaudio-binaries where you can find the original if you want. https://gofile.io/?c=NpUxrJ I'm in

Re: I want an exception message but my threaded callback just dies or crashes

2019-06-10 Thread Markus via Digitalmars-d-learn
I have cleaned it up, kind of. Just in case you want to compile it. The Zip contains some DLL from https://github.com/spatialaudio/portaudio-binaries where you can find the original if you want. https://gofile.io/?c=NpUxrJ I'm in general thinking of buying a Mac. I know it has not much to

I want an exception message but my threaded callback just dies or crashes

2019-06-10 Thread Markus via Digitalmars-d-learn
Hi, when you use core.windows and LoadLibrary to load a DLL, and that DLL will create a new thread and inside that it will call back into your D app, is there something to special to be aware of? I've done it like with the CreateWindow and WndProc, but this time I'm loading a compiled

Re: How can I get a backtrace when my WndProc throws?

2019-06-03 Thread Markus via Digitalmars-d-learn
On Monday, 3 June 2019 at 12:09:18 UTC, Adam D. Ruppe wrote: Don't use just e.msg, that's just the string the constructor sent, use e.toString and see if it works for you. toString works, thanks! :)

How can I get a backtrace when my WndProc throws?

2019-06-03 Thread Markus via Digitalmars-d-learn
Hi, I'm using core.sys.windows.windows to make a Windows GUI, and the WindowProc must be nothrow. My code does not provide me a stack backtrace when some exception is thrown in there. I would like to have at least the number of the line that caused a throw, has anyone an idea how to do this?

Re: DLS (D Language Server) v0.20

2018-12-30 Thread Markus via Digitalmars-d-announce
On Friday, 28 December 2018 at 11:14:01 UTC, Laurent Tréguier wrote: [...] Wow, just awesome! I really love this language server. It just works!

Re: getopt defaultGetoptPrinter is not safe. Is there a reason for that?

2018-08-17 Thread Markus via Digitalmars-d-learn
On Friday, 17 August 2018 at 08:09:52 UTC, Markus wrote: I wonder what's the reason for that? I wonder why it's not at least @trusted. Literally, can't I trust that method/function?

getopt defaultGetoptPrinter is not safe. Is there a reason for that?

2018-08-17 Thread Markus via Digitalmars-d-learn
Hi. I'm a big fan of @safe code. But within my first 20 program lines I already run into problems: Error: @safe function D main cannot call @system function std.getopt.defaultGetoptPrinter https://dlang.org/phobos/std_getopt.html#.defaultGetoptPrinter I wonder what's the reason for that?

OT: today in reddit ProgrammerHumor - The Evolution of C

2018-05-29 Thread Markus via Digitalmars-d
https://www.reddit.com/r/ProgrammerHumor/comments/8mtfy5/the_evolution_of_c/

interfacing c++ templates. Another c++-namespace issue?

2018-03-16 Thread Markus via Digitalmars-d
Hi [template.cpp]: template void some_templated_function(); template<> void some_templated_function() {} [main.d]: extern(C++) { void some_templated_function(Type)(); } void main() { some_templated_function!int; } compilation: g++ -c template_with_ns.cpp dmd main.d template.o this

Re: D and C++ undefined reference when namespace

2018-03-09 Thread Markus via Digitalmars-d
On Thursday, 8 March 2018 at 21:14:36 UTC, Steven Schveighoffer wrote: On 3/8/18 2:01 PM, Steven Schveighoffer wrote: On 3/8/18 1:56 PM, Markus wrote: I tested dmd (2.079.0), gdc and ldc2. All got the same result. Which makes me think, that it's not a bug, but a "feature" :) This is

Re: D and C++ undefined reference when namespace

2018-03-08 Thread Markus via Digitalmars-d
On Thursday, 8 March 2018 at 17:04:02 UTC, Steven Schveighoffer wrote: On 3/8/18 11:35 AM, Markus wrote: When I do this locally on my mac, I get a similar error. When I nm the main.o file vs. the lib.o file, I see different mangled names. It appears that the D mangled name is not doing back

Re: D and C++ undefined reference when namespace

2018-03-08 Thread Markus via Digitalmars-d
On Thursday, 8 March 2018 at 16:19:40 UTC, Steven Schveighoffer wrote: On 3/8/18 10:27 AM, Markus wrote: Hi I got the following c++ code [lib.cpp]: namespace ns_a {   class class_a {   };   void some_function(class_a*) {;} } and the following d code [main.d]: extern (C++, namespace_a) {

Re: D and C++ undefined reference when namespace

2018-03-08 Thread Markus via Digitalmars-d
On Thursday, 8 March 2018 at 15:27:31 UTC, Markus wrote: Hi I got the following c++ code [lib.cpp]: namespace ns_a { class class_a { }; void some_function(class_a*) {;} } and the following d code [main.d]: extern (C++, namespace_a) { class class_a {} void some_function(class_a);

D and C++ undefined reference when namespace

2018-03-08 Thread Markus via Digitalmars-d
Hi I got the following c++ code [lib.cpp]: namespace ns_a { class class_a { }; void some_function(class_a*) {;} } and the following d code [main.d]: extern (C++, namespace_a) { class class_a {} void some_function(class_a); } void main() { namespace_a.class_a instance_a;

Re: Visual D >> TRACKER : error TRK0004: Failed to locate: "FileTracker32.dll". The system cannot find the file specified.

2018-02-02 Thread Markus via Digitalmars-d-learn
On Tuesday, 21 November 2017 at 04:39:52 UTC, A Guy With a Question wrote: I'm trying to learn D using Visual D in Visual Studio Community 2015. Both dmd and ldc give me this error when building from Visual Studio. Any ideas? I'm able to build C++ projects... I had to update "Visual Studio

Re: interfacing c++

2017-11-22 Thread Markus via Digitalmars-d-learn
another indicator (as documented) that GC destructor won't work // extern(C++) classes don't have a classinfo pointer in their vtable so the GC can't finalize them https://github.com/dlang/druntime/blob/3d8d4a45c01832fb657c16a656b6e1566d77fb21/src/rt/lifetime.d#L90 annoying :( Markus

Re: interfacing c++

2017-11-22 Thread Markus via Digitalmars-d-learn
On Wednesday, 22 November 2017 at 08:43:54 UTC, drug wrote: 22.11.2017 02:12, Markus пишет: What about dtor - you allocate class using D GC but try to destroy it manually - namely this I guess gives you an error in rt_finalize2 because it tries to destroy object that has been destroyed.

interfacing c++

2017-11-21 Thread Markus via Digitalmars-d-learn
hi, im trying to interface a cpp class. I'd like to interface a bigger library and I'm trying to figure out the minimum effort. --- c++ part: #include class some_class { public: static some_class* __ctor(); some_class(); ~some_class(); void some_method(); }; some_class*

Re: Why D is not popular enough?

2016-08-30 Thread Markus via Digitalmars-d
On Tuesday, 30 August 2016 at 07:56:06 UTC, Markus wrote: On Monday, 29 August 2016 at 14:31:50 UTC, eugene wrote: On Monday, 29 August 2016 at 12:11:34 UTC, Markus wrote: [...] Hello, the url https://dlang.org/overview.html states that "It's a practical language for practical

Re: Why D is not popular enough?

2016-08-30 Thread Markus via Digitalmars-d
On Monday, 29 August 2016 at 14:31:50 UTC, eugene wrote: On Monday, 29 August 2016 at 12:11:34 UTC, Markus wrote: Take a look on this discussion thread and you know WHY D IS NOT SO POPULAR. The community discusses technical details and compares D to C++, but there is no clear mission

Re: Why D is not popular enough?

2016-08-29 Thread Markus via Digitalmars-d
Take a look on this discussion thread and you know WHY D IS NOT SO POPULAR. The community discusses technical details and compares D to C++, but there is no clear mission statement, there is no vision statement and no marketing. Often you merchandise D as a "system programming language",

Re: Choosing D over C++, Go, Rust, Swift

2016-01-21 Thread Markus via Digitalmars-d
From my point of view is the biggest disadvantage in D marketing, that D is only placed as a "systems programming language". The fact is, that D is very usable for numeric and large scale data processing -- so called business software -- but if a manager takes a look on the D homepage he will