Am Wed, 3 Jan 2018 10:57:13 -0800
schrieb Ali Çehreli :
> On 01/03/2018 10:40 AM, Patrick Schluter wrote:
> > On Tuesday, 2 January 2018 at 23:27:22 UTC, H. S. Teoh wrote:
> >>
> >> When it comes to optimization, there are 3 rules: profile, profile,
> >> profile. I used to heavily hand-"opt
Am Fri, 11 Aug 2017 17:10:14 +
schrieb bitwise :
> Ok thanks.
>
> I don't understand why you would ever want to call __dtor
> then...is it possible to have only __dtor without also having
> __xdtor? Like, if I want to call a struct's destructor, do I have
> to check for both, or can I just
Am Tue, 08 Aug 2017 20:48:39 +
schrieb Nordlöw :
> Has anybody written a wrapper around `std.file.readText` (or
> similar) that appends a final zero-byte terminator in order to
> realize sentinel-based search in textual parsers.
What do you mean by similar? There are many ways to load a fil
Am Sat, 05 Aug 2017 20:17:23 +
schrieb bitwise :
> virtual DString getTitle() const {
> DString ret;
> ret.length = GetWindowTextLength(_hwnd) + 1;
> ret.ptr = (const char*)gc_malloc(ret.length, 0xA, NULL);
> GetWindowText(_hwnd, (char*)ret.ptr, ret.len
Am Mon, 31 Jul 2017 15:43:21 +
schrieb Martin Tschierschke :
> As a rookie in D programming I try to understand the power of
> templated functions with compile time parameters. With DMD 2.074
> a compile time format
> (auto output = format!("Print this %s")(var);)
>
> was introduced, now we
Am Fri, 28 Jul 2017 22:53:52 +
schrieb FoxyBrown :
> After upgrading to latest dmd and having to rebuild gtk, I now
> get the following error
>
> Error 1: Previous Definition Different :
> _D3gtk3All12__ModuleInfoZ (gtk.All.__ModuleInfo)
>
>
> in my apps that were previously working(no ch
Am Thu, 06 Jul 2017 03:49:04 +
schrieb FoxyBrown :
> Unfortunately, importing that module seems to throw an error for
> some insane reason.
>
> Error 42: Symbol Undefined _D3gtk6All12__ModuleInfoZ
> (gtk.AllGTK.__ModuleInfo)
>
> without importing it in to the project(but directly importing
Am Mon, 15 May 2017 19:30:00 +
schrieb Bauss :
> pragma(inline, true); doesn't actually do what you think it does.
> In lining is always done whenever possible and that only tells
> the compiler to spit out an error if it can't inline it.
A compiler doesn't simply inline whenever it can. A
Am Sun, 14 May 2017 15:11:09 +
schrieb Richard Delorme :
> Or should I wait for an offcial support of this architecture?
You ARE the official support now. :)
--
Marco
Am Sun, 14 May 2017 20:18:24 +
schrieb Kevin Brogan :
> I have a piece of code that takes a callback function.
>
> The callback has the signature void callback(void* state, void*
> data)
>
> There are several of these functions. All of them use state and
> data as differing types.
>
> As
Just in case, here are the relevant docs:
http://dlang.org/phobos/std_net_curl.html
Am Mon, 26 Sep 2016 23:40:10 +
schrieb Vincent :
> 1. Easy to use. No more stupid "UNIX sockets", "TCP types" and so
> on. Just simple as this:
>
> // Client side
> auto sock = new ClientSocket("google.com", 80);
> sock.WriteLine("GET / HTTP/1.0");
> sock.WriteLine("Host: google.com");
> soc
Am Sun, 25 Sep 2016 16:23:11 +
schrieb Matthias Klumpp :
> So, I would like to know the following things:
>
> 1) Is there any caveat when linking to C libraries and using the
> GC in a project? So far, it seems to be working well, but there
> have been a few cases where I was suspicious abo
Am Sat, 23 Jul 2016 13:18:03 +
schrieb Rufus Smith :
> Trying to compare a *ptr value with a value in nogc code results
> in the error:
>
> Error: @nogc function '...' cannot call non-@nogc function
> 'object.opEquals'
>
> Shouldn't object opEquals be marked?
The only situati
Am Fri, 27 May 2016 10:16:48 +
schrieb Era Scarecrow :
> On Friday, 27 May 2016 at 10:14:31 UTC, Era Scarecrow wrote:
> > inc dword ptr [EAX+Foo.x.offsetof];
>
>
> So just tested it, and it didn't hang, meaning all unittests
> also passed.
>
> Final solution is:
>
>asm pure @n
Am Fri, 27 May 2016 10:06:28 +
schrieb Guillaume Piolat :
> Referencing EBP or ESP yourself is indeed dangerous. Not sure why
> the documentation would advise that. Using "this", names of
> parameters/locals/field offset is much safer.
DMD makes sure that the EBP relative access of paramete
Am Tue, 24 May 2016 20:58:14 +
schrieb Gary Willoughby :
> On Tuesday, 24 May 2016 at 18:43:22 UTC, Adam D. Ruppe wrote:
> > On Tuesday, 24 May 2016 at 18:42:41 UTC, Gary Willoughby wrote:
> >> I have a T* pointer to the start of a malloc'd chunk of
> >> memory, the type T and the number of
Am Mon, 16 May 2016 20:24:51 +
schrieb Q. Schroll :
> Lets say I want to print a table with floats. How can it be
> formatted like that:
> | 2.4 |
> | 12.2 |
> | 8.131 |
> | 17.44 |
> Also acceptable is
> | 2.400 |
> | 12.200 |
> | 8.131 |
> | 17.440 |
Use %#6.3f to get the above ou
Am Mon, 2 May 2016 18:52:11 +0200
schrieb ag0aep6g :
> On 02.05.2016 15:53, Marco Leise wrote:
> >immutable tab = { static enum S[] s = [
>
> `static enum`? What kind of black magic is this?
I don't know, but it works, haha.
--
Marco
Am Mon, 02 May 2016 13:00:27 +
schrieb Erik Smith :
> Is there a way to initialize a static array and have it's size
> inferred (and that works for arrays of structs using braced
> literals)? This would make it easier to maintain longer static
> array definitions. The code below doesn't w
Am Tue, 26 Apr 2016 13:35:37 +
schrieb Begah :
> When the screen switches to another screen ie from menu to the
> game,
> I want that the "button.png" texture is automaticly destroyed by
> the gc.
My ideological point of view is that you must not use
non-deterministic garbage collection for
Am Thu, 21 Apr 2016 00:14:53 +
schrieb Straivers :
> Hi,
>
> I want to make a utility wrapper around a core.simd.float4, and
> have been trying to make the following code work, but have been
> met with no success.
>
> auto add(float rhs)
> {
> return __simd(XMM.ADDPS, lhs, rhs);
> }
Am Mon, 28 Mar 2016 16:29:50 -0700
schrieb "H. S. Teoh via Digitalmars-d-learn"
:
> […] your diacritics may get randomly reattached to
> stuff they weren't originally attached to, or you may end up with wrong
> sequences of Unicode code points (e.g. diacritics not attached to any
> grapheme). Usin
Am Tue, 29 Mar 2016 06:00:32 +
schrieb cy :
> struct Database {
>string derp;
>Statement prepare(string s) {
> return Statement(1234);
>}
> }
>
> struct Statement {
>int member;
>void bind(int column, int value) {
> import std.stdio;
> writeln("derp",memb
Am Sat, 26 Mar 2016 17:43:48 +
schrieb maik klein :
> On Saturday, 26 March 2016 at 17:06:39 UTC, ag0aep6g wrote:
> > On 26.03.2016 18:04, ag0aep6g wrote:
> >> https://gist.github.com/aG0aep6G/a1b87df1ac5930870ffe/revisions
> >
> > PS: Those enforces are for a size of 100_000 not 1_000_000,
>
Am Sun, 06 Mar 2016 01:10:58 +
schrieb Anon :
> I would avoid reassigning `stdout` and friends in favor of using
> a logger or manually specifying the file to write to if I were
> you.
Meh. Too little drama. :p
--
Marco
Got it now: https://issues.dlang.org/show_bug.cgi?id=15768
writeln() creates a copy of the stdout struct in a non
thread-safe way. If stdout has been assigned a File struct
created from a file name this copy includes a "racy"
increment/decrement of a reference count to the underlying
C-library FIL
Am Sat, 05 Mar 2016 14:18:31 +
schrieb Atila Neves :
> void main() {
> stdout = File("/dev/null", "w");
> foreach(t; 1000.iota.parallel) {
> writeln("Oops");
> }
> }
First thing I tried:
void main() {
stdout = File("/dev/null", "w");
foreach(t; 1000.iota.par
Am Tue, 01 Mar 2016 05:14:13 +
schrieb Nicholas Wilson :
> On Tuesday, 1 March 2016 at 04:48:01 UTC, Adam D. Ruppe wrote:
> > On Tuesday, 1 March 2016 at 04:18:11 UTC, Nicholas Wilson wrote:
> >> What is causing these errors? I'm using \t and \n in string
> >> all over the place and they work
Am Tue, 01 Mar 2016 02:30:04 +
schrieb Matthew Dudley :
> I'm working on a chess engine side-project, and I'm starting to
> get into profiling and optimization.
>
> One of the optimizations I've made involves some inline assembly,
> and I ran across some apparently bizarre behavior today, a
Am Wed, 10 Feb 2016 05:41:24 +
schrieb Tofu Ninja :
> On Thursday, 4 February 2016 at 17:56:06 UTC, Marco Leise wrote:
> > Am Mon, 01 Feb 2016 02:56:06 +
> > schrieb Tofu Ninja :
> >
> >> Just out of curiosity, does anyone have an octree
> >> implementation for D laying around? Just looki
Am Tue, 09 Feb 2016 00:38:10 +
schrieb tsbockman :
> On Sunday, 7 February 2016 at 02:11:15 UTC, Marco Leise wrote:
> > What I like most about your proposal is that it doesn't break
> > any existing code that wasn't broken before. That can't be
> > emphasized enough.
>
> Although I wish mor
Am Sat, 06 Feb 2016 23:18:59 +
schrieb Ola Fosheim Grøstad
:
> Things that could speed up collection:
> - drop destructors so you don't track dead objects
Interesting, that would also finally force external resources
off the GC heap and into deterministic release. That needs a
solution to inh
Am Sat, 06 Feb 2016 11:47:02 +
schrieb Ola Fosheim Grøstad
:
> Of course, Swift does not aim for very high performance, but for
> convenient application/gui development. And frankly JavaScript is
> fast enough for that kind of programming.
My code would not see much ref counting in performa
Am Sun, 07 Feb 2016 01:05:28 +
schrieb cy :
> On Saturday, 6 February 2016 at 03:57:16 UTC, Marco Leise wrote:
>
> > No, but they could have dtors because they contain malloc'd
> > data. E.g. string literals that don't live on the GC heap.
>
> Character arrays allocated with glibc malloc ar
Am Sat, 06 Feb 2016 11:02:37 +
schrieb tsbockman :
> On Saturday, 6 February 2016 at 08:47:01 UTC, Saurabh Das wrote:
> > I think we should add a static assert to slice to ensure that
> > the current implementation is not used in a case where the
> > alignment doesn't match. This is better t
Am Sat, 06 Feb 2016 07:57:08 +
schrieb tsbockman :
> On Saturday, 6 February 2016 at 06:34:05 UTC, Marco Leise wrote:
> > I don't want to sound dismissive, but when that thought came
> > to my mind I considered it unacceptable that the type of
> > Tuple!(int, bool, string).slice(1, 3) would be
Mixin templates is the way to go if you want something new on
every use of the template. Otherwise using the template
multiple times with the same arguments will always give you
the first instance.
--
Marco
Am Sat, 06 Feb 2016 04:28:17 +
schrieb tsbockman :
> On Friday, 5 February 2016 at 19:16:11 UTC, Marco Leise wrote:
> >> > 1. Removing 'ref' from the return type
> >
> > Must happen. 'ref' only worked because of the reinterpreting
> > cast which doesn't work in general. This will change the
Am Sat, 06 Feb 2016 03:38:54 +
schrieb cy :
> On Friday, 5 February 2016 at 22:18:50 UTC, Marco Leise wrote:
> > But when you remove items from the table you need to call a
> > const/immutable dtor that needs to be written for everything
> > that can be a hash table key.
>
> You need to wri
Usually I want the keys to be declared "immutable" to signal
that their content must not change in order to provide stable
hashes. But when you remove items from the table you need to
call a const/immutable dtor that needs to be written for
everything that can be a hash table key.
What do you put
Am Fri, 05 Feb 2016 05:31:15 +
schrieb Saurabh Das :
> On Friday, 5 February 2016 at 05:18:01 UTC, Saurabh Das wrote:
> [...]
>
> Apologies for spamming. This is an improved implementation:
>
> @property
> Tuple!(sliceSpecs!(from, to)) slice(size_t from, size_t
> to)() @sa
Am Mon, 01 Feb 2016 02:56:06 +
schrieb Tofu Ninja :
> Just out of curiosity, does anyone have an octree implementation
> for D laying around? Just looking to save some time.
I have one written in Delphi that you could prune till it fits.
--
Marco
https://issues.dlang.org/show_bug.cgi?id=15645
Am Thu, 04 Feb 2016 15:17:54 +
schrieb Saurabh Das :
> On Thursday, 4 February 2016 at 12:28:39 UTC, Saurabh Das wrote:
> > This code:
> > [...]
>
> Update: Simplified, this also doesn't work:
>
> void main()
> {
> import std.typecons;
> auto tp = tuple(10, false, "hello");
>
>
Am Tue, 24 Nov 2015 17:08:33 +
schrieb BLM768 :
> On Tuesday, 24 November 2015 at 09:48:45 UTC, magicdmer wrote:
> > I display chinese string like:
> >
> > auto str = "你好,世界"
> > writeln(str)
> >
> > and The display is garbled。
> >
> > some windows api like MessageBoxA ,if string is chinese, i
Am Wed, 21 Oct 2015 12:49:35 -0700
schrieb Ali Çehreli :
> On 10/21/2015 12:37 PM, Sigg wrote:
>
> > cause at least few more "fun" side effects.
>
> One of those side effects would be function calls binding silently to
> another overload:
>
> void foo(bool){/* ... */}
> void foo(int) {/* ...
Am Sun, 18 Oct 2015 11:35:16 +0200
schrieb Joseph Rushton Wakeling via Digitalmars-d-learn
:
> Hello all,
>
> I recently decided to have another play with sdc to see how it's doing.
> Since
> my dmd is installed in /opt/dmd/ I had to do a couple of tricks to get sdc
> itself to build:
>
> (i
Am Tue, 06 Oct 2015 21:39:28 +
schrieb Fusxfaranto :
> Additionally, just like associative arrays, if you need to access
> the value, you can get a pointer to it with the in operator (and
> if the key doesn't exist, it will return a null pointer).
>
> const(JSONValue)* p = "key" in root;
>
Am Sat, 03 Oct 2015 23:42:22 +
schrieb Nachtraaf :
> I changed the type of result to void16 like this:
>
> float dot_simd1(float4 a, float4 b)
> {
> void16 result = __simd(XMM.DPPS, a, b, 0xFF);
> float value;
> __simd_sto(XMM.STOSS, value, result);
> return value;
> }
>
This is a bug in overload resolution when __vector(void[16])
is involved. You can go around it by changing float4 to void16,
only to run into an internal compiler error:
backend/gother.c 988
So file a bug for both @ issues.dlang.org
Also it looks like DMD wants you to use the return value of
the
Am Thu, 01 Oct 2015 12:03:10 +
schrieb ponce :
> I have a RAII struct to save/restore the FP control word.
> It also handle the SSE control word which unfortunately exist.
>
> https://github.com/p0nce/dplug/blob/master/plugin/dplug/plugin/fpcontrol.d
Nice to have in Phobos. I assume you have
Am Tue, 29 Sep 2015 21:04:00 +
schrieb Wulfrick :
> Is there an interval arithmetic library in D? I couldn’t find one.
>
> In case I had to write my own, I understand that the IEEE
> standard floating point arithmetic provides operations for
> rounding up or down certain operations like sum
Am Sat, 26 Sep 2015 10:38:25 +
schrieb Gary Willoughby :
> Auto-complete in D is tricky because of this feature and no-one
> has invested any time to figure out a nice way to provide
> auto-complete for this.
Mono-D does have UFCS auto-complete. The plugin is going to
bit-rot though, since
Am Thu, 01 Oct 2015 08:52:43 +
schrieb John Colvin :
> On Thursday, 1 October 2015 at 07:08:00 UTC, Russel Winder wrote:
> > On Wed, 2015-09-30 at 23:35 -0700, Ali Çehreli via
> > Digitalmars-d-learn wrote:
> >> On 09/30/2015 10:46 PM, Russel Winder via Digitalmars-d-learn
> >> wrote:
> >> >
Am Fri, 25 Sep 2015 10:28:54 +
schrieb ref2401 :
> If I declare a class as `final` do I have to mark all methods of
> the class as `final` too?
No.
--
Marco
Thanks for the clarification.
Am Sat, 12 Sep 2015 10:55:50 +
schrieb "Namal" :
> > Why is also b flipped here? This doesn't happen if I use static
> > arrays.
>
> nvm. I need to .dup that.
Correct, static arrays are value types and copied on
assignment. Dynamic arrays on the other hand are generally
slices of memory on
Am Mon, 8 Jun 2015 12:59:31 +0200
schrieb Daniel Kozák via Digitalmars-d-learn
:
>
> On Mon, 08 Jun 2015 10:41:59 +
> Kadir Erdem Demir via Digitalmars-d-learn
> wrote:
>
> > I want to use my char array with awesome, cool std.algorithm
> > functions. Since many of this algorithms requires
Am Mon, 08 Jun 2015 11:13:25 +
schrieb "Daniel Kozak" :
> BTW on ldc(ldc -O3 -singleobj -release -boundscheck=off)
> transcode is the fastest:
>
> f0 time: 1 sec, 115 ms, 48 μs, and 7 hnsecs // to!dstring
> f1 time: 449 ms and 329 μs // toUTF32
> f2 time: 272 ms, 969 μs, and 1 hnsec // trans
Am Mon, 18 May 2015 09:51:48 +
schrieb "John Colvin" :
> No need to worry about the GC here, it only scans the stack and
> its own heap (unless you specifically add a new root).
And even if you add a root it wont free anything it did not
allocate itself! You could even append to your C array
Am Mon, 18 May 2015 09:05:51 -0400
schrieb Steven Schveighoffer :
> On 5/15/15 2:19 PM, ref2401 wrote:
> > On Friday, 15 May 2015 at 16:30:29 UTC, Steven Schveighoffer wrote:
> >> On 5/15/15 12:04 PM, ref2401 wrote:
> >>> What is the difference between 'const' and 'in' parameter storage
> >>> clas
Am Sat, 11 Apr 2015 18:28:35 +
schrieb "Paul D Anderson" :
> Is there a way to return the name of a function (a string) from a
> pointer to that function?
>
> Function pointer example from D Reference:
> ---
> int function() fp;
>
> void test()
> {
> static int a = 7;
> static int
Am Wed, 08 Apr 2015 17:01:43 +
schrieb "ZILtoid1991" :
> While I technically finished the 0.2 version of my graphics
> engine which has a reasonable speed at low internal resolutions
> and with only a couple of sprites, but it still gets bottlenecked
> a lot. First I'll throw out the "top-d
Am Sat, 22 Nov 2014 18:30:05 +
schrieb "Ad" :
> Hello, I would like to write a "popcnt" function. This works fine
>
> ulong popcnt(ulong x)
> {
> asm { mov RAX, x ; popcnt RAX, RAX ; }
> }
>
> However, if I add the "naked" keyword ( which should improve
> performance? ) it doesn't work anym
Am Thu, 20 Nov 2014 20:17:31 +
schrieb "Charles" :
> So I was reading the documentation page:
> http://dlang.org/simd.html and noticed what appears to be a typo:
>
> int4 v;
> (cast(int*)&v)[3] = 2; // set 3rd element of the 4 int vector
> (cast(int[4])v)[3] = 2; // set 3rd element of the
Am Thu, 13 Nov 2014 16:54:45 +
schrieb "Dicebot" :
> Apart from unused templates - yes. In abscence of .di files
> separate compilation only affects generated object files
I thought so and wonder how that will scale with large code
bases. Lately I found so many bugs and shortcomings that the
Specifically, when I put some code in a separately compiled
lib, does that save me anything in terms of files that have to
be analyzed or will dmd always go through every file that can
be reached through includes ? (.di files are out of question,
because they have issues)
--
Marco
Am Thu, 23 Oct 2014 12:15:13 +
schrieb "Marc Schütz" :
> Yet another use case for borrowing.
Cool, how does it keep the original struct alive though, if it
isn't stored anywhere? Or will it error out when you attempt
to use the dangling pointer to the object?
--
Marco
Am Sun, 19 Oct 2014 17:09:22 +
schrieb "Sean Kelly" :
> What really needs to happen is for everything in core.sync to be
> made shared. I got partway through this at one point and
> stopped, because it was imposing a terrible design on the
> classes--I had shared methods that were casting
I have a thread that is shared by
others, so I have a shared method, inside of which I wrote:
final void opOpAssign(string op : "~")(ref StreamingObject item) shared
{
synchronized (m_condition.mutex)
{
m_list.unshared ~= item;
m_condition.notify();
Am Sun, 19 Oct 2014 06:55:17 +
schrieb "Bauss" :
> Is there anyway to pull of a runtime compilation of D code or at
> the very least asm execution?
Sure. For runtime compilation you invoke any installed D
compiler and compile a conventional shared library that you
then load with:
http://dlan
Oh wit! It is a read-only benchmark.
Am Tue, 30 Sep 2014 14:48:03 +
schrieb "John Colvin" :
> On Sunday, 28 September 2014 at 09:11:07 UTC, Marco Leise wrote:
> > For head-unshared there is `static if (is(T U : shared U))`.
> > But how do you get the unshared type for anything from `shared
> > void*` to `shared uint` ?
>
> templ
Am Wed, 01 Oct 2014 14:40:01 -0700
schrieb Ali Çehreli :
> Found on Reddit:
>
>
> http://lonewolfer.wordpress.com/2014/03/13/benchmarking-hash-table-implementations-in-different-languages/
>
> Are you motivated enough to compare D's associative arrays with those
> results? :)
>
> Ali
The qu
Am Sun, 28 Sep 2014 14:07:22 +
schrieb "tcak" :
> On Sunday, 28 September 2014 at 09:11:07 UTC, Marco Leise wrote:
> > For head-unshared there is `static if (is(T U : shared U))`.
> > But how do you get the unshared type for anything from `shared
> > void*` to `shared uint` ?
>
> shared int a
For head-unshared there is `static if (is(T U : shared U))`.
But how do you get the unshared type for anything from `shared
void*` to `shared uint` ?
--
Marco
77 matches
Mail list logo