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
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/
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
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
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
curl_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
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
Simply enough dub test should pass.
How do I go about it?
—
Dmitry Olshansky
CEO @ Glow Labs
https://olshansky.me
https://t.me/glowlabs32
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
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
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
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
, 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
/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
how to introduce
library dependency on a specific DUB package.
--
Dmitry Olshansky
is there, its just that it
needs to be all in one.
Thanks, Rikki!
—
Dmitry Olshansky
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
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
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.
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
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
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 equivalent
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);
}
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
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
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
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
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,
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
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
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
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
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
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
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
report for Phobos basically stating your use
case and the visibility problem.
Thanks
Rémi
Dmitry Olshansky
.
---
Dmitry Olshansky
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
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
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 been already
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
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
18-Dec-2013 23:54, Andrej Mitrovic пишет:
On 12/18/13, Dmitry Olshansky dmitry.o...@gmail.com 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
19-Dec-2013 01:05, Andrej Mitrovic пишет:
On 12/18/13, Dmitry Olshansky dmitry.o...@gmail.com 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
*)
With 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
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
]
[hello, world]
[hello, , world]
Bye,
bearophile
--
Dmitry Olshansky
dmitry@dmitry-VirtualBox ~/dmd2/src/dmd/test $
--
Dmitry Olshansky
,
it's the norm on Linux now.
Thanks!
--
Dmitry Olshansky
in C-T checks (static ifs etc.). Something in this
logic is currently broken or implementation is lacking, hence the
workaround switch.
--
Dmitry Olshansky
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
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
), some operations still
lock the whole map. Rehashing still locks the whole thing I bet.
--
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
probability.
--
Dmitry Olshansky
). 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
is called on foreach aggregate if it's not a range or doesn't
have opApply by itself.
--
Dmitry Olshansky
.
Do you have a small test case?
Bye,
bearophile
--
Dmitry Olshansky
Dan
--
Dmitry Olshansky
.
--
Dmitry Olshansky
;DR: use static and/or auto with ctRegex not enum.
--
Dmitry Olshansky
).
--
Dmitry Olshansky
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
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
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_
an enhancement if there isn't one already.
--
Dmitry Olshansky
that is allocated is *still
your old* block.
--
Dmitry Olshansky
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
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
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 would
a,b;
uint n=formattedRead(s,%s %s,a,b);
assert(a==a1 b==a2 a3);
Seems like a1_a2 a3 with _ being matched as space in format string
between %s and %s.
Why %s is not stopping on any whitespace as is (like scanf) I'm not 100%
sure.
On Mon, May 20, 2013 at 10:44 PM, Dmitry Olshansky
usually outputs trace.log somewhere in the folder
launched.
--
Dmitry Olshansky
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
.
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
dig into Unicode characters
and properties, there is this nice tool:
http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AN%3A%5Dg=
(e.g. this link shows all of 'N' = Number characters)
--
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
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
between 100 and 4000
/ big?
No one size fits all. Measure and profit.
--
Dmitry Olshansky
the 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
version string/OS/package ?
--
Dmitry Olshansky
the _same_ GLIBC.
--
Dmitry Olshansky
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
?
--
Dmitry Olshansky
it at DConf.
--
Dmitry Olshansky
on this.
http://d.puremagic.com/issues/
std.algorithm.splitter(arr, 1);
Bye,
bearophile
--
Dmitry Olshansky
-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
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
a
specialised one.
--
Dmitry Olshansky
?
--
Dmitry Olshansky
)[] 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
and (thank god) there wasn't decision to allow r-value
as plain ref.
--
Dmitry Olshansky
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
(). Not a single crash.
Doesn't prove anything, it could happen that you just miss a
notification, for instance. Another common case is that it so happens
that wait will (with luck) always happen before any of notify and
notifications come spaced out in time.
--
Dmitry Olshansky
that under Win32 calling notify() before wait()
internally signals the condition and then calling wait() returns
immediately and actually does not wait. This is the expected
behavior and is actually how Win32 events work.
On Tuesday, 14 May 2013 at 08:58:31 UTC, Dmitry Olshansky wrote:
Have to lock
14-May-2013 21:02, Steven Schveighoffer пишет:
On Tue, 14 May 2013 04:58:27 -0400, Dmitry Olshansky
dmitry.o...@gmail.com 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
table for structs.
why multiple alias this not supported? i know it was broken in 2.060 but
with 2.061 it was fixed right?
It's not even on the horizon. It must be single alias this that finally
started working (around that time ~ 2.061).
--
Dmitry Olshansky
23-Apr-2013 05:17, Xinok пишет:
On Saturday, 20 April 2013 at 16:35:25 UTC, Dmitry Olshansky wrote:
And this all is good but TimSort allocates O(N) memory. The constant
in front of N is smallish less then 1.0 but it could cause some grief.
Worst case is O(n/2), but it starts small and doubles
unstable sort can do the job faster (at the very least not
slower) then a good stable sort.
I'm looking forward to a version of Introsort that Xinok has in mind as
a Q-sort fix.
--
Dmitry Olshansky
easier than the
wrong way.
And this all is good but TimSort allocates O(N) memory. The constant in
front of N is smallish less then 1.0 but it could cause some grief.
--
Dmitry Olshansky
20-Apr-2013 01:03, Ivan Kazmenko пишет:
With n = 30_000 as in the example, this takes time of the order of a
second on a modern computer, which is clearly O(n^2). I am using DMD
2.062.
Optimization flags if any?
--
Dmitry Olshansky
1 - 100 of 473 matches
Mail list logo