Re: Does D have a way to get and pass sturct information at runtime?

2025-06-16 Thread Dmitry Olshansky via Digitalmars-d-learn
On Monday, 16 June 2025 at 07:30:31 UTC, rempas wrote: So, I wanted to create a library to allow D to be used a scripting language, in order to allow it to be used to configure programs. Now, the design of everything is rather simple. However, I do have one problem. Is there a way to pass runt

Re: What are the pointer aliasing rules in D?

2025-03-06 Thread Dmitry Olshansky via Digitalmars-d-learn
till work. Will this work on all or most modern CPUs? Ali — Dmitry Olshansky dmitry at olshansky.me https://olshansky.me

Re: Turning fixed sized array into tuple

2024-05-04 Thread Dmitry Olshansky via Digitalmars-d-learn
On Saturday, 4 May 2024 at 19:11:14 UTC, Nick Treleaven wrote: On Saturday, 4 May 2024 at 16:58:00 UTC, Dmitry Olshansky wrote: So I have a function: ```d size_t awaitAny(T...)(T args) { ... } ``` And I have: ``d Event*[4] events; `` How do I pass all 4 of events to awaitAny as tuple of

Turning fixed sized array into tuple

2024-05-04 Thread Dmitry Olshansky via Digitalmars-d-learn
So I have a function: ```d size_t awaitAny(T...)(T args) { ... } ``` And I have: ``d Event*[4] events; `` How do I pass all 4 of events to awaitAny as tuple of arguments? -- Dmitry Olshansky CEO @ [Glow labs](https://glow-labs.pro) https://olshansky.me/about/

Re: Setting up CI for Dub project on Github

2024-04-08 Thread Dmitry Olshansky via Digitalmars-d-learn
On Monday, 8 April 2024 at 13:23:12 UTC, Richard (Rikki) Andrew Cattermole wrote: On 09/04/2024 1:20 AM, Dmitry Olshansky wrote: I haven’t done any research on the subject, would be nice if somebody pointed me to good example of how it’s done. — Dmitry Olshansky CEO @ Glowlabs https

Setting up CI for Dub project on Github

2024-04-08 Thread Dmitry Olshansky via Digitalmars-d-learn
I haven’t done any research on the subject, would be nice if somebody pointed me to good example of how it’s done. — Dmitry Olshansky CEO @ Glowlabs https://olshansky.me

Re: Limits of implicit conversion of class arrays

2024-03-23 Thread Dmitry Olshansky via Digitalmars-d-learn
allowed in Java). Once you cast the slice you can populate it with Derived2 objects that are not Derived, hence breaking type safety of the ds slice. — Dmitry Olshansky CEO @ Glow labs https://olshansky.me

Linker error, doing something wrong?

2023-07-09 Thread Dmitry Olshansky via Digitalmars-d-learn
l_download.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Error: /usr/bin/cc failed with status: 1 Am I missing something? -- Dmitry Olshansky https://olshansky.me

Re: Easiest CI to build on github.com

2023-07-07 Thread Dmitry Olshansky via Digitalmars-d-learn
On Friday, 7 July 2023 at 10:29:14 UTC, Richard (Rikki) Andrew Cattermole wrote: I believe: https://github.com/dlang-community/setup-dlang Thx! — Dmitry Olshansky CEO @ Glow Labs https://olshansky.me https://t.me/glowlabs32

Easiest CI to build on github.com

2023-07-07 Thread Dmitry Olshansky via Digitalmars-d-learn
Simply enough dub test should pass. How do I go about it? — Dmitry Olshansky CEO @ Glow Labs https://olshansky.me https://t.me/glowlabs32

Re: IntelliJ D language plugin

2023-07-02 Thread Dmitry Olshansky via Digitalmars-d-learn
On Friday, 30 June 2023 at 16:26:26 UTC, Richard (Rikki) Andrew Cattermole wrote: I use it and contribute to it ;) Thanks to Rikki I was able to figure it out. — Dmitry Olshansky https://olshansky.me

IntelliJ D language plugin

2023-06-30 Thread Dmitry Olshansky via Digitalmars-d-learn
Have anyone had any luck with it? So far I'm trying to install DMD as SDK but it fails with not a valid D compiler home. -- Dmitry Olshansky https://olshansky.me

Re: Running LDC on a recent MacOS

2023-06-16 Thread Dmitry Olshansky via Digitalmars-d-learn
On Friday, 16 June 2023 at 16:14:19 UTC, Steven Schveighoffer wrote: On 6/16/23 11:56 AM, Dmitry Olshansky wrote: Any advice from MacOS users? Yep. Go into settings, then privacy and security. Make sure "App store and identified developers" is checked. On that page, you will se

Re: Using DUB packages with Meson

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
On Wednesday, 12 April 2023 at 11:07:56 UTC, Richard (Rikki) Andrew Cattermole wrote: Did you compile the library with dub using ldc2? Yup, I do not have other compilers installed. -- Dmitry Olshansky

Re: Using DUB packages with Meson

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
n/dub (DUB version 1.31.1, built on Mar 12 2023) ERROR: strand found but it wasn't compiled with ldc Run-time dependency strand found: NO src/meson.build:22:0: ERROR: Dependency "strand" not found -- Dmitry Olshansky

Re: Using DUB packages with Meson

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
mesonbuild/dependencies/dub.py i.e. ``dub build [[@]] []`` So use ``package:sub@1.0.2``. Also I just noticed meson doesn't support shared libraries from dub, so something to keep in mind. Oh, Rikki, you are so helpful. Thanks! -- Dmitry Olshansky

Using DUB packages with Meson

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
erstand how to introduce library dependency on a specific DUB package. -- Dmitry Olshansky

Re: Help with registering dub package

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
is there, its just that it needs to be all in one. Thanks, Rikki! — Dmitry Olshansky

Help with registering dub package

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
Could someone walk me through the steps of publish my dub package? I'm stuck with this: https://code.dlang.org/packages/strand For some reason code.dlang.org cannot find my semver tag I guess. -- Dmitry Olshansky

Re: How to build DMD/Phobos on Windows

2022-08-25 Thread Dmitry Olshansky via Digitalmars-d-learn
On Wednesday, 24 August 2022 at 21:11:42 UTC, rikki cattermole wrote: For dmd you use build.d that is in the repository. Hm, I guess the makefiles should be deleted? For phobos win64.mak (used for 32bit by default as well): "# Makefile to build D runtime library phobos{64,32mscoff}.lib for

How to build DMD/Phobos on Windows

2022-08-24 Thread Dmitry Olshansky via Digitalmars-d-learn
It's been a long time but I've found some spare hours I want to devote to finally updating our std.uni to Unicode 14 (soon to migrate to 15 I guess). I downloaded source code of DMD/Phobos as usual and dropped them in the src folder of unpacked 7z distribution archive. Now time to build. Sinc

Re: Why The D Style constants are written in camelCase?

2018-05-09 Thread Dmitry Olshansky via Digitalmars-d-learn
On Wednesday, 9 May 2018 at 09:38:14 UTC, BoQsc wrote: The D Style suggest to camelCase constants, while Java naming conventions always promoted uppercase letter. Is there an explanation why D Style chose to use camelCase instead of all UPPERCASE for constants, was there any technical problem

Re: dynamically allocating on the stack

2018-04-21 Thread Dmitry Olshansky via Digitalmars-d-learn
On Saturday, 21 April 2018 at 14:25:58 UTC, Cym13 wrote: On Saturday, 21 April 2018 at 13:54:14 UTC, H. S. Teoh wrote: On Sat, Apr 21, 2018 at 01:30:55PM +, Cym13 via Digitalmars-d-learn wrote: On Saturday, 21 April 2018 at 12:08:09 UTC, Dmitry Olshansky wrote: [...] > Unboun

Re: dynamically allocating on the stack

2018-04-21 Thread Dmitry Olshansky via Digitalmars-d-learn
On Saturday, 21 April 2018 at 13:30:55 UTC, Cym13 wrote: On Saturday, 21 April 2018 at 12:08:09 UTC, Dmitry Olshansky wrote: On Saturday, 21 April 2018 at 07:37:50 UTC, Mike Franklin wrote: Does D have some way to dynamically allocate on the stack? I'm looking for something roughly equiv

Re: dynamically allocating on the stack

2018-04-21 Thread Dmitry Olshansky via Digitalmars-d-learn
On Saturday, 21 April 2018 at 07:37:50 UTC, Mike Franklin wrote: Does D have some way to dynamically allocate on the stack? I'm looking for something roughly equivalent to the following C code. int doSomething(size_t len) { char stackBuffer[len + 1]; doSomethingElse(stackBuffer); }

Re: Is socket.send thread safe?

2018-03-26 Thread Dmitry Olshansky via Digitalmars-d-learn
On Monday, 26 March 2018 at 16:14:31 UTC, Jonathan wrote: Can I send data over an std.socket on multiple threads without manual mutexing? If not, can I send data on a separate thread than receive? The docs for std.socket say nothing of it (which I guess means I should assume it is not thread

Re: core.stdc.stdlib._compare_fp_t and qsort

2018-03-18 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 18 March 2018 at 18:11:02 UTC, Dmitry Olshansky wrote: On Sunday, 18 March 2018 at 16:45:16 UTC, Joe wrote: [...] No it just creates a pair of pointer to recs[0] + length of recs, like this: struct Array { size_t length; Record* ptr; } In D it’s typed as Record[] and has a

Re: core.stdc.stdlib._compare_fp_t and qsort

2018-03-18 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 18 March 2018 at 16:45:16 UTC, Joe wrote: On Sunday, 18 March 2018 at 13:10:08 UTC, Dmitry Olshansky wrote: Do this to get the usual ptr + length: sort!((a, b) => to!string((*a).name) < to!string((*b).name))(recs[]); Also to!string would be computed on each compare ane

Re: core.stdc.stdlib._compare_fp_t and qsort

2018-03-18 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 18 March 2018 at 11:29:47 UTC, Joe wrote: On Monday, 12 March 2018 at 03:50:42 UTC, Joe wrote: On Monday, 12 March 2018 at 03:13:08 UTC, Seb wrote: Out of interest: I wonder what's your usecase for using qsort. Or in other words: why you can't use the high-level std.algorithm.sortin

Re: Networking library

2018-03-15 Thread Dmitry Olshansky via Digitalmars-d-learn
On Thursday, 15 March 2018 at 00:06:49 UTC, Cecil Ward wrote: Can anyone point me in the direction of a library that provides very very lightweight (minimum overhead) asynchronous i/o routines for - shopping list 1. sending and receiving IPv4 / IPv6 packets, 2. sending receiving ICMP and 3, ha

Re: Garbage collected pointers?

2018-03-01 Thread Dmitry Olshansky via Digitalmars-d-learn
On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote: In the language spec here :- https://dlang.org/spec/garbage.html#pointers_and_gc It refers to a distinction between pointers to garbage collected memory and pointers that are not. In particular it says that with a non garbage collec

Re: forcing tabs in regex

2018-02-27 Thread Dmitry Olshansky via Digitalmars-d-learn
On Wednesday, 28 February 2018 at 05:09:03 UTC, psychoticRabbit wrote: On Wednesday, 28 February 2018 at 01:06:30 UTC, dark777 wrote: Regex validates years bisexto and not bisextos in format: const std::regex pattern(R"(^(?:(?:(0?[1-9]|1\d|2[0-8])([-/.])(0?[1-9]|1[0-2]|[Jj](?:an|u[nl])|[Mm]a[ry

Re: multithread/concurrency/parallel methods and performance

2018-02-19 Thread Dmitry Olshansky via Digitalmars-d-learn
On Monday, 19 February 2018 at 14:57:22 UTC, SrMordred wrote: On Monday, 19 February 2018 at 05:54:53 UTC, Dmitry Olshansky wrote: The operation is trivial and dataset is rather small. In such cases SIMD with eg array ops is the way to go: result[] = values[] * values2[]; Yes, absolutely

Re: multithread/concurrency/parallel methods and performance

2018-02-18 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 18 February 2018 at 17:54:58 UTC, SrMordred wrote: I´m experimenting with threads and related recently. (i´m just started so may be some terrrible mistakes here) With this base work: foreach(i ; 0 .. SIZE) { results[i] = values1[i] * values2[i]; } and then with this 3 others met

Re: Get largest heap object at runtime? ...tracking the leak

2018-01-21 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 21 January 2018 at 17:28:13 UTC, Andres Clari wrote: Hi, is there any way to get from the GC all allocated objects, so I can see their size and find where I'm leaking memory? Or perhaps a good tool to help with this issue... I tried building my program with "profile-gc" but I got an

D on Power8 (PPC64)

2017-08-07 Thread Dmitry Olshansky via Digitalmars-d-learn
What is the status of the platform? I might be doing some number crunching on one of the power8 beasts, would be nice to have D working there. --- Dmitry Olshansky

Re: Is it ok to inherit multiple times same templated interface?

2017-01-15 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 15 January 2017 at 20:33:30 UTC, Alexandru Ermicioi wrote: Good day, Given following code example, where a templated interface Wr, and an implementation Im is present: From the standpoint of the compiler they are 3 distinct interfaces, so all is good. interface Wr(T) { T g

Re: Build your own Trie entry table

2016-12-27 Thread Dmitry Olshansky via Digitalmars-d-learn
Please file a bug report for Phobos basically stating your use case and the visibility problem. Thanks Rémi ---- Dmitry Olshansky

Re: Degenerate Regex Case

2015-04-25 Thread Dmitry Olshansky via Digitalmars-d-learn
Thompson NFA. Compile-time is (for now) still backtracking. --- Dmitry Olshansky

Re: Profiling

2014-01-24 Thread Dmitry Olshansky
ere a page somewhere on dlang.org that explains how to use the profiler? http://digitalmars.com/ctg/trace.html see Dynamic Profiling With DMD Thanks, Philippe -- Dmitry Olshansky

Re: Get "discarded" data from std.regex.splitter (or something else?)

2014-01-16 Thread Dmitry Olshansky
at? Well these 3 pieces are _slices_ of the original input, and with a bit of calculations on .ptr and .length you can figure out what's in between. Also you can just use matchAll which too, does return slices. It could be seen as dropping all in between matches ;) -Steve -- Dmitry Olshansky

Re: Building D from source on Windows

2014-01-16 Thread Dmitry Olshansky
- always first build druntime, then Phobos. Always with the same MODEL. I've found that to cleanly build x64 and 32 on windows I have to run clean between builds (unlike in Linux/MacOS). -- Dmitry Olshansky

Re: module std.regex

2013-12-31 Thread Dmitry Olshansky
31-Dec-2013 00:03, Benji пишет: On Monday, 30 December 2013 at 19:27:43 UTC, Dmitry Olshansky wrote: 30-Dec-2013 22:08, Benji пишет: Hello, when I try to run following code: [snip] This is part of core developers discussion and isn't something easily tweaked (else it would've be

Re: module std.regex

2013-12-30 Thread Dmitry Olshansky
Somewhere I read that this should fix it: - Make ModuleInfos immutable, which is something we should do anyhow. This is part of core developers discussion and isn't something easily tweaked (else it would've been already fixed). -- Dmitry Olshansky

Re: std.regex literal syntax (the \Q…\E escape sequence)

2013-12-18 Thread Dmitry Olshansky
19-Dec-2013 01:05, Andrej Mitrovic пишет: On 12/18/13, Dmitry Olshansky wrote: The precedent is Perl. A heavy influencer on the (former) std.regex design. http://perldoc.perl.org/perlre.html#Capture-groups (grep for $') Ah, classic Perl. Write once - don't bother to read ever again

Re: std.regex literal syntax (the \Q…\E escape sequence)

2013-12-18 Thread Dmitry Olshansky
18-Dec-2013 23:54, Andrej Mitrovic пишет: On 12/18/13, Dmitry Olshansky wrote: P.S. This reminds me to put a roadmap of sorts on where std.regex is going and what to expect. Btw one thing I'm not fond of is the format specifiers, in particular: $` part of input preceding the

Re: std.regex literal syntax (the \Q…\E escape sequence)

2013-12-18 Thread Dmitry Olshansky
mplement - does it affect backwards compatibility - any other hidden costs I'd be glad to implement well motivated enhancement requests. P.S. This reminds me to put a roadmap of sorts on where std.regex is going and what to expect. -- Dmitry Olshansky

Re: tango -D2 regex

2013-12-16 Thread Dmitry Olshansky
again try to match what bmatch returned?) Simply put match/bmatch will return a range of matches as they are found in the input. Each match is, in turn, a random access range that contains full match, followed by each sub-match in the pattern. -- Dmitry Olshansky

Re: tango -D2 regex

2013-12-16 Thread Dmitry Olshansky
std.regex of Phobos this should just work. auto re = regex(`^(\w*)FOO\1$`); assert("barFOObar".match(re)); Syntax is like in JavaScript or Perl. How to do the samein Tango for D2 (or even phobos for D2)? -- Dmitry Olshansky

Re: std.algorithm.splitter improovement?

2013-12-14 Thread Dmitry Olshansky
one that uses predicate. AFAIK the default predicate is std.uni.isWhite. ["hello", "world"] ["hello", "world"] ["hello", "", "world"] Bye, bearophile -- Dmitry Olshansky

Running DMD tests

2013-12-08 Thread Dmitry Olshansky
nable_tests] Error 2 dmitry@dmitry-VirtualBox ~/dmd2/src/dmd/test $ -- Dmitry Olshansky

Re: Linking order on Linux matters?

2013-11-25 Thread Dmitry Olshansky
ge but yes, it's the norm on Linux now. Thanks! -- Dmitry Olshansky

Re: Can someone please explain -allinst?

2013-11-22 Thread Dmitry Olshansky
es that are only used in C-T checks (static ifs etc.). Something in this logic is currently broken or implementation is lacking, hence the workaround switch. -- Dmitry Olshansky

Re: pure-ifying my code

2013-11-18 Thread Dmitry Olshansky
ntire function instead of just within an expression, I don't think that it actually ends up mattering much in practice, simply because it's generally rare to make the exact same call multiple times within a function. And if you do, it's trivial to save the result in a variable to be reused. -- Dmitry Olshansky

Re: Variable arguments with file and line information?

2013-11-17 Thread Dmitry Olshansky
that kills inlining of std.ascii on ALL compilers. https://d.puremagic.com/issues/show_bug.cgi?id=10985 And it's not only std.ascii pretty much all non-templated stuff. We really, really need to improve the inliner. Amen. -- Dmitry Olshansky

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-15 Thread Dmitry Olshansky
grained locking (a lock per bucket of a hash map), some operations still lock the whole map. Rehashing still locks the whole thing I bet. -- Dmitry Olshansky

Re: Associative Array: reasonable limits?

2013-11-06 Thread Dmitry Olshansky
06-Nov-2013 00:36, Charles Hixson пишет: On 11/05/2013 05:34 AM, Dmitry Olshansky wrote: 05-Nov-2013 02:20, Charles Hixson пишет: On 11/03/2013 01:46 AM, Dmitry Olshansky wrote: 03-Nov-2013 02:37, Charles Hixson пишет: I'm contemplating an associative array that will eventually grow to

Re: Associative Array: reasonable limits?

2013-11-05 Thread Dmitry Olshansky
05-Nov-2013 02:20, Charles Hixson пишет: On 11/03/2013 01:46 AM, Dmitry Olshansky wrote: 03-Nov-2013 02:37, Charles Hixson пишет: I'm contemplating an associative array that will eventually grow to be an estimated 64KB in size, assuming it's about half full. It would then be hold

Re: Associative Array: reasonable limits?

2013-11-03 Thread Dmitry Olshansky
turn lookups/inserts/deletions are cheap O(1) with high probability. -- Dmitry Olshansky

Re: Type-specific overloads in Phobos

2013-11-03 Thread Dmitry Olshansky
ng going on (w/o aliases). The moment you add an alias it's as if you declare it in your module, so it would fail to match on BigInt because of anti-hijacking. //this should work though: alias abs = std.math.abs; alias abs = std.bigint.abs; Thanks & best wishes, -- Joe -- Dmitry Olshansky

Re: How to iterate using foreach on a class?

2013-11-01 Thread Dmitry Olshansky
Slice is called on foreach aggregate if it's not a range or doesn't have opApply by itself. -- Dmitry Olshansky

Re: Error when trying to compile with --profile.

2013-10-31 Thread Dmitry Olshansky
rever. Do you have a small test case? Bye, bearophile -- Dmitry Olshansky

Re: selectively running unittest functions

2013-10-26 Thread Dmitry Olshansky
traits(getUnitTests, mod)); static this() { writeln("Done"); } Thanks Dan -- Dmitry Olshansky

Re: "extern" template instantiation

2013-10-24 Thread Dmitry Olshansky
m/2009/12/principles-for-standardized-rest-authentication.html . To me it sounded like a simple use case. -- Dmitry Olshansky

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-27 Thread Dmitry Olshansky
callgrind is awesome). -- Dmitry Olshansky

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-27 Thread Dmitry Olshansky
cate each time. TL;DR: use static and/or auto with ctRegex not enum. -- Dmitry Olshansky

Re: core.sys.posix.unistd link error

2013-09-22 Thread Dmitry Olshansky
them to be the same. I appreciate if somebody give a link or chapter number where to read. -- Dmitry Olshansky

Re: Greedy memory handling

2013-09-12 Thread Dmitry Olshansky
13-Sep-2013 00:11, H. S. Teoh пишет: On Thu, Sep 12, 2013 at 11:13:30PM +0400, Dmitry Olshansky wrote: 12-Sep-2013 20:51, H. S. Teoh пишет: On Thu, Sep 12, 2013 at 07:50:25PM +0400, Dmitry Olshansky wrote: [...] Better option is to have finalizer hooked up to set some flag. Then _after_

Re: Greedy memory handling

2013-09-12 Thread Dmitry Olshansky
12-Sep-2013 20:51, H. S. Teoh пишет: On Thu, Sep 12, 2013 at 07:50:25PM +0400, Dmitry Olshansky wrote: 12-Sep-2013 17:51, H. S. Teoh пишет: [...] struct WeakPointer(T) { enum size_t mask = 0xdeadbeef; union Impl { T* ptr

Re: Greedy memory handling

2013-09-12 Thread Dmitry Olshansky
nner if block is not 100% safe, because there's no guarantee that even if the base pointer of the block hasn't changed, the GC hasn't reallocated the block to somebody else. So this part is still yet to be solved. T -- Dmitry Olshansky

Re: Greedy memory handling

2013-09-11 Thread Dmitry Olshansky
an't imagine how you'd test that the block that is allocated is *still your old* block. -- Dmitry Olshansky

Re: Greedy memory handling

2013-09-11 Thread Dmitry Olshansky
eeded for other things as well I'd file an enhancement if there isn't one already. -- Dmitry Olshansky

Re: nothrow function to tell if a string can be converted to a number?

2013-09-07 Thread Dmitry Olshansky
y or returns false and leaves dest unaffected. But at least, it will buy us performance when basic types are used. T -- Dmitry Olshansky

Re: wmemchar for unix

2013-08-27 Thread Dmitry Olshansky
27-Aug-2013 23:31, H. S. Teoh пишет: On Tue, Aug 27, 2013 at 11:18:50PM +0400, Dmitry Olshansky wrote: 27-Aug-2013 18:41, H. S. Teoh пишет: [snip] I'm not sure if dmd does that optimization. If you really feel inclined, you could do static if (X86) and throw in an asm block (but that

Re: wmemchar for unix

2013-08-27 Thread Dmitry Olshansky
would break purity, @safety, etc., so probably not a good idea). It would be awesome to have pure D analogs for memchr, memcpy and its ilk that won't be so limiting (as in types used) but would guarantee top performance. -- Dmitry Olshansky

Re: Freshly Compiled DMD + Visual Studio

2013-08-27 Thread Dmitry Olshansky
D) do separate compilation and old object files can't find matching symbols in the new runtime library. From what I can tell, it looks like it cannot link in druntime correctly... But I'm not really an expert. -- Dmitry Olshansky

Re: why doesn't formattedRead take args by ref instead of by pointer?

2013-08-17 Thread Dmitry Olshansky
by pointer functions enter a deprecation path, or add a 'formattedReadRef' version for all those functions. Thoughts? You can just add an overload I bet. Since you can't read a pointer and &x is an r-value and (thank god) there wasn't decision to allow r-value as plain ref. -- Dmitry Olshansky -- Dmitry Olshansky

Re: How do you profile your apps under windows?

2013-08-09 Thread Dmitry Olshansky
profile the app usually outputs trace.log somewhere in the folder launched. -- Dmitry Olshansky

Re: Getting number of messages in MessageBox

2013-08-06 Thread Dmitry Olshansky
tail about MessageBox seems to be hidden... This is sadly intentional. The reasons must be due to some efficient concurrent queues not being able to produce reliable item count if at all. However this seems at odds with setMaxMailboxSize ... -- Dmitry Olshansky

Re: Should I Use std.ascii.isWhite or std.uni.isWhite?

2013-07-26 Thread Dmitry Olshansky
rther dig into Unicode characters and properties, there is this nice tool: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AN%3A%5D&g= (e.g. this link shows all of 'N' = Number characters) -- Dmitry Olshansky

Re: Interesting line in the recent Dr Dobbs article about profiling?

2013-07-26 Thread Dmitry Olshansky
ofile and trying to grok the output. I've found valgrind --tool=callgrind + kcachegrind to be quite awesome. Other options are the usual profilers of your OS/CPU vendor: perf, AMD CodeAnalyst, Intel VTune -- Dmitry Olshansky

Re: Often repeated array allocations

2013-07-21 Thread Dmitry Olshansky
4 to small / big? No one size fits all. Measure and profit. -- Dmitry Olshansky

Re: Often repeated array allocations

2013-07-21 Thread Dmitry Olshansky
21-Jul-2013 00:42, Ali Çehreli пишет: On 07/20/2013 01:22 PM, Dmitry Olshansky wrote: > 21-Jul-2013 00:19, Namespace пишет: >> Let us assume we have a method of a class which is used often and the >> method is called periodically and must allocate every time a array >>

Re: Often repeated array allocations

2013-07-21 Thread Dmitry Olshansky
21-Jul-2013 00:46, Namespace пишет: On Saturday, 20 July 2013 at 20:22:56 UTC, Dmitry Olshansky wrote: 21-Jul-2013 00:19, Namespace пишет: Let us assume we have a method of a class which is used often and the method is called periodically and must allocate every time a array between 100 and

Re: Often repeated array allocations

2013-07-20 Thread Dmitry Olshansky
memory is released. But I want to hear other opinions. :) 5. Keep a TLS scratch pad buffer (static class member) for said 100-4000 floats and re-use it. -- Dmitry Olshansky

Re: Types of regex

2013-07-15 Thread Dmitry Olshansky
old GDC. What's you version string/OS/package ? -- Dmitry Olshansky

Re: memcpy in D

2013-06-30 Thread Dmitry Olshansky
/C++. It's the _same_ GLIBC. -- Dmitry Olshansky

Re: Tips on making regex more performant?

2013-06-18 Thread Dmitry Olshansky
y I haven't been able to tell about it at DConf. -- Dmitry Olshansky

Re: Tips on making regex more performant?

2013-06-18 Thread Dmitry Olshansky
more tips? -- Dmitry Olshansky

Re: Tips on making regex more performant?

2013-06-18 Thread Dmitry Olshansky
tions '|'. Is there anything i can do to speed up regex matching in such a scenario? Are there any tips you can share to speed things up? There are also compiler flags to fiddle with (dmd): -O -release -inline -noboundscheck Thanks. -- Dmitry Olshansky

Re: Strange error when importing std.regex

2013-06-12 Thread Dmitry Olshansky
this. http://d.puremagic.com/issues/ std.algorithm.splitter(arr, 1); Bye, bearophile -- Dmitry Olshansky

Re: shared vs __gshared

2013-06-10 Thread Dmitry Olshansky
h indicates that shared data might lose it's built-in ops to prevent confusion and require folks to just use core.atomic directly for lock-free or alternatively cast+mutex for lock-based. -- Dmitry Olshansky

Re: regex with literal (ie automatically replace '(' with '\(', etc) )

2013-05-30 Thread Dmitry Olshansky
be good (although you missed a few :P) Technically any working "escapeRegex" would also function as a valid "escapeRegexReplace", although it might be slightly faster to have a specialised one. -- Dmitry Olshansky

Re: regex with literal (ie automatically replace '(' with '\(', etc) )

2013-05-30 Thread Dmitry Olshansky
;, although it might be slightly faster to have a specialised one. not sure, because they escape differently (\$ vs $$). According to this: http://dlang.org/phobos/std___regex.html#.replace <http://dlang.org/phobos/std_regex.html#.replace> you can use the same escape sequences for both (\c -> c in the replacement string). -- Dmitry Olshansky

Re: why doesn't formattedRead take args by ref instead of by pointer?

2013-05-20 Thread Dmitry Olshansky
nd &x is an r-value and (thank god) there wasn't decision to allow r-value as plain ref. -- Dmitry Olshansky

Re: why doesn't formattedRead take args by ref instead of by pointer?

2013-05-20 Thread Dmitry Olshansky
(Args...)(const(char)[] fmt, ref Args args) { foreach(i, v; args) args[i] = i; } void main(){ int i, j, k; readf("abc", i, j, k); assert(i == 0); assert(j == 1); assert(k == 2); } -- Dmitry Olshansky

Re: why doesn't formattedRead take args by ref instead of by pointer?

2013-05-20 Thread Dmitry Olshansky
here: https://github.com/timotheecour/dtools/blob/master/dtools/overrides/format.d#L29 (just run unittests: rdmd --main -unittest dtools/all.d) why is std.format. formattedRead taking by pointer instead ? could we change that (with proper deprecation), or add that function? -- Dmitry Olshansky

Re: cast(size_t)&c != 0, but c is null

2013-05-16 Thread Dmitry Olshansky
16-May-2013 13:31, Maxim Fomin пишет: On Thursday, 16 May 2013 at 09:05:46 UTC, Dicebot wrote: On Wednesday, 15 May 2013 at 19:30:41 UTC, Dmitry Olshansky wrote: Won't this work? *cast(void**)&object Right question is "is this guaranteed to work by spec?". Spec is silen

Re: cast(size_t)&c != 0, but c is null

2013-05-15 Thread Dmitry Olshansky
ware of one. A simple cast to void* should do it: cast(void*)c class C { auto opCast(T:void*)() { return null; } } So - no - a simple cast to void* won't always work, as the op can be overloaded, even if only by accident. You can insert a cast to Object first. -Steve -- Dmitry Olshansky

Re: What sync object should i use?

2013-05-14 Thread Dmitry Olshansky
14-May-2013 21:02, Steven Schveighoffer пишет: On Tue, 14 May 2013 04:58:27 -0400, Dmitry Olshansky wrote: 14-May-2013 08:33, Heinz пишет: BTW, given recent discussion on memory barriers, I think my previous statement that the mutex does not need to be locked to call notify is probably

  1   2   3   4   5   6   >