Re: DFL is the best UIcontrols for D,compare it to dwt, tkd,dtk,dlangui,anchovy......

2014-05-13 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 00:10:15 UTC, FrankLike wrote: 1.DFL's Memory Usage is the least than other. winsamp.exe is 2.1M,DFL's example's exe is 2.7M. 2.The size of DFL's example's exe files is the least than other, and only a single file. 3.DFL's source code is the most easy to understand.

Re: Are there desktop appications being developed in D currently?

2014-08-09 Thread thedeemon via Digitalmars-d-learn
On Saturday, 9 August 2014 at 00:34:43 UTC, Puming wrote: Yes, rust is a more infantile language compared to D, but people are already using them to create complicate applications like browser! Heh, Rust was initially created exactly to create a browser. Servo project is its main driver and

Re: Are there desktop appications being developed in D currently?

2014-08-09 Thread thedeemon via Digitalmars-d-learn
On Sunday, 10 August 2014 at 04:41:45 UTC, Puming wrote: Photo processing app: Disk space visualizer and redundancy searcher: A tool for watching some folders and processing video files there... Interesting :-) Unfortunately they are all windows only apps, I don't have a windows machine.

Re: Recursive data-types

2014-09-27 Thread thedeemon via Digitalmars-d-learn
On Saturday, 27 September 2014 at 11:40:19 UTC, Rikki Cattermole wrote: These definitions can't work since Function and Atom need each other in this recursive definition. How to get out of this trap? Do I have to drop Algebraic and go back to manual tagged unions? Converting Function to a

Re: A hash table implementation benchmark

2014-10-01 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 1 October 2014 at 21:40:01 UTC, Ali Çehreli wrote: Are you motivated enough to compare D's associative arrays with those results? :) Here's another benchmark: D AAs vs. Vibe.d's open addressing hashes vs. Robin Hood hashing:

Re: Obedient threads

2014-10-02 Thread thedeemon via Digitalmars-d-learn
Just use non-blocking receives in main thread's event loop. When you get a message from child thread that it's finished playing and you decide you don't need that thread anymore, send a message to child you're dismissed. The child should also have some loop to check for incoming messages

Re: Hunting down rogue memory allocations?

2014-10-03 Thread thedeemon via Digitalmars-d-learn
On Thursday, 2 October 2014 at 20:16:56 UTC, Gary Willoughby wrote: Say i have created a program written in D, what tools are available for me to track memory allocations? I wrote a tiny module trackallocs.d that inserts a GC proxy and outputs to log file (or stdout) all the allocations,

Re: Hunting down rogue memory allocations?

2014-10-03 Thread thedeemon via Digitalmars-d-learn
On Friday, 3 October 2014 at 09:27:50 UTC, Kiith-Sa wrote: https://bitbucket.org/infognition/dstuff/src/ Mind if I use some parts of it in my profiler? (there's no license) Sure, it's in public domain (as noted in readme).

Re: Exception thrown while trying to read file

2014-10-03 Thread thedeemon via Digitalmars-d-learn
On Friday, 3 October 2014 at 11:30:02 UTC, Matt wrote: I am building a PE-COFF file reader file.seek(0x3c, SEEK_SET); file.readf(%d, offs); // this is the problem line Does anyone else see whatever it is that I'm doing wrong? readf is for reading text, it expects to see some digits. You're

Re: What is a sink delegate?

2014-10-09 Thread thedeemon via Digitalmars-d-learn
On Friday, 10 October 2014 at 03:06:33 UTC, Joel wrote: How do you use that toString? Maybe an example? void main() { Try t = Try(Joel, 35); t.toString(s = writeln(s)); }

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread thedeemon via Digitalmars-d-learn
On Friday, 17 October 2014 at 06:29:24 UTC, Lucas Burson wrote: // This is where things breaks { ubyte[] buff = new ubyte[16]; buff[0..ATA_STR.length] = cast(ubyte[])(ATA_STR); // read the string back from the buffer, stripping whitespace string stringFromBuffer

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread thedeemon via Digitalmars-d-learn
You fill first few chars with data from ATA_STR but the rest 10 bytes of the array are still part of the string Edit: you fill first 5 chars and have 11 bytes of zeroes in the tail. My counting skill is too bad. ;)

Re: Does the grammar allow an alias statement without a semicolon?

2014-10-17 Thread thedeemon via Digitalmars-d-learn
On Saturday, 18 October 2014 at 00:52:23 UTC, Solomon E wrote: Hi, everyone, first post here. I'm trying to learn to parse D code. Just in case, I'll remind these two projects that might be helpful: https://github.com/Hackerpilot/libdparse https://github.com/Hackerpilot/DGrammar

Re: Really in need of help with std.container.array.d

2014-10-20 Thread thedeemon via Digitalmars-d-learn
Speaking of this module, since I cannot currently login to bugtracker, I'd like to note here that there are two major bugs in one little function: Array.Payload.length setter. One is this https://issues.dlang.org/show_bug.cgi?id=13619 and the other is reallocating without notifying GC of the

Re: Really in need of help with std.container.array.d

2014-10-21 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 21 October 2014 at 04:22:37 UTC, thedeemon wrote: Speaking of this module, since I cannot currently login to bugtracker, I'd like to note here that there are two major bugs in one little function: Array.Payload.length setter. One is this

Re: Pointer across threads

2014-11-04 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 4 November 2014 at 14:36:19 UTC, Chris wrote: I'm still curious, though, how D handles this internally, because data.data is still mutable while the other reference to the same address (tmp) is not. What if I change data.data while the other thread is being executed? immutable is

Re: Access Violation Tracking

2014-11-05 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 5 November 2014 at 11:09:42 UTC, Bauss wrote: Is there any way to track down access violations, instead of me having to look through my source code manually. I have a pretty big source code and an access violation happens at runtime, but it's going to be a nightmare looking

Re: How to turn this C++ into D?

2014-11-06 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 5 November 2014 at 17:45:00 UTC, luminousone wrote: abstract class foo { static DList!foo foo_list; ~this(){ foo_list.remove(this); } One note: when your program exits the runtime does a final GC cycle and collects those things calling destructors/finalizers, however

Re: Easy way to monitor gc activity?

2014-11-12 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 10:43:32 UTC, Tofu Ninja wrote: What is an easy way to monitor gc activity? Here's mine: https://bitbucket.org/infognition/dstuff/src/ A little module that allows you to track all GC allocations.

Re: Russian translation of the range term?

2014-11-12 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 11:50:18 UTC, Ivan Kazmenko wrote: Hi! I'm unsure what is the Russian equivalent for the term range, as in D range, the generalization of a pair of iterators. I think последовательность (sequence) is the most appropriate, because the defining characteristic

Re: Destructor/Finalizer Guarantees

2014-11-12 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 22:31:17 UTC, Maxime Chevalier-Boisvert wrote: I've made it so they unregister themselves in their destructor. ... However, this only works if I can assume that the GC will first call the destructor on an object, then free the object, that this is done in a

Re: Destructor/Finalizer Guarantees

2014-11-12 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 04:06:11 UTC, Algo wrote: Could this work? class VM { static List[VM*] _gcRootLists; List* gcRootList; ~this() { _gcRootLists.remove(this); No. Hash-table operations may try to allocate or free memory which is not allowed during a GC

Re: std.array oddness

2014-12-13 Thread thedeemon via Digitalmars-d-learn
On Saturday, 13 December 2014 at 06:40:41 UTC, ketmar via Digitalmars-d-learn wrote: .map!a.idup That can be just .map!idup.

Re: Call of rmdir in destructor causes InvalidMemoryOperationError

2015-01-01 Thread thedeemon via Digitalmars-d-learn
On Thursday, 1 January 2015 at 15:14:41 UTC, Timo Gransch wrote: Hi, I have a class which unzips an archive into a temporary directory below the system temp folder. I want to delete this temporary directory in the class's destructor, but when I call rmdir there, I get an

Re: Constructing a tuple dynamically

2015-02-03 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 3 February 2015 at 10:32:47 UTC, Pena wrote: How can I use this code or something similar to dynamically construct a tuple containing types of fields marked as @Cloneable? import std.traits, std.typetuple; template CloneableTypes(S) { template IsCloneable(string M) { enum

Re: Is there websocket client implementation for D

2015-03-25 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 24 March 2015 at 17:55:38 UTC, Ilya Korobitsyn wrote: Hello! Is there any websocket client implementation in D? There's some WebSocket stuff here: https://github.com/adamdruppe/arsd/blob/master/cgi.d It's for server side, but probably contains stuff you need for client too.

Re: Speed of horizontal flip

2015-04-01 Thread thedeemon via Digitalmars-d-learn
std.algorithm.reverse uses ranges, and shamefully DMD is really bad at optimizing away range-induced costs.

Re: problem with parallel foreach

2015-05-12 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 12 May 2015 at 14:59:38 UTC, Gerald Jansen wrote: The output of /usr/bin/time is as follows: Lang JobsUser System Elapsed %CPU Py 2 79.242.16 0:48.90 166 D 2 19.41 10.14 0:17.96 164 Py 30 1255.17 58.38 2:39.54 823 * Pool(12) D 30 421.61

Re: What wrong?

2015-05-15 Thread thedeemon via Digitalmars-d-learn
On Saturday, 2 May 2015 at 02:51:52 UTC, Fyodor Ustinov wrote: Simple code: http://pastebin.com/raw.php?i=7jVeMFXQ What I'm doing wrong? Try using class instead of struct. Last time I played with std.concurrency it used Variants to store the messages, so when something bigger than a little

Re: The analogue of fill-pointer in D

2015-05-18 Thread thedeemon via Digitalmars-d-learn
On Monday, 18 May 2015 at 10:24:25 UTC, Dennis Ritchie wrote: No, afraid not. Function capacity is not an analogue of fill-pointers! It's exactly the same. Lisp-programmer explains the usefulness of fill-pointers as follows: Fill pointer cuts the tail of the vector. In D: .length cuts

Re: -vgc Info ok?

2015-05-19 Thread thedeemon via Digitalmars-d-learn
On Monday, 18 May 2015 at 14:30:43 UTC, Chris wrote: Why is _accessing_ an assoc treated as indexing it? Are you sure you understand indexing as we do? It's not like indexing of databases, it's just accessing by index i.e. using myarray[some_index].

Re: problem with parallel foreach

2015-05-12 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 12 May 2015 at 20:50:45 UTC, Gerald Jansen wrote: Your advice is appreciated but quite disheartening. I was hoping for something (nearly) as easy to use as Python's parallel.Pool() map(), given that this is essentially an embarassingly parallel problem. Avoidance of GC allocation

Re: problem with parallel foreach

2015-05-13 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 13 May 2015 at 06:59:02 UTC, Ali Çehreli wrote: In case of Python's parallel.Pool() separate processes do the work without any synchronization issues. In case of D's std.parallelism it's just threads inside one process and they do fight for some locks, thus this result. Right.

Re: C++ to D - recursion with std.variant

2015-04-05 Thread thedeemon via Digitalmars-d-learn
On Friday, 3 April 2015 at 16:46:08 UTC, Dennis Ritchie wrote: Hi, Is it possible to write on D recursion using std.variant? Using Algebraic from std.variant and some additional templates: http://dpaste.dzfl.pl/65afd3a7ce52 (taken from this thread:

Re: More type-flexible arrays?

2015-06-16 Thread thedeemon via Digitalmars-d-learn
On Sunday, 14 June 2015 at 06:12:30 UTC, Ozan wrote: Is it possible to create arrays which has more then one type, f. ex. array[0] = 1; array[1] = z; array[2] = new clazz(), Probably tuples are what you really need here. http://dlang.org/phobos/std_typecons.html#.Tuple

Re: DFL background tasks

2015-06-10 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 10 June 2015 at 22:18:21 UTC, Scroph wrote: client.perform; while(!client.isStopped) I don't think this will work as you expect. perform is a synchronous call, it will not return until the download finishes, as I understand, so your while loop is too late. I

Re: How to implement immutable ring buffer?

2015-05-27 Thread thedeemon via Digitalmars-d-learn
This whole idea sounds self-contradictory. Ring buffer is a mutable-array-based implementation of something, for example of a queue. You can ask about immutable implementations of a queue, but that would be another question, not involving a ring buffer. What do you want to do with this

Re: drastic slowdown for copies

2015-05-29 Thread thedeemon via Digitalmars-d-learn
On Friday, 29 May 2015 at 07:51:31 UTC, thedeemon wrote: Above was on Core 2 Quad, here's for Core i3: 4 ints 5 ints -release by ref: 67 by ref: 66 by copy: 44 by copy: 142 by move: 45 by move: 137 -release -O by ref: 29 by ref: 29 by copy: 41 by copy: 141 by

Re: drastic slowdown for copies

2015-05-29 Thread thedeemon via Digitalmars-d-learn
On Thursday, 28 May 2015 at 21:23:11 UTC, Momo wrote: Ah, actually it's more complicated, as it depends on inlining a lot. Indeed, without -O and -inline I was able to get by_ref to be slightly slower than by_copy for struct of 4 ints. But when inlining turns on, the numbers change in

Re: drastic slowdown for copies

2015-05-29 Thread thedeemon via Digitalmars-d-learn
On Thursday, 28 May 2015 at 21:23:11 UTC, Momo wrote: I'm currently investigating the difference of speed between references and copies. And it seems that copies got a immense slowdown if they reach a size of = 20 bytes. This is processor-specific, on different models of CPUs you might get

Re: problem with gc?

2015-05-27 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 27 May 2015 at 05:48:13 UTC, zhmt wrote: What happened when the code changes a little? Who will give an explaination,Thanks a lot? Yes, on the first sight it looks like your allocations in the loop make GC spend too much time. I don't think scope does anything here. Try adding

Re: incorrect data when returning static array in place of dynamic

2015-07-05 Thread thedeemon via Digitalmars-d-learn
On Sunday, 5 July 2015 at 18:57:46 UTC, sigod wrote: Why does function return incorrect data? Using `.dup` in return expression or using `ubyte[20]` as return type fixes problem, but why? Because sha1Of() returns ubyte[20], this is a stack-allocated array, a value type. If you put correct

Re: Checking template parameter types of class

2015-05-25 Thread thedeemon via Digitalmars-d-learn
On Monday, 25 May 2015 at 04:15:00 UTC, tcak wrote: main.d(243): Error: class main.FileResourceList(T) if (is(T : FileResource)) is used as a type The error message is not indicating directly this, though logically it is still correct. Compiler means template is used as a type which is an

Re: How to provide this arg or functor for algorithm?

2015-08-17 Thread thedeemon via Digitalmars-d-learn
On Monday, 17 August 2015 at 09:51:47 UTC, anonymous wrote: Huh. I think func being a template is the key here. When the original code is put in a template, it works too (with 2.068): Nope, it works only because r is unreferenced and gets thrown out. Just try using r.front there, for example,

Re: How to provide this arg or functor for algorithm?

2015-08-17 Thread thedeemon via Digitalmars-d-learn
On Monday, 17 August 2015 at 12:38:05 UTC, anonymous wrote: auto func()(uint[] arr, uint delegate(uint) pure @nogc d) @nogc { return arr.map!(d); } void main() @nogc { uint[3] arr = [1,2,3]; uint context = 2; auto c = Caller(context); auto d = c.method; auto r =

Re: GC and MMM

2015-08-21 Thread thedeemon via Digitalmars-d-learn
On Thursday, 20 August 2015 at 17:13:33 UTC, Ilya Yaroshenko wrote: Hi All! Does GC scan manually allocated memory? Only if you ask GC to do it - by calling core.memory.addRange.

Re: How to provide this arg or functor for algorithm?

2015-08-17 Thread thedeemon via Digitalmars-d-learn
On Monday, 17 August 2015 at 16:18:50 UTC, thedeemon wrote: I've just checked with my runtime GC hook. Here the call to func() allocates 12 bytes via gc_malloc, and it's the same for a 4-elements array, so it's not for the array itself, it's for a closure, I think. Also, compiling with -vgc

Re: Thread communication

2015-08-05 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 4 August 2015 at 15:19:51 UTC, Chris wrote: I want to stop (and abort) the worker as soon as new input arrives. However, while executing the function that contains the foreach-loop the worker thread doesn't listen, because it's busy, of course. I think this is a matter of

Re: Why my app require MSVCR120.dll?

2015-11-08 Thread thedeemon via Digitalmars-d-learn
On Sunday, 8 November 2015 at 05:11:50 UTC, suliman wrote: On Sunday, 8 November 2015 at 04:50:49 UTC, thedeemon wrote: On Saturday, 7 November 2015 at 10:03:58 UTC, Suliman wrote: I am using DMD. -m64 or -m32mscoff ? Without any keys. I use dub for building I suspect your issue is

Re: Why my app require MSVCR120.dll?

2015-11-07 Thread thedeemon via Digitalmars-d-learn
On Saturday, 7 November 2015 at 10:03:58 UTC, Suliman wrote: I am using DMD. -m64 or -m32mscoff ?

Re: Tell GC to use shared memory

2015-10-12 Thread thedeemon via Digitalmars-d-learn
On Thursday, 8 October 2015 at 09:25:36 UTC, tcak wrote: On Thursday, 8 October 2015 at 05:46:31 UTC, ketmar wrote: On Thursday, 8 October 2015 at 04:38:43 UTC, tcak wrote: Is it possible to modify GC (without rebuilding the compiler), so it uses a given shared memory area instead of heap for

Re: Working Windows GUI library?

2015-09-04 Thread thedeemon via Digitalmars-d-learn
On Friday, 4 September 2015 at 13:54:25 UTC, Andre Polykanine wrote: Hello thedeemon, tvDdl> Yes, DFL! tvDdl> https://github.com/Rayerd/dfl Sounds good. but still... I can't find any examples or documentation :( Here's some original docs and examples:

Re: spawn X different workers & wait for results from all of them

2015-09-05 Thread thedeemon via Digitalmars-d-learn
On Thursday, 3 September 2015 at 16:50:21 UTC, Robert M. Münch wrote: Hi, I'm not sure how to best implement the following: 1. I have 4 different tasks to do. 2. All can run in parallel 3. Every task will return some result that I need Now how to best do it? I think the Task and taskPool

Re: interprocess communication and sharing memory

2015-09-03 Thread thedeemon via Digitalmars-d-learn
On Thursday, 3 September 2015 at 02:52:00 UTC, Laeeth Isharc wrote: On Thursday, 3 September 2015 at 01:27:15 UTC, j55 wrote: This is my first attempt at a project in D, so pardon me if I'm overlooking something obvious: I'm using libasync to create an eventloop, to set up something like a

Re: Working Windows GUI library?

2015-09-04 Thread thedeemon via Digitalmars-d-learn
On Thursday, 3 September 2015 at 15:46:28 UTC, Andre Polykanine wrote: So my question is: is there any reliable GUI library implementing native Windows controls? Yes, DFL! https://github.com/Rayerd/dfl It's a thin wrapper over WinAPI so all controls are native. I've built several apps

Re: Do users need to install VS runtime redistributable if linking with Microsoft linker?

2015-09-22 Thread thedeemon via Digitalmars-d-learn
On Monday, 21 September 2015 at 15:00:24 UTC, ponce wrote: All in the title. DMD 64-bit links with the VS linker. Do users need to install the VS redistributable libraries? I think they don't. Generated .exe seems to depend only on kernel32.dll and shell32.dll, i.e. things users already

Re: Can I check if a value is convertible to a valid value of an enum?

2015-09-24 Thread thedeemon via Digitalmars-d-learn
On Friday, 25 September 2015 at 03:12:20 UTC, French Football wrote: ...without having to loop over the enum? writeln( test( valid_value ) ); //prints true Since `value` is known only at run time, some checks need to be performed at run time anyway. One way of doing it without iterating

Re: How is D doing?

2015-12-23 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 22 December 2015 at 21:38:22 UTC, ZombineDev wrote: Google Trends shows something interesting: https://google.com/trends/explore#q=%2Fm%2F01kbt7%2C%20%2Fm%2F0dsbpg6%2C%20%2Fm%2F091hdj%2C%20%2Fm%2F03j_q%2C%20C%2B%2B=q=Etc%2FGMT-2 Today I Learned C++ is most interested by in

Re: Graphics/font/platform backends with common interfaces?

2015-12-25 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 23:34:58 UTC, Rikki Cattermole wrote: So far I've been implementing windowing and image libraries for Phobos. Right now windowing works on Windows minice eventing. Once eventing is done it is ready for the first stage of feedback. I don't understand

Re: Make Simple Things Hard to Figure out

2015-12-21 Thread thedeemon via Digitalmars-d-learn
On Monday, 21 December 2015 at 13:51:57 UTC, default0 wrote: As this isn't really a question for Learn I'm not sure if it fits here. This is more of a "This is how I went about trying to learn X. These are the problems I encountered. Ideas to improve?" but I guess I might as well post it here.

Re: How to use D parallel functions/library

2015-11-24 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 24 November 2015 at 18:49:25 UTC, Bishop120 wrote: I figured this would be a simple parallel foreach function with an iota range of sizeX and just making int X declared inside the function so that I didnt have to worry about shared variable but I cant get around the alive++

Re: Accessing COM Objects

2016-06-15 Thread thedeemon via Digitalmars-d-learn
On Monday, 13 June 2016 at 17:38:41 UTC, Incognito wrote: Cool. Oleview gives me the idl files. How to convert the idl files to d or possibly c? There are ready tools idl2d: https://github.com/dlang/visuald/tree/master/c2d and tlb2idl: https://github.com/dlang/visuald/tree/master/tools I've

Re: Accessing COM Objects

2016-06-15 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 07:01:30 UTC, Joerg Joergonson wrote: It seems idl2d from VD is not easily compilable? I don't remember problems with that, anyway here's the binary I used: http://stuff.thedeemon.com/idl2d.exe

Re: ARSD PNG memory usage

2016-06-16 Thread thedeemon via Digitalmars-d-learn
On Friday, 17 June 2016 at 01:51:41 UTC, Joerg Joergonson wrote: Hi, so, do you have any idea why when I load an image with png.d it takes a ton of memory? I've bumped into this previously. It allocates a lot of temporary arrays for decoded chunks of data, and I managed to reduce those

Re: Accessing COM Objects

2016-06-16 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 21:06:01 UTC, Joerg Joergonson wrote: Ok, I've tried things like uncommenting Document Open(BSTR Document, VARIANT As, VARIANT AsSmartObject); void Load(BSTR Document); /*[id(0x70537673)]*/ BSTR get_ScriptingVersion(); /*[id(0x70464D4D)]*/

Re: Registration-free COM client

2016-06-27 Thread thedeemon via Digitalmars-d-learn
On Monday, 27 June 2016 at 21:17:52 UTC, Thalamus wrote: Hi everyone, I've succeeded in using D as a client for regular (registered) COM servers in the past, but in this case, I'm building the server as well. I would like to avoid registering it if possible so XCOPY-like deployment remains

Re: Things that keep D from evolving?

2016-02-08 Thread thedeemon via Digitalmars-d-learn
On Saturday, 6 February 2016 at 08:07:42 UTC, NX wrote: What language semantics prevent precise & fast GC implementations? Unions and easy type casting prevent precise GC. Lack of write barriers for reference-type fields prevent fast (generational and/or concurrent) GC. Some more detailed

Re: Things that keep D from evolving?

2016-02-10 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 9 February 2016 at 17:41:34 UTC, NX wrote: I would want it to be solved rather than being worked on... which requires design change which is probably not going to happen. There is still room for improvement though. Right. I think there are at least two things that can improve

Re: Functions that return type

2016-01-20 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 20 January 2016 at 04:27:27 UTC, blm768 wrote: I guess the constraints are that of a static language. (This is not true.) I'm playing with the design of such a language myself. Basically, anything can create/use/return type objects This is usually possible in dependently

Re: D Book page 402 Concurrency FAIL

2016-02-15 Thread thedeemon via Digitalmars-d-learn
On Sunday, 14 February 2016 at 22:54:36 UTC, Brother Bill wrote: Please provide full replacement of this toy program that works with D version 2.070.0 This one works fine for me in Windows with VisualD and DMD 2.070.0: -- import std.concurrency, std.stdio,

Re: Photoshop programming

2016-02-15 Thread thedeemon via Digitalmars-d-learn
On Sunday, 14 February 2016 at 09:48:54 UTC, Patience wrote: Photoshop has the ability to be controlled by scripts and programming languages. For example, C# can be used to access photoshop by adding the appropriate reference and using directives. I believe it is COM based but I am not totally

Re: Memory Efficient HashSet

2016-03-10 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 22:31:50 UTC, Nordlöw wrote: consumes 842.m MiB on my Ubuntu. Here's mine: https://bitbucket.org/infognition/robinhood/src (you just need one file rbhash.d to use in your apps) The following test takes ~130 MB and can take less with some tweaks in the settings:

Re: GC scan for pointers

2016-03-10 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 15:14:02 UTC, Gerald Jansen wrote: I've studied [1] and [2] but don't understand everything there. Hence these dumb questions: Given enum n = 100_000_000; // some big number auto a = new ulong[](n); auto b = new char[8][](n); struct S { ulong x; char[8]

Re: Use of GUID constants

2016-03-10 Thread thedeemon via Digitalmars-d-learn
On Thursday, 10 March 2016 at 15:48:14 UTC, Mike Parker wrote: Personally I would just declare one immutable value in module scope and be done with it. It really just doesn't matter. Unless you're following some sort of style guide, personal preference rules the day. I don't know if Rainers

Re: Can DUB --combined builds be faster?

2016-03-14 Thread thedeemon via Digitalmars-d-learn
On Monday, 14 March 2016 at 11:50:38 UTC, Rene Zwanenburg wrote: When building in release mode the call to foo() gets inlined just fine without --combined. How does it work? Is it because the source of foo() is visible to the compiler when producing the result?

Re: Something wrong with GC

2016-03-21 Thread thedeemon via Digitalmars-d-learn
On Sunday, 20 March 2016 at 07:49:17 UTC, stunaep wrote: The gc throws invalid memory errors if I use Arrays from std.container. Those arrays are for RAII-style deterministic memory release, they shouldn't be freely mixed with GC-allocated things. What happens here is while initializing

Re: Something wrong with GC

2016-03-23 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 22 March 2016 at 13:46:41 UTC, stunaep wrote: So what am I do to? Just learn more about available containers and their semantics. Maybe you don't need Array!T when there is a simple T[]. If you think you do need Array, then think about memory management: where are you going to

Re: How do you use D to launch/open a window?

2016-04-23 Thread thedeemon via Digitalmars-d-learn
On Friday, 22 April 2016 at 21:13:31 UTC, anonymousuer wrote: What code is needed to tell D to open a window? Thank you in advance. import dlangui; mixin APP_ENTRY_POINT; extern (C) int UIAppMain(string[] args) { Window window = Platform.instance.createWindow("Window caption", null);

Re: DlangUI translations

2016-04-23 Thread thedeemon via Digitalmars-d-learn
On Saturday, 23 April 2016 at 15:44:22 UTC, stunaep wrote: I am wondering how to use other languages and how to NOT use other languages. Did you see example1 from examples folder in dlangui? It has two languages and allows switching at runtime via menu.

Re: Generation of AST for semantic rule checking

2016-05-23 Thread thedeemon via Digitalmars-d-learn
On Sunday, 22 May 2016 at 04:33:44 UTC, Chris Katko wrote: Basically, I want compile-time enforcement of semantic rules. So the question is: Is there a way to get LDC2 to generate AST or similar, and if not, any other way to go about this? I think one popular approach to the task is to use

Re: .array changes the order

2016-05-12 Thread thedeemon via Digitalmars-d-learn
On Thursday, 12 May 2016 at 10:17:19 UTC, xtreak wrote: Thanks a lot. Can you kindly elaborate a little more on File.byLine with an example of the scenario so that I don't get bitten by it. File.byLine.array works as expected for me. A little more explanation on the permutations will also be

Re: DlangIDE Themes

2016-05-11 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 12:55:13 UTC, Chris wrote: Is there a way I can add my own themes? I've created a theme file and added it to views/resources.list However, it doesn't show up. "Default" and "Dark" seem to be hardwired somewhere in the source code. Indeed they are, just grep for

Re: DlangIDE Themes

2016-05-12 Thread thedeemon via Digitalmars-d-learn
On Thursday, 12 May 2016 at 09:17:24 UTC, Chris wrote: They shouldn't be hardwired. Best would be to load them dynamically with their respective names encoded in the xml file. In this way people could add their own themes as they see fit. I wouldn't mind creating themes and adding them to

Re: .array changes the order

2016-05-12 Thread thedeemon via Digitalmars-d-learn
On Thursday, 12 May 2016 at 09:44:39 UTC, xtreak wrote: I came across the issue where using .array after .joiner caused the changes to the output. The program is at https://dpaste.dzfl.pl/0885ba2eddb4 . I tried to debug through the output but I couldn't get the exact issue. It will be helpful

Re: Compiler or Interpreter or Hybrid

2016-04-20 Thread thedeemon via Digitalmars-d-learn
On Thursday, 21 April 2016 at 02:06:00 UTC, newB wrote: How is D implemented? (Compiler, Interpreter and Hybrid). Can you please explain why? Generally D is a compiled language: you give the compiler some source code and it produces executable binary with native machine code. Then you

Re: Hooking into GC

2016-06-28 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 02:18:27 UTC, MMJones wrote: I read somewhere that one can modify the D files from phobos and runtime to supply a stub for the GC. I would like to add some logging features to the GC. You don't need to recompile anything, a stub can be installed from your

Re: Commit size and Page fault's very large for simple program

2016-07-04 Thread thedeemon via Digitalmars-d-learn
On Monday, 4 July 2016 at 11:56:14 UTC, Rene Zwanenburg wrote: On Monday, 4 July 2016 at 11:42:40 UTC, Rene Zwanenburg wrote: ... I forgot to mention: If you're on Windows compilation defaults to 32 bit, false pointers can be a problem with D's current GC in 32 bit applications. This isn't

Re: GC question

2017-02-04 Thread thedeemon via Digitalmars-d-learn
On Saturday, 4 February 2017 at 12:56:55 UTC, osa1 wrote: - Automatic but conservative. Can leak at any time. You have to implement manual management (managed heaps) to avoid leaks. Leaks are hard to find as any heap value may be causing it. By "managed heap" I just meant the GC heap, the one

Re: GC question

2017-02-04 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 1 February 2017 at 06:58:43 UTC, osa1 wrote: I'm wondering what are the implications of the fact that current GC is a Boehm-style conservative GC rather than a precise one, I've never worked with a conservative GC before. Are there any disallowed memory operations? Can I break

Re: Serializer class

2017-02-22 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 18:34:26 UTC, houdoux09 wrote: void Read(T)(T value) { foreach(i, mm; value.tupleof) { writeln(__traits(identifier, value.tupleof[i]), " = ", mm); if(isArray!(typeof(mm))) { Read(mm[0]); //Error } } } You need to

Re: Thread will get garbage collected?

2017-01-17 Thread thedeemon via Digitalmars-d-learn
On Monday, 16 January 2017 at 22:08:56 UTC, JN wrote: Am I correctly understanding, that after going out of scope, it's possible for GC to destroy my thread before the file finishes loading? How to prevent GC from destroying my thread before it finishes and make sure the file is loaded

Re: Recommend: IDE and GUI library

2017-02-27 Thread thedeemon via Digitalmars-d-learn
On Friday, 24 February 2017 at 22:44:55 UTC, XavierAP wrote: Hi I've looked at wiki.dlang.org/IDEs, and I see that Visual D is linked from dlang.org/download.html. Still I was looking for personal opinions and experiences beyond hard specs, I wonder if one of the IDEs is already dominant at

Re: Recommend: IDE and GUI library

2017-03-01 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 1 March 2017 at 23:44:47 UTC, XavierAP wrote: Still I want to be able to be able to work and debug from Visual Studio. The way I did on Windows: 1) get dlangui via dub 2) go to its folder in AppData\roaming\dub\packages and edit dub.json: * find "minimal" configuration * add

Re: D code optimization

2016-09-22 Thread thedeemon via Digitalmars-d-learn
On Thursday, 22 September 2016 at 16:09:49 UTC, Sandu wrote: const int n = 252; double[] call = new double[n+1]; ... //delete call; // since D is has a garbage collector, explicit deallocation of arrays is not necessary. If you care about speed, better

Re: how to debug memory errors

2016-11-07 Thread thedeemon via Digitalmars-d-learn
On Monday, 7 November 2016 at 02:22:35 UTC, Steven Schveighoffer wrote: OP: it's not legal to destroy or even access GC allocated members in a destructor. The GC may have already destroyed that data. Isn't destroy() fine there? It doesn't call destructors for already destroyed objects, so I

Re: how to debug memory errors

2016-11-07 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 05:36:22 UTC, Era Scarecrow wrote: Hmmm.. I had the impression that if something was referenced by another object, then it couldn't be collected, Another *live* object, i.e. reachable from globals and stack. If you have a big tree and it becomes unreachable

Re: Memory allocation failed. Why?

2016-11-21 Thread thedeemon via Digitalmars-d-learn
On Sunday, 20 November 2016 at 17:47:50 UTC, MGW wrote: core.exception.OutOfMemoryError@src\core\exception.d(693): Memory allocation failed Simple program and error. Why? Windows 7 (32) dmd 2.072.0 Making a 100 million bytes array by appending one byte at

Re: Auto recursive function

2017-01-12 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 19:23:10 UTC, Razvan Nitu wrote: Hi, I am currently trying to create a function makeMultidimensionalArray which allocates memory for a multidimensional array. You were very close to the answer: auto makeMultidimensionalArray(int N, T, Allocator)(auto ref

Re: writeln and ~

2017-01-14 Thread thedeemon via Digitalmars-d-learn
On Saturday, 14 January 2017 at 17:42:05 UTC, Ignacious wrote: writeln(x ~ " ok"); Just write writeln(x, " ok"); Any number of arguments, no unnecessary allocations. Do you really need ~?

Re: Impressed with Appender - Is there design/implementation description?

2016-12-06 Thread thedeemon via Digitalmars-d-learn
On Sunday, 4 December 2016 at 20:03:37 UTC, Jon Degenhardt wrote: I've been using Appender quite a bit recently, typically when I need append-only arrays with variable and unknown final sizes. I had been prepared to write a custom data structure when I started using it with large amounts of

  1   2   >