Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread zjh via Digitalmars-d-learn
On Friday, 28 May 2021 at 00:07:41 UTC, zjh wrote: On Friday, maybe you can try nana.

Re: where do I find the complete phobos function list names ?

2021-05-27 Thread someone via Digitalmars-d-learn
On Thursday, 27 May 2021 at 21:21:46 UTC, Christian Köstlin wrote: e.g. I found this file https://dlang.org/library/symbols.js which is used e.g. by https://dlang.org/library/std/algorithm/sorting/sort.html to implement the search. Perhaps that helps. Thanks Christian ! I downloaded the sym

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread zjh via Digitalmars-d-learn
On Friday, 28 May 2021 at 00:05:36 UTC, zjh wrote: If there is a binding of wxWidgets. then is good.

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread zjh via Digitalmars-d-learn
On Thursday, 27 May 2021 at 17:04:07 UTC, Alain De Vos wrote: Let's +10

Re: How long does the context of a delegate exist?

2021-05-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/27/21 4:46 PM, IGotD- wrote: On Thursday, 27 May 2021 at 18:13:17 UTC, Adam D. Ruppe wrote: If the delegate is created by the GC and stored it will still be managed by the GC, along with its captured vars. As long as the GC can see the delegate in your example you should be OK. But if

Re: where do I find the complete phobos function list names ?

2021-05-27 Thread Christian Köstlin via Digitalmars-d-learn
On 2021-05-26 01:46, Paul Backus wrote: On Tuesday, 25 May 2021 at 22:05:16 UTC, someone wrote: I was unsuccessfully searching the site for them in the form of a master index to begin with. I need them, in plain text, in order to add them to a VIM custom syntax highlight plugin I already made

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread Christian Köstlin via Digitalmars-d-learn
On 2021-05-27 18:56, Ali Çehreli wrote: On 5/27/21 9:19 AM, Ali Çehreli wrote:    auto result = new string[users.length];    users.enumerate.parallel.each!(en => result[en.index] = servers.doSomething(en.value));    writeln(result); I still like the foreach version more:     auto result =

Re: ChromeOS and DLang

2021-05-27 Thread Alain De Vos via Digitalmars-d-learn
If you have a compiler you can go.

Re: How long does the context of a delegate exist?

2021-05-27 Thread IGotD- via Digitalmars-d-learn
On Thursday, 27 May 2021 at 18:13:17 UTC, Adam D. Ruppe wrote: If the delegate is created by the GC and stored it will still be managed by the GC, along with its captured vars. As long as the GC can see the delegate in your example you should be OK. But if it is held on to by a C or OS lib,

Re: How long does the context of a delegate exist?

2021-05-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 27 May 2021 at 20:44:21 UTC, frame wrote: Did you mean to add the delegate as GC root or the data? The delegate.ptr property.

Re: How long does the context of a delegate exist?

2021-05-27 Thread frame via Digitalmars-d-learn
On Thursday, 27 May 2021 at 18:13:17 UTC, Adam D. Ruppe wrote: On Thursday, 27 May 2021 at 12:59:02 UTC, frame wrote: But what about the data used in the context of the delegate? If the delegate is created by the GC and stored it will still be managed by the GC, along with its captured vars.

Re: where do I find the complete phobos function list names ?

2021-05-27 Thread Christian Köstlin via Digitalmars-d-learn
On 2021-05-26 01:46, Paul Backus wrote: On Tuesday, 25 May 2021 at 22:05:16 UTC, someone wrote: I was unsuccessfully searching the site for them in the form of a master index to begin with. I need them, in plain text, in order to add them to a VIM custom syntax highlight plugin I already made

Re: How long does the context of a delegate exist?

2021-05-27 Thread frame via Digitalmars-d-learn
On Thursday, 27 May 2021 at 16:17:12 UTC, Alain De Vos wrote: I think of a dynamic array as a value-type consisting of a pointer to the actual data and a length, which gets copied. The data pointing to will continue to live. The pointer and length might disappear from the stack or get copied.

ChromeOS and DLang

2021-05-27 Thread Ozan Sueel via Digitalmars-d-learn
Hi I think about writing apps vor ChromeOS, but before running in a death end, I ask by myself, is D a good choice for this approach? Any experience with this new upcoming operating system? Regards Ozan

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread Alain De Vos via Digitalmars-d-learn
I think dlangui is a dead monkey.

Re: How long does the context of a delegate exist?

2021-05-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 27 May 2021 at 12:59:02 UTC, frame wrote: But what about the data used in the context of the delegate? If the delegate is created by the GC and stored it will still be managed by the GC, along with its captured vars. As long as the GC can see the delegate in your example you sho

Re: Passing lots of C flas to the D compilers and DUB

2021-05-27 Thread Alain De Vos via Digitalmars-d-learn
I pass many flags using dub. Relevant line in my dub.json, ``` "name": "gparted", "dflags-ldc": ["--gcc=cc","--vcolumns","--oq","--dip1000","--dip25","--safe-stack-layout","--boundscheck=on","--D","--g","--w","--de","--d-debug"] ``` Or just direct command, ``` ldc2 --gcc=cc --vcolumns --oq --d

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread Alain De Vos via Digitalmars-d-learn
Let's also not forget other languages have problems with gui-toolkits. For instance, gtk-ada binding has memory leaks. gtk-crystal binding is broken. I would like to see a binding to wxwidgets which is a very cool toolkit.

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread Ali Çehreli via Digitalmars-d-learn
On 5/27/21 9:19 AM, Ali Çehreli wrote:   auto result = new string[users.length];   users.enumerate.parallel.each!(en => result[en.index] = servers.doSomething(en.value));   writeln(result); I still like the foreach version more: auto result = new string[users.length]; foreach (i,

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread Dejan Lekic via Digitalmars-d-learn
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: Yes, I know this is a question lacking a straightforward answer. Requirements: [...] I humbly believe the most complete one is GtKD. https://gtkdcoding.com/ https://gtkd.org We all wish there was a STANDARD D GUI library out there, bu

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread Alain De Vos via Digitalmars-d-learn
I very succefully used tkd and gtkd, d binding to tk and gtk. Can someone guide me to using fox or fltk ?

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread Ali Çehreli via Digitalmars-d-learn
On 5/27/21 2:58 AM, Christian Köstlin wrote: > writeln(taskPool.amap!(user => servers.doSomething(user))(users)); Luckily, parallel() is a free-standing function that does not require a "this context". Is the following a workaround for you? auto result = new string[users.length]; use

Re: How long does the context of a delegate exist?

2021-05-27 Thread Alain De Vos via Digitalmars-d-learn
I think of a dynamic array as a value-type consisting of a pointer to the actual data and a length, which gets copied. The data pointing to will continue to live. The pointer and length might disappear from the stack or get copied. I think there is no problem.

Re: Compiler Explorer Assembly Output for C, C++ and D (dlang)

2021-05-27 Thread Alain De Vos via Digitalmars-d-learn
Sidequestion. For what purpose is the registration of dso used ?

Re: Compiler Explorer Assembly Output for C, C++ and D (dlang)

2021-05-27 Thread Gavin Ray via Digitalmars-d-learn
On Thursday, 27 May 2021 at 10:48:43 UTC, Basile B. wrote: https://forum.dlang.org/post/myrjutqyzpzlyltrd...@forum.dlang.org Thank you for sharing this! The difference between setting `pragma(LDC_no_moduleinfo);` at the top, and `-Os -gline-tables-only` in compiler flags is drastic. - Stan

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/27/21 10:13 AM, Christian Köstlin wrote: P.S.: I still do not get how to post formatted snippets with thunderbird to the newsgroup/forum :/ It's not possible currently. I keep posting all my thunderbird posts *as if* the forum will highlight them in the hopes that some day it will retroa

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread Christian Köstlin via Digitalmars-d-learn
On 2021-05-27 15:00, sighoya wrote: On Thursday, 27 May 2021 at 12:58:28 UTC, Christian Köstlin wrote: That looks nice, but unfortunately my data for servers and users in the real world is not static but comes from a config file. Okay, but then parametrizing the static lambda with runtime par

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread sighoya via Digitalmars-d-learn
On Thursday, 27 May 2021 at 12:58:28 UTC, Christian Köstlin wrote: That looks nice, but unfortunately my data for servers and users in the real world is not static but comes from a config file. Okay, but then parametrizing the static lambda with runtime parameters should work. The important

How long does the context of a delegate exist?

2021-05-27 Thread frame via Digitalmars-d-learn
I'm using a buffer delegate to fill data from a DLL and use it as range like this: Pseudo-Code: ```d void DLLFun(out Collector collector) { auto something; collector = Collector(...); collector.registerFillBufferMethod({ auto data = []; //... // use of something; retur

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread Christian Köstlin via Digitalmars-d-learn
On 2021-05-27 14:48, sighoya wrote: On Thursday, 27 May 2021 at 12:17:36 UTC, Christian Köstlin wrote: Can you explain me, where here a double context is needed? Because all data now should be passed as arguments to amap? Kind regards, Christian I  believe D's type system isn't smart enough

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread sighoya via Digitalmars-d-learn
On Thursday, 27 May 2021 at 12:17:36 UTC, Christian Köstlin wrote: Can you explain me, where here a double context is needed? Because all data now should be passed as arguments to amap? Kind regards, Christian I believe D's type system isn't smart enough to see independence between context

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread Christian Köstlin via Digitalmars-d-learn
On 2021-05-27 13:11, sighoya wrote: On Thursday, 27 May 2021 at 09:58:40 UTC, Christian Köstlin wrote: I have this small program here test.d: ``` import std; string doSomething(string[] servers, string user) {     return user ~ servers[0]; } void main() {     auto servers = ["s1", "s2", "s3"];

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread Christian Köstlin via Digitalmars-d-learn
Thanks for the proposed solution. It also works in my slightly bigger program (although I do not like to make servers more global). I tried also the following (which unfortunately also does not work as intended): ```D import std; string doSomething(string[] servers, string user) { return

Re: How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread sighoya via Digitalmars-d-learn
On Thursday, 27 May 2021 at 09:58:40 UTC, Christian Köstlin wrote: I have this small program here test.d: ``` import std; string doSomething(string[] servers, string user) { return user ~ servers[0]; } void main() { auto servers = ["s1", "s2", "s3"]; auto users = ["u1", "u2", "u3"];

Re: Compiler Explorer Assembly Output for C, C++ and D (dlang)

2021-05-27 Thread Basile B. via Digitalmars-d-learn
On Thursday, 27 May 2021 at 08:47:50 UTC, Tariq Siddiqui wrote: When using Compiler Explorer (https://godbolt.org/) to compare assembly output of simple programs, why D language assembly output is so long compared to C or C++ output. The simple square function output is the same for C, C++, and

Re: Compiler Explorer Assembly Output for C, C++ and D (dlang)

2021-05-27 Thread Dennis via Digitalmars-d-learn
On Thursday, 27 May 2021 at 10:27:42 UTC, Tariq Siddiqui wrote: Thanks for your answer, -betterC works well with simple code but when using templates in code -betterC compilation failed. Templates are supported in -betterC, what's not supported can be found here: https://dlang.org/spec/better

Re: Compiler Explorer Assembly Output for C, C++ and D (dlang)

2021-05-27 Thread Tariq Siddiqui via Digitalmars-d-learn
On Thursday, 27 May 2021 at 09:11:35 UTC, Dennis wrote: On Thursday, 27 May 2021 at 08:47:50 UTC, Tariq Siddiqui wrote: - What are these additional lines? D generates extra symbols per module for things like module constructors, unittests and class introspection (I think). - How can I re

How to work around the infamous dual-context when using delegates together with std.parallelism

2021-05-27 Thread Christian Köstlin via Digitalmars-d-learn
I have this small program here test.d: ``` import std; string doSomething(string[] servers, string user) { return user ~ servers[0]; } void main() { auto servers = ["s1", "s2", "s3"]; auto users = ["u1", "u2", "u3"]; writeln(map!(user => servers.doSomething(user))(users)); wri

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: Yes, I know this is a question lacking a straightforward answer. Requirements: [...] sciter, of course. https://sciter.com/ Or write Dlang alternative.

Re: Compiler Explorer Assembly Output for C, C++ and D (dlang)

2021-05-27 Thread Dennis via Digitalmars-d-learn
On Thursday, 27 May 2021 at 08:47:50 UTC, Tariq Siddiqui wrote: - What are these additional lines? D generates extra symbols per module for things like module constructors, unittests and class introspection (I think). - How can I remove these lines from being generated? Pass the `-bette

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread btiffin via Digitalmars-d-learn
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: Yes, I know this is a question lacking a straightforward answer. I'm only on a third serious with D day, but I want to take a kick at wrapping libAgar now. libagar is a nice little framework. But, it's C still (and Ada, Perl, COBOL),

Compiler Explorer Assembly Output for C, C++ and D (dlang)

2021-05-27 Thread Tariq Siddiqui via Digitalmars-d-learn
When using Compiler Explorer (https://godbolt.org/) to compare assembly output of simple programs, why D language assembly output is so long compared to C or C++ output. The simple square function output is the same for C, C++, and D, but the D output has additional lines that are not highlight

multiple windows dlls results in "entry point could not be located" depending on order

2021-05-27 Thread cartland via Digitalmars-d-learn
I have built 2 windows C dlls (ctst and ctst2) that I am calling from a Dlang exe (dtstx). dumpbin shows the exports. dpp was used to generate the d file from #includes. All this works perfectly on Linux and MacOS. (Are the generated d files portable? They seem to be. I have also generated th

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread zjh via Digitalmars-d-learn
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: Yes, I have download FOX.and success compile. I think it is very good.small and beauty.

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 27 May 2021 at 04:01:31 UTC, someone wrote: On Thursday, 27 May 2021 at 02:55:14 UTC, Adam D. Ruppe wrote: [...] Crystal clear. On Thursday, 27 May 2021 at 02:55:14 UTC, Adam D. Ruppe wrote: [...] No. It doesn't amuse me at all. X11 was/is a wonder in many respects. The probl