Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Paulo Pinto
On Thursday, 9 January 2014 at 07:07:29 UTC, Walter Bright wrote: On 1/8/2014 10:11 PM, Manu wrote: On 9 January 2014 13:08, Walter Bright > wrote: The reason that Java does excessive amounts of allocation is because Java doesn't have value types, not becaus

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Ola Fosheim Grøstad
On Thursday, 9 January 2014 at 07:07:29 UTC, Walter Bright wrote: and it works without copying in D, it just returns s1. In C, I gotta copy, ALWAYS. Only if you write libraries, in an application you can set your own policies (invariants). (C's strings being 0 terminated also forces much ext

Re: Uninstall deletes user created folders too

2014-01-09 Thread eles
On Thursday, 9 January 2014 at 07:11:21 UTC, Brad Anderson wrote: On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote: exact list and we don't have that at the moment. why not create the list during the installation? just scan the archive or whatever to find out the files that are to

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Paulo Pinto
On Thursday, 9 January 2014 at 08:40:30 UTC, Ola Fosheim Grøstad wrote: On Thursday, 9 January 2014 at 07:07:29 UTC, Walter Bright wrote: and it works without copying in D, it just returns s1. In C, I gotta copy, ALWAYS. Only if you write libraries, in an application you can set your own poli

Re: [RFC] I/O and Buffer Range

2014-01-09 Thread Brian Schott
My experimental lexer generator now uses the buffer range. https://github.com/Hackerpilot/Dscanner/tree/NewLexer/stdx The problem that I have with it right now is that range.lookbehind(1).length != range.lookahead(1).length. This was confusing.

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Ola Fosheim Grøstad
On Thursday, 9 January 2014 at 09:10:07 UTC, Paulo Pinto wrote: I have only seen those things work in small AAA class teams. But you have probably seen c programs allocate a bunch of different small structs with a single malloc where it is known that they will be freed in the same location? A

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Paulo Pinto
On Thursday, 9 January 2014 at 09:38:31 UTC, Ola Fosheim Grøstad wrote: On Thursday, 9 January 2014 at 09:10:07 UTC, Paulo Pinto wrote: I have only seen those things work in small AAA class teams. But you have probably seen c programs allocate a bunch of different small structs with a single

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Walter Bright
On 1/9/2014 1:38 AM, "Ola Fosheim Grøstad" " wrote: On Thursday, 9 January 2014 at 09:10:07 UTC, Paulo Pinto wrote: I have only seen those things work in small AAA class teams. But you have probably seen c programs allocate a bunch of different small structs with a single malloc where it is kn

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Walter Bright
On 1/9/2014 12:40 AM, "Ola Fosheim Grøstad" " wrote: On Thursday, 9 January 2014 at 07:07:29 UTC, Walter Bright wrote: and it works without copying in D, it just returns s1. In C, I gotta copy, ALWAYS. Only if you write libraries, in an application you can set your own policies (invariants).

Re: Where is contribution most needed to the D community?

2014-01-09 Thread Rikki Cattermole
Added to github. Not ready yet for dub repository addition as I haven't finished with the base subpackage yet. I want odata to be added before then. Maybe something else is required. I'll see. Shouldn't be long though. [0] https://github.com/rikkimax/Cmsed

rdmd and shebang limits

2014-01-09 Thread Andrea Fontana
I've just discovered that shebang line has a (very short) limit. Only 127 bytes are read from line It means that something like this doesn't work: #!/usr/bin/rdmd --shebang -I/asdasdasdasd/asdasdasdasd/asdasdasdasd -I/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/qweqweqweq

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Ola Fosheim Grøstad
On Thursday, 9 January 2014 at 09:55:42 UTC, Walter Bright wrote: A GC does not prevent such techniques. No, but programmers gravitate towards less work... If alloc is transparent and free is hidden... You gain a lot from not being explicit, but you get more allocations overall.

Re: rdmd and shebang limits

2014-01-09 Thread Andrea Fontana
On Thursday, 9 January 2014 at 11:25:19 UTC, Andrea Fontana wrote: I've just discovered that shebang line has a (very short) limit. Only 127 bytes are read from line It means that something like this doesn't work: #!/usr/bin/rdmd --shebang -I/asdasdasdasd/asdasdasdasd/asdasdasdasd -I/qweqweq

Re: Where is contribution most needed to the D community?

2014-01-09 Thread qznc
On Thursday, 9 January 2014 at 07:45:09 UTC, Kira Backes wrote: Please tell me what you think! :-) 1. If you already have some code, you could refactor some of it into libraries and publish them via Dub aka code.dlang.org. 2. Using Dub, Phobos, DMD-betas, etc you probably find bugs. You can

Re: Graphics Library for D

2014-01-09 Thread Ola Fosheim Grøstad
On Thursday, 9 January 2014 at 02:21:41 UTC, Adam Wilson wrote: Yes, it is supposed to provide 2D and 3D and ideally have both in the same window. Then we should decide what the 2D surface properties are: 1. Are they z-ordered or do we use painters-algorithm (drawing back to front), basically

Re: GuitarHero/RockBand fans... side project anyone?

2014-01-09 Thread John Colvin
On Wednesday, 8 January 2014 at 23:54:16 UTC, Manu wrote: There are lots of parts that can be developed in isolation. For instance, to do vocal or 'pro-guitar' modes, a DSP which can parse an audio stream into a midi sequence with extremely low latency is required... this would be a very intere

Re: rdmd and shebang limits

2014-01-09 Thread Gary Willoughby
On Thursday, 9 January 2014 at 11:42:32 UTC, Andrea Fontana wrote: On Thursday, 9 January 2014 at 11:25:19 UTC, Andrea Fontana wrote: I've just discovered that shebang line has a (very short) limit. Only 127 bytes are read from line It means that something like this doesn't work: #!/usr/bin/r

Re: Uninstall deletes user created folders too

2014-01-09 Thread John Colvin
On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote: The Uninstall on Windows is deleting user created folders too! :( I thought it's a good idea to uninstall the previous version of D before I install the latest one, but when I did that, it deleted the C:\D folder, including the sub-fo

Re: GuitarHero/RockBand fans... side project anyone?

2014-01-09 Thread Manu
On 9 January 2014 22:21, John Colvin wrote: > On Wednesday, 8 January 2014 at 23:54:16 UTC, Manu wrote: > >> There are lots of parts that can be developed in isolation. For instance, >> to do vocal or 'pro-guitar' modes, a DSP which can parse an audio stream >> into a midi sequence with extremely

Re: Uninstall deletes user created folders too

2014-01-09 Thread Orvid King
On 1/9/14, John Colvin wrote: > On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote: >> The Uninstall on Windows is deleting user created folders too! >> :( >> >> I thought it's a good idea to uninstall the previous version of >> D before I install the latest one, but when I did that, it >>

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Ola Fosheim Grøstad
On Thursday, 9 January 2014 at 10:14:08 UTC, Benjamin Thaut wrote: If requested I can make a list with all language features / decisions so far that prevent the implementation of a state of the art GC. I am also interested in this, so that I can avoid those constructs. I am in general in ag

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Paulo Pinto
On Thursday, 9 January 2014 at 13:44:10 UTC, Ola Fosheim Grøstad wrote: On Thursday, 9 January 2014 at 10:14:08 UTC, Benjamin Thaut wrote: If requested I can make a list with all language features / decisions so far that prevent the implementation of a state of the art GC. I am also intereste

Should this work?

2014-01-09 Thread Manu
This works fine: string x = find("Hello", 'H'); This doesn't: string y = find(retro("Hello"), 'H'); > Error: cannot implicitly convert expression (find(retro("Hello"), 'H')) of type Result!() to string Is that wrong? That seems to be how the docs suggest it should be used. On a side note,

Re: Should this work?

2014-01-09 Thread Tobias Pankrath
On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: Is that wrong? That seems to be how the docs suggest it should be used. -- string s = find(retro("Hello"), "H").source; -- Is that working?

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Ola Fosheim Grøstad
On Thursday, 9 January 2014 at 13:51:09 UTC, Paulo Pinto wrote: That could possibly be achieved with a generational parallel GC. Isn't the basic assumption in a generational GC that most free'd objects has a short life span and happened since the last collection? Was there some assumption ab

Re: Should this work?

2014-01-09 Thread Tobias Pankrath
On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: This works fine: string x = find("Hello", 'H'); This doesn't: string y = find(retro("Hello"), 'H'); > Error: cannot implicitly convert expression (find(retro("Hello"), 'H')) of type Result!() to string Is that wrong? That seems to

Re: Should this work?

2014-01-09 Thread Manu
On 10 January 2014 00:19, Tobias Pankrath wrote: > On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: > >> >> Is that wrong? That seems to be how the docs suggest it should be used. >> >> > -- > string s = find(retro("Hello"), "H").source; > -- > Is that working? > If I have to type that,

Re: Uninstall deletes user created folders too

2014-01-09 Thread John Colvin
On Thursday, 9 January 2014 at 13:28:46 UTC, Orvid King wrote: On 1/9/14, John Colvin wrote: On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote: The Uninstall on Windows is deleting user created folders too! :( I thought it's a good idea to uninstall the previous version of D before

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Paulo Pinto
On Thursday, 9 January 2014 at 14:19:41 UTC, Ola Fosheim Grøstad wrote: On Thursday, 9 January 2014 at 13:51:09 UTC, Paulo Pinto wrote: That could possibly be achieved with a generational parallel GC. Isn't the basic assumption in a generational GC that most free'd objects has a short life sp

Re: Should this work?

2014-01-09 Thread John Colvin
On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: This works fine: string x = find("Hello", 'H'); This doesn't: string y = find(retro("Hello"), 'H'); > Error: cannot implicitly convert expression (find(retro("Hello"), 'H')) of type Result!() to string In order to return the resu

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Benjamin Thaut
Am 09.01.2014 15:28, schrieb "Ola Fosheim Grøstad" ": And, if it isn't in D already I would very much like to have a weak pointer type that will be set to null if the object is only pointed to by weak pointers. It is a PITA to have objects die and get them out of a bunch of event-queues etc. D

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Ola Fosheim Grøstad
On Thursday, 9 January 2014 at 14:40:16 UTC, Paulo Pinto wrote: On a game you might miss a few rendering frames, a GC induced delay on a missile tracking system might turn out a bit ugly. You have GC in games, but you limit it to a small set of objects (<5?) So you can have real time with

Re: Should this work?

2014-01-09 Thread Marco Leise
Am Fri, 10 Jan 2014 00:33:28 +1000 schrieb Manu : > On 10 January 2014 00:19, Tobias Pankrath wrote: > > > On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: > > > >> > >> Is that wrong? That seems to be how the docs suggest it should be used. > >> > >> > > -- > > string s = find(retro("He

Phobos .pdb file included in build?

2014-01-09 Thread Manu
Is it possible to include the druntime and phobos debug builds with the windows DMD distro in the future? Maybe phobos_d.lib and druntime_d.lib? MS provide debug versions of their libs, and it can be very helpful. It's really annoying to debug problems extending from the standard libraries without

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Klaim - Joël Lamotte
On Thu, Jan 9, 2014 at 7:11 AM, Manu wrote: > You're making a keen assumption here that C programmers use STL. And no > sane programmer that I've ever worked with uses STL precisely for this > reason :P I think this sentence is misleading. I've made high performance application with no copy wit

Re: Should this work?

2014-01-09 Thread Manu
On 10 January 2014 00:34, John Colvin wrote: > On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: > >> This works fine: >> string x = find("Hello", 'H'); >> >> This doesn't: >> string y = find(retro("Hello"), 'H'); >> > Error: cannot implicitly convert expression (find(retro("Hello"),

Re: Uninstall deletes user created folders too

2014-01-09 Thread Marco Leise
Am Thu, 09 Jan 2014 09:12:30 + schrieb "eles" : > On Thursday, 9 January 2014 at 07:11:21 UTC, Brad Anderson wrote: > > On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote: > > > exact list and we don't have that at the moment. > > why not create the list during the installation? just

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Paulo Pinto
On Thursday, 9 January 2014 at 14:57:31 UTC, Ola Fosheim Grøstad wrote: On Thursday, 9 January 2014 at 14:40:16 UTC, Paulo Pinto wrote: On a game you might miss a few rendering frames, a GC induced delay on a missile tracking system might turn out a bit ugly. You have GC in games, but you limi

Re: Should this work?

2014-01-09 Thread Manu
On 10 January 2014 01:04, Marco Leise wrote: > Am Fri, 10 Jan 2014 00:33:28 +1000 > schrieb Manu : > > > On 10 January 2014 00:19, Tobias Pankrath wrote: > > > > > On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: > > > > > >> > > >> Is that wrong? That seems to be how the docs suggest it

Re: Should this work?

2014-01-09 Thread John Colvin
On Thursday, 9 January 2014 at 15:14:04 UTC, Manu wrote: However, I think to get the expected result from unicode you need string y = "Hello".byGrapheme.retro.find('H').to!string; but I might be wrong. Bugger that. This is not an example of "D is good at strings!". Agreed. std.range and s

Re: Should this work?

2014-01-09 Thread Kira Backes
On Thursday, 9 January 2014 at 14:25:20 UTC, Benjamin Thaut wrote: The best example in D is the deprection of indexOf. Now you have to call countUntil. But if I have to choose between the two names, indexOf actually tells me what it does, while countUntil does not. count until what? std.algo

Is the D tools repository Boost licensed ?

2014-01-09 Thread Marco Leise
I want to package them and need to know if the license for the whole repository is and will be Boost? E.g. does someone check new contributions for their license, so we can write a package description once and forget about it? -- Marco

Re: Should this work?

2014-01-09 Thread John Colvin
On Thursday, 9 January 2014 at 14:34:43 UTC, John Colvin wrote: On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: This works fine: string x = find("Hello", 'H'); This doesn't: string y = find(retro("Hello"), 'H'); > Error: cannot implicitly convert expression (find(retro("Hello"), 'H

Re: Is the D tools repository Boost licensed ?

2014-01-09 Thread Marco Leise
Am Thu, 9 Jan 2014 16:29:28 +0100 schrieb Marco Leise : > I want to package them and need to know if the license for the > whole repository is and will be Boost? E.g. does someone check > new contributions for their license, so we can write a package > description once and forget about it? Thank

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Jesse Phillips
On Thursday, 9 January 2014 at 00:37:27 UTC, Atila Neves wrote: Thanks. Not many votes though given all the downvotes. The comments manage to be even worse than on my first blog post. For some reason they all assume I don't know C++ even though I know it way better than D, not to mention that

Re: Is the D tools repository Boost licensed ?

2014-01-09 Thread Dicebot
On Thursday, 9 January 2014 at 15:32:21 UTC, Marco Leise wrote: Am Thu, 9 Jan 2014 16:29:28 +0100 schrieb Marco Leise : I want to package them and need to know if the license for the whole repository is and will be Boost? E.g. does someone check new contributions for their license, so we can wr

Re: Graphics Library for D

2014-01-09 Thread ttt
http://libagar.org/index.html.en

Re: Uninstall deletes user created folders too

2014-01-09 Thread John J
On 01/09/2014 10:07 AM, Marco Leise wrote: Why not use an installer that has this functionality built in? I would have thought that this is basic stuff for any installer. Inno Setup has pretty good support for this kind of things and a lot more.. http://www.jrsoftware.org/isinfo.php

Re: Should this work?

2014-01-09 Thread Marco Leise
Am Fri, 10 Jan 2014 01:20:26 +1000 schrieb Manu : > Awesome! Although it looks like you still have a lot of work ahead of you :) So... when was std.simd going to be in Phobos again? :p -- Marco

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread H. S. Teoh
On Thu, Jan 09, 2014 at 08:40:29AM +, digitalmars-d-boun...@puremagic.com wrote: > On Thursday, 9 January 2014 at 07:07:29 UTC, Walter Bright wrote: > >and it works without copying in D, it just returns s1. In C, I > >gotta copy, ALWAYS. > > Only if you write libraries, in an application you

Re: Should this work?

2014-01-09 Thread Dicebot
On Thursday, 9 January 2014 at 15:14:04 UTC, Manu wrote: However, I think to get the expected result from unicode you need string y = "Hello".byGrapheme.retro.find('H').to!string; but I might be wrong. Bugger that. This is not an example of "D is good at strings!". I have 0 ideas how are

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread bearophile
H. S. Teoh: One thing I miss in D is a nice way to allocate structs with a variable-length "static" array at the end. GCC supports this, probably as an extension (I don't remember if the C standard specifies this). I know I can just manually allocate this via core.gc and casts, but a built-in

Re: Should this work?

2014-01-09 Thread Manu
On 10 January 2014 01:56, Marco Leise wrote: > Am Fri, 10 Jan 2014 01:20:26 +1000 > schrieb Manu : > > > Awesome! Although it looks like you still have a lot of work ahead of > you :) > > So... when was std.simd going to be in Phobos again? :p > When there are a zillion unit tests >_< And I kind

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread H. S. Teoh
On Thu, Jan 09, 2014 at 09:49:15AM +, Paulo Pinto wrote: > On Thursday, 9 January 2014 at 09:38:31 UTC, Ola Fosheim Grøstad > wrote: > >On Thursday, 9 January 2014 at 09:10:07 UTC, Paulo Pinto wrote: > >>I have only seen those things work in small AAA class teams. > > > >But you have probably s

Re: Should this work?

2014-01-09 Thread Manu
On 10 January 2014 02:05, Dicebot wrote: > On Thursday, 9 January 2014 at 15:14:04 UTC, Manu wrote: > >> However, I think to get the expected result from unicode you need >> >>> >>> string y = "Hello".byGrapheme.retro.find('H').to!string; >>> >>> but I might be wrong. >>> >>> >> Bugger that. This

Re: Should this work?

2014-01-09 Thread Marco Leise
Am Thu, 09 Jan 2014 15:20:13 + schrieb "John Colvin" : > On Thursday, 9 January 2014 at 14:34:43 UTC, John Colvin wrote: > > On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: > >> This works fine: > >> string x = find("Hello", 'H'); > >> > >> This doesn't: > >> string y = find(retro("

Re: Uninstall deletes user created folders too

2014-01-09 Thread Vladimir Panteleev
On Thursday, 9 January 2014 at 15:07:02 UTC, Marco Leise wrote: Why not use an installer that has this functionality built in? I would have thought that this is basic stuff for any installer. As I understand, the compiler is not included in the installer - the installer downloads a ZIP file wi

Two versions of library reference on this page

2014-01-09 Thread Kira Backes
http://dlang.org/phobos/index.html http://dlang.org/phobos/phobos.html The second one seems to be older, it confused me kind of a bit when I found std.gc in the latter and later on did not find it again in the former. PS: Besides posts in this forum/group, is there a way to contribute to th

Re: Two versions of library reference on this page

2014-01-09 Thread Dicebot
On Thursday, 9 January 2014 at 16:36:53 UTC, Kira Backes wrote: PS: Besides posts in this forum/group, is there a way to contribute to this page and the documentation directly? By submitting pull requests to https://github.com/D-Programming-Language/dlang.org

Re: Should this work?

2014-01-09 Thread Marco Leise
Am Fri, 10 Jan 2014 02:21:35 +1000 schrieb Manu : > On 10 January 2014 01:56, Marco Leise wrote: > > > Am Fri, 10 Jan 2014 01:20:26 +1000 > > schrieb Manu : > > > > > Awesome! Although it looks like you still have a lot of work ahead of > > you :) > > > > So... when was std.simd going to be in P

Re: Should this work?

2014-01-09 Thread Dicebot
On Thursday, 9 January 2014 at 16:22:08 UTC, Manu wrote: It's nice that it's unicode correct, but it's not nice that you have to be familiar with a massive amount of the standard library and you need to search through 4-5 (huge! and often poorly documented) modules to find the functions you nee

Re: Should this work?

2014-01-09 Thread Regan Heath
On Thu, 09 Jan 2014 17:15:41 -, Regan Heath wrote: In other words, why can't we alias or wrap the generic routines in std.string What I meant here is why can't we alias or wrap the generic routines (from std.range, std.algo.. into aliases/functions) in std.string. R -- Using Opera

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Walter Bright
On 1/9/2014 3:40 AM, "Ola Fosheim Grøstad" " wrote: On Thursday, 9 January 2014 at 09:55:42 UTC, Walter Bright wrote: A GC does not prevent such techniques. No, but programmers gravitate towards less work... If alloc is transparent and free is hidden... You gain a lot from not being explicit,

Re: Should this work?

2014-01-09 Thread Manu
On 10 January 2014 02:36, Dicebot wrote: > On Thursday, 9 January 2014 at 16:22:08 UTC, Manu wrote: > >> It's nice that it's unicode correct, but it's not nice that you have to be >> familiar with a massive amount of the standard library and you need to >> search through 4-5 (huge! and often poor

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Walter Bright
On 1/9/2014 2:46 AM, "Ola Fosheim Grøstad" " wrote: On Thursday, 9 January 2014 at 09:58:24 UTC, Walter Bright wrote: Please explain how this can work passing both string literals and allocated strings to cat(). By having your own string allocator that tests for membership when you free (if yo

Re: Should this work?

2014-01-09 Thread Regan Heath
On Thu, 09 Jan 2014 14:07:36 -, Manu wrote: This works fine: string x = find("Hello", 'H'); This doesn't: string y = find(retro("Hello"), 'H'); > Error: cannot implicitly convert expression (find(retro("Hello"), 'H')) of type Result!() to string Is that wrong? That seems to be how

Re: Should this work?

2014-01-09 Thread Manu
On 10 January 2014 03:17, Regan Heath wrote: > On Thu, 09 Jan 2014 17:15:41 -, Regan Heath > wrote: > > In other words, why can't we alias or wrap the generic routines in >> std.string >> > > What I meant here is why can't we alias or wrap the generic routines (from > std.range, std.algo..

Re: Should this work?

2014-01-09 Thread Dicebot
On Thursday, 9 January 2014 at 17:21:11 UTC, Manu wrote: money!) even when that's not a requirement. I'm dealing with ascii right now. Then first (and mandatory) thing to do is stop using `string` type and switch to `ubyte[]` (or wrapper from std.ascii) Second thing to do then will be to co

Re: Should this work?

2014-01-09 Thread Adam D. Ruppe
On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: string y = find(retro("Hello"), 'H'); import std.string; auto idx = lastIndexOf("Hello", 'H'); Wow, that's unbelievable difficult. D sucks.

Re: Should this work?

2014-01-09 Thread John Colvin
On Thursday, 9 January 2014 at 17:39:00 UTC, Adam D. Ruppe wrote: On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: string y = find(retro("Hello"), 'H'); import std.string; auto idx = lastIndexOf("Hello", 'H'); Wow, that's unbelievable difficult. D sucks. How on earth did I miss tha

Re: Should this work?

2014-01-09 Thread Dicebot
On Thursday, 9 January 2014 at 17:39:00 UTC, Adam D. Ruppe wrote: On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: string y = find(retro("Hello"), 'H'); import std.string; auto idx = lastIndexOf("Hello", 'H'); Wow, that's unbelievable difficult. D sucks. It is not the same thing as

Re: Should this work?

2014-01-09 Thread Dmitry Olshansky
09-Jan-2014 21:38, Adam D. Ruppe пишет: On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: string y = find(retro("Hello"), 'H'); import std.string; auto idx = lastIndexOf("Hello", 'H'); Wow, that's unbelievable difficult. D sucks. +1 LOL -- Dmitry Olshansky

Re: Uninstall deletes user created folders too

2014-01-09 Thread Brad Anderson
On Thursday, 9 January 2014 at 16:34:53 UTC, Vladimir Panteleev wrote: On Thursday, 9 January 2014 at 15:07:02 UTC, Marco Leise wrote: Why not use an installer that has this functionality built in? I would have thought that this is basic stuff for any installer. As I understand, the compiler i

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Benjamin Thaut
Am 09.01.2014 11:36, schrieb Tobias Pankrath: On Thursday, 9 January 2014 at 10:14:08 UTC, Benjamin Thaut wrote: If requested I can make a list with all language features / decisions so far that prevent the implementation of a state of the art GC. At least I am interested in your observations.

Re: Uninstall deletes user created folders too

2014-01-09 Thread Brad Anderson
On Thursday, 9 January 2014 at 09:12:31 UTC, eles wrote: On Thursday, 9 January 2014 at 07:11:21 UTC, Brad Anderson wrote: On Thursday, 9 January 2014 at 06:50:56 UTC, John J wrote: exact list and we don't have that at the moment. why not create the list during the installation? just scan t

Re: Graphics Library for D

2014-01-09 Thread Steve Teale
On Monday, 6 January 2014 at 07:30:25 UTC, Joakim wrote: On Monday, 6 January 2014 at 04:17:21 UTC, Walter Bright wrote: On 1/5/2014 8:10 PM, Adam Wilson wrote: Recently, I've been working to evaluate the feasibility and reasonability of building out a binding to Cinder in D. For reference,

Re: Uninstall deletes user created folders too

2014-01-09 Thread Brad Anderson
On Thursday, 9 January 2014 at 12:29:54 UTC, John Colvin wrote: This is the second time this has come up. While I agree that leaving the D folder intact would be a safe default, it still seems weird that anyone would put anything irreplaceable in that folder. In my mind I always saw it as the e

Re: Should this work?

2014-01-09 Thread Adam D. Ruppe
On Thursday, 9 January 2014 at 17:54:05 UTC, Dicebot wrote: It is not the same thing as sample with byGrapheme though. Right, but it works for ascii (and others) and shows std.string isn't as weak as being said in this thread.

Re: Uninstall deletes user created folders too

2014-01-09 Thread Brad Anderson
On Thursday, 9 January 2014 at 13:28:46 UTC, Orvid King wrote: I keep my git head version of D, and consequentially, my single-click update & build script, in my C:\D folder, and I think that it is the best place to put it. I keep mine in C:\D-git with an identical directory structure as C:\

ARM support

2014-01-09 Thread Piotr Szturmaj
Hello, I'm developing embedded system product on ARM9/Linux platform and I wish I could use D and vibe.d for this task. I have couple of questions in this matter: - What is the current status of ARM support? - Does GDC support cross-compiling to ARM? - Is it possible to remote-debug D code on

Re: Hitchikers Guide to Porting Phobos / D Runtime to other architectures

2014-01-09 Thread Sean Kelly
On Wednesday, 8 January 2014 at 01:27:28 UTC, Walter Bright wrote: On 1/6/2014 3:47 AM, Dwhatever wrote: Compared to C/C++, D is very hard to get to work in the embedded/OS less environment because of this. It's not that hard. Use the -betterC switch to prevent ModuleInfo records and their de

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Ola Fosheim Grøstad
On Thursday, 9 January 2014 at 17:15:46 UTC, Walter Bright wrote: How does that work when you pass it "hello"? allocated with malloc()? basically any data that has mixed ancestry? Why would you do that? You would have to overload cat then. Note that your code doesn't always have control over t

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Ola Fosheim Grøstad
On Thursday, 9 January 2014 at 17:17:53 UTC, Walter Bright wrote: GC doesn't even make those techniques harder. I can't see any merit to the idea that GC makes for excessive allocation. People do what they are accustomed to and what is easy. Library writers are more likely to do allocation f

Re: Should this work?

2014-01-09 Thread Brad Anderson
On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote: This works fine: string x = find("Hello", 'H'); This doesn't: string y = find(retro("Hello"), 'H'); > Error: cannot implicitly convert expression (find(retro("Hello"), 'H')) of type Result!() to string Is that wrong? That seems to

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Walter Bright
On 1/9/2014 10:18 AM, "Ola Fosheim Grøstad" " wrote: On Thursday, 9 January 2014 at 17:15:46 UTC, Walter Bright wrote: How does that work when you pass it "hello"? allocated with malloc()? basically any data that has mixed ancestry? Why would you do that? You would have to overload cat then.

Re: Hitchikers Guide to Porting Phobos / D Runtime to other architectures

2014-01-09 Thread Sean Kelly
On Wednesday, 8 January 2014 at 02:54:40 UTC, Mike wrote: On Wednesday, 8 January 2014 at 01:27:28 UTC, Walter Bright wrote: It's not that hard. Use the -betterC switch to prevent ModuleInfo records and their dependencies from being emitted, and then you can write D code that has zero depende

baseName(path).startsWith(something)

2014-01-09 Thread Martin Nowak
Neither this if (path.baseName.startsWith(something)) doThis(); nor this if (startsWith(baseName(path), something)) doThis(); but a combination of the two if (baseName(path).startsWith(something)) doThis(); make it possible to write readable sentences. -Martin

Re: Should this work?

2014-01-09 Thread Craig Dillabaugh
On Thursday, 9 January 2014 at 17:15:43 UTC, Regan Heath wrote: clip In other words, why can't we alias or wrap the generic routines in std.string such that the expected operations are easy to find and do exactly what you'd expect, for strings. If someone is dealing with generic code where

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Sean Kelly
On Wednesday, 8 January 2014 at 19:17:08 UTC, H. S. Teoh wrote: On Wed, Jan 08, 2014 at 11:35:19AM +, Atila Neves wrote: http://atilanevesoncode.wordpress.com/2014/01/08/adding-java-and-c-to-the-mqtt-benchmarks-or-how-i-learned-to-stop-worrying-and-love-the-garbage-collector/ I have to say

Re: Should this work?

2014-01-09 Thread Adam D. Ruppe
On Thursday, 9 January 2014 at 18:57:26 UTC, Craig Dillabaugh wrote: A while ago I was trying to do something with splitter on a string and I ended up asking a question on D.learn. [...] It would be nice if std.string in D provided a nice, easy, string manipulation that swept most of the diffi

Re: baseName(path).startsWith(something)

2014-01-09 Thread monarch_dodra
On Thursday, 9 January 2014 at 18:53:58 UTC, Martin Nowak wrote: Neither this if (path.baseName.startsWith(something)) doThis(); nor this if (startsWith(baseName(path), something)) doThis(); but a combination of the two if (baseName(path).startsWith(something)) doThis(); make it

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Paulo Pinto
Am 09.01.2014 19:34, schrieb Walter Bright: On 1/9/2014 10:18 AM, "Ola Fosheim Grøstad" " wrote: On Thursday, 9 January 2014 at 17:15:46 UTC, Walter Bright wrote: How does that work when you pass it "hello"? allocated with malloc()? basically any data that has mixed ancestry? Why would you do

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Ola Fosheim Grøstad
On Thursday, 9 January 2014 at 18:34:58 UTC, Walter Bright wrote: On 1/9/2014 10:18 AM, "Ola Fosheim Grøstad" Why would you do that? You would have to overload cat then. So you agree that it won't work. It will work for string literals or for malloc'ed strings, but not for both using the sa

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread H. S. Teoh
On Thu, Jan 09, 2014 at 07:08:42PM +, digitalmars-d-boun...@puremagic.com wrote: > On Thursday, 9 January 2014 at 18:34:58 UTC, Walter Bright wrote: > >On 1/9/2014 10:18 AM, "Ola Fosheim Grøstad" > >>Why would you do that? You would have to overload cat then. > > > >So you agree that it won't

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread H. S. Teoh
On Thu, Jan 09, 2014 at 08:16:12PM +0100, Paulo Pinto wrote: > Am 09.01.2014 19:34, schrieb Walter Bright: > >On 1/9/2014 10:18 AM, "Ola Fosheim Grøstad" > >" wrote: > >>On Thursday, 9 January 2014 at 17:15:46 UTC, Walter Bright wrote: > >>>How does that work when you pass it "hello"? allocated wit

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread H. S. Teoh
On Thu, Jan 09, 2014 at 07:01:59PM +, Sean Kelly wrote: > On Wednesday, 8 January 2014 at 19:17:08 UTC, H. S. Teoh wrote: [...] > >Manual memory management is a LOT of effort, and to be quite > >honest, unless you're writing an AAA 3D game engine, you don't > >*need* that last 5% performance im

Re: Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector

2014-01-09 Thread Paulo Pinto
Am 09.01.2014 20:40, schrieb H. S. Teoh: On Thu, Jan 09, 2014 at 07:01:59PM +, Sean Kelly wrote: On Wednesday, 8 January 2014 at 19:17:08 UTC, H. S. Teoh wrote: [...] Manual memory management is a LOT of effort, and to be quite honest, unless you're writing an AAA 3D game engine, you don't

Re: Phobos .pdb file included in build?

2014-01-09 Thread Jacob Carlborg
On 2014-01-09 16:06, Manu wrote: Is it possible to include the druntime and phobos debug builds with the windows DMD distro in the future? Maybe phobos_d.lib and druntime_d.lib? MS provide debug versions of their libs, and it can be very helpful. It's really annoying to debug problems extending f

Re: rdmd and shebang limits

2014-01-09 Thread Jacob Carlborg
On 2014-01-09 12:25, Andrea Fontana wrote: I've just discovered that shebang line has a (very short) limit. Only 127 bytes are read from line It means that something like this doesn't work: #!/usr/bin/rdmd --shebang -I/asdasdasdasd/asdasdasdasd/asdasdasdasd -I/qweqweqweqwe/qweqweqweqwe/qweqweqw

Re: Uninstall deletes user created folders too

2014-01-09 Thread Jacob Carlborg
On 2014-01-09 18:53, Brad Anderson wrote: Exactly. Just preparing a list wouldn't be terribly hard in most languages but NSIS isn't exactly the easiest scripting language to do just about anything in. You can't call out to an external script? -- /Jacob Carlborg

  1   2   >