RFC: std.uuid

2011-12-22 Thread Johannes Pfau
I've finished the port of boost.uuid to D and I'd hope to get some initial feedback. Quoting the module documentation: This is a port of boost.uuid from the boost project with some minor additions and API changes for a more D-like API. A UUID, or Universally unique identifier, is intended to un

Re: RFC: std.uuid

2011-12-22 Thread Vladimir Panteleev
On Thursday, 22 December 2011 at 23:12:07 UTC, Johannes Pfau wrote: There's one special thing about this module: It uses the ragel (http://www.complang.org/ragel/) state machine compiler. I hope this is not a problem for phobos, ragel doesn't introduce any runtime dependencies and has no effect

Re: RFC: std.uuid

2011-12-22 Thread Johannes Pfau
Vladimir Panteleev wrote: > On Thursday, 22 December 2011 at 23:12:07 UTC, Johannes Pfau > wrote: >> There's one special thing about this module: It uses the ragel >> (http://www.complang.org/ragel/) state machine compiler. I hope >> this is not a problem for phobos, ragel doesn't introduce any >>

Re: RFC: std.uuid

2011-12-22 Thread Vladimir Panteleev
On Thursday, 22 December 2011 at 23:30:06 UTC, Johannes Pfau wrote: Vladimir Panteleev wrote: On Thursday, 22 December 2011 at 23:12:07 UTC, Johannes Pfau wrote: There's one special thing about this module: It uses the ragel (http://www.complang.org/ragel/) state machine compiler. I hope thi

Re: RFC: std.uuid

2011-12-22 Thread Andrei Alexandrescu
On 12/22/11 5:38 PM, Vladimir Panteleev wrote: On Thursday, 22 December 2011 at 23:30:06 UTC, Johannes Pfau wrote: Vladimir Panteleev wrote: On Thursday, 22 December 2011 at 23:12:07 UTC, Johannes Pfau wrote: There's one special thing about this module: It uses the ragel (http://www.complang.

Re: RFC: std.uuid

2011-12-23 Thread Johannes Pfau
Andrei Alexandrescu wrote: > On 12/22/11 5:38 PM, Vladimir Panteleev wrote: >> Using 3rd-party technology such as source preprocessors makes future >> contributions more difficult for the vast majority. Considering that the >> language provides nearly the same thing as a fully-supported feature I

Re: RFC: std.uuid

2011-12-23 Thread Andrei Alexandrescu
On 12/23/11 2:40 AM, Johannes Pfau wrote: Andrei Alexandrescu wrote: On 12/22/11 5:38 PM, Vladimir Panteleev wrote: Using 3rd-party technology such as source preprocessors makes future contributions more difficult for the vast majority. Considering that the language provides nearly the same th

Re: RFC: std.uuid

2011-12-23 Thread Johannes Pfau
Andrei Alexandrescu wrote: > On 12/23/11 2:40 AM, Johannes Pfau wrote: >> Andrei Alexandrescu wrote: >> >>> On 12/22/11 5:38 PM, Vladimir Panteleev wrote: Using 3rd-party technology such as source preprocessors makes future contributions more difficult for the vast majority. Considering

Re: RFC: std.uuid

2011-12-23 Thread Piotr Szturmaj
Johannes Pfau wrote: I've finished the port of boost.uuid to D and I'd hope to get some initial feedback. Very nice. I will need UUIDs in one of my D projects :) This module also depends on Piotr Szturmaj's crypto library to generate level 3&5 UUIDS. The code for this is written, but wouldn't

Re: RFC: std.uuid

2011-12-23 Thread Johannes Pfau
Piotr Szturmaj wrote: > Johannes Pfau wrote: >> I've finished the port of boost.uuid to D and I'd hope to get some >> initial feedback. > > Very nice. I will need UUIDs in one of my D projects :) > >> This module also depends on Piotr Szturmaj's crypto library to generate >> level 3&5 UUIDS. The

Re: RFC: std.uuid

2011-12-23 Thread Johannes Pfau
Vladimir Panteleev wrote: > On Thursday, 22 December 2011 at 23:12:07 UTC, Johannes Pfau > wrote: >> There's one special thing about this module: It uses the ragel >> (http://www.complang.org/ragel/) state machine compiler. I hope >> this is not a problem for phobos, ragel doesn't introduce any >>

Re: RFC: std.uuid

2011-12-23 Thread Piotr Szturmaj
Johannes Pfau wrote: Related question to the SHA/MD5 hash functions: could those be pure? Weakly pure, yes - but for what?. Btw. I just gave a try at compile time evaluation of these hashes. I got rid of memcpy but then endianness issues arise. According to CTFE docs: "non-portable casts (e

Re: RFC: std.uuid

2011-12-23 Thread Jonathan M Davis
On Friday, December 23, 2011 23:09:32 Piotr Szturmaj wrote: > Johannes Pfau wrote: > > Related question to the SHA/MD5 hash functions: could those be pure? > > Weakly pure, yes - but for what? In general, if a function _can_ be pure, it _should_ be pure. If it can be and it isn't, it artificiall

Re: RFC: std.uuid

2011-12-23 Thread Piotr Szturmaj
Jonathan M Davis wrote: On Friday, December 23, 2011 23:09:32 Piotr Szturmaj wrote: Johannes Pfau wrote: Related question to the SHA/MD5 hash functions: could those be pure? Weakly pure, yes - but for what? In general, if a function _can_ be pure, it _should_ be pure. If it can be and it is

Re: RFC: std.uuid

2011-12-23 Thread Jonathan M Davis
On Saturday, December 24, 2011 01:31:46 Piotr Szturmaj wrote: > Yes, Johannes probably want to mark uuid hash gen as pure. I just wanted > to know if its something important as my code used memcpy which is impure. We really need to find a way for the C memory functions to be considered pure like

Re: RFC: std.uuid

2011-12-24 Thread Vladimir Panteleev
On Saturday, 24 December 2011 at 00:31:43 UTC, Piotr Szturmaj wrote: Jonathan M Davis wrote: On Friday, December 23, 2011 23:09:32 Piotr Szturmaj wrote: Johannes Pfau wrote: Related question to the SHA/MD5 hash functions: could those be pure? Weakly pure, yes - but for what? In general, if

Re: RFC: std.uuid

2011-12-24 Thread Piotr Szturmaj
Vladimir Panteleev wrote: On Saturday, 24 December 2011 at 00:31:43 UTC, Piotr Szturmaj wrote: Jonathan M Davis wrote: On Friday, December 23, 2011 23:09:32 Piotr Szturmaj wrote: Johannes Pfau wrote: Related question to the SHA/MD5 hash functions: could those be pure? Weakly pure, yes - but

Re: RFC: std.uuid

2011-12-24 Thread Vladimir Panteleev
On Sunday, 25 December 2011 at 01:08:04 UTC, Piotr Szturmaj wrote: Where does your code use memcpy? I see one mention in the comments, but none in the code. See putArray() in base.d Sorry, I lost track of the conversation. I was looking at uuid.d. Anyway, I believe you can do without memcpy

Re: RFC: std.uuid

2011-12-24 Thread Vladimir Panteleev
On Sunday, 25 December 2011 at 01:08:04 UTC, Piotr Szturmaj wrote: Anyway, I believe you can do without memcpy by using array copy? Array copy might even be faster, since memcpy is not a DMD compiler intrinsic like in many C/C++ compilers. I converted memcpy calls to array copy but it become

Re: RFC: std.uuid

2011-12-26 Thread Piotr Szturmaj
Vladimir Panteleev wrote: On Sunday, 25 December 2011 at 01:08:04 UTC, Piotr Szturmaj wrote: Anyway, I believe you can do without memcpy by using array copy? Array copy might even be faster, since memcpy is not a DMD compiler intrinsic like in many C/C++ compilers. I converted memcpy calls to

Re: RFC: std.uuid

2011-12-28 Thread Vladimir Panteleev
On Monday, 26 December 2011 at 17:37:17 UTC, Piotr Szturmaj wrote: Yes. Here are the results: http://pastebin.com/rD8kiaQy. This is observed only with Windows DMD. I'd be more interested in seeing the code. I've done some more research on this. In release builds, DMD on Windows emits a memcpy

Re: RFC: std.uuid

2012-01-06 Thread Piotr Szturmaj
Vladimir Panteleev wrote: On Monday, 26 December 2011 at 17:37:17 UTC, Piotr Szturmaj wrote: Yes. Here are the results: http://pastebin.com/rD8kiaQy. This is observed only with Windows DMD. I'd be more interested in seeing the code. Sorry for late answer. For memcpy cases code is the same as

Re: RFC: std.uuid

2012-01-06 Thread Vladimir Panteleev
On Friday, 6 January 2012 at 21:10:50 UTC, Piotr Szturmaj wrote: Vladimir Panteleev wrote: On Monday, 26 December 2011 at 17:37:17 UTC, Piotr Szturmaj wrote: Yes. Here are the results: http://pastebin.com/rD8kiaQy. This is observed only with Windows DMD. I'd be more interested in seeing the