Re: Looking for a set that sorts and deduplicates

2017-11-24 Thread cblake
Memory hierarchies since the 1990s have broadened the relevance of 1970s practical wisdom for disk storage. A solid hash table with locality and solid B-Tree often win today. A great stdlib should have both. A more obscure bonus of a B-Tree (when compared to, say, balanced binary trees) is

Re: Copy-on-write container

2017-11-24 Thread mratsim
Ah right, indeed. Well let's say that it's a non-supported use case shrugs and that Arraymancer tensors are the wrong container for that. I'm not aware of any scientific/numerical computing situation with an operation depends not only on the tensor size but also the value of what is wrapped.

Re: atomics: Why is interlockedCompareExchange8 "safe"?

2017-11-24 Thread monster
> No. It means that the object gains a type header that allows for dynamic > dispatch, RTTI, and such. @Jehan Thank you for pointing that out! I thought the {.inheritable.} pragma was the solution to my question, but if it adds a "dynamic dispatch" pointer to the object, than I cannot use it.

Re: Copy-on-write container

2017-11-24 Thread Udiknedormin
@mratsim No, it's not. That's why I asked whenever you use dynamic scheduling. Imagine you have a sequence of 1, 2, 4, 8, ..., 1048576. Now, map it with an operation with O(N) complexity, where N is the value of your number. If you use static scheduling, it's entirely possible most of the work

Hello everyone!

2017-11-24 Thread ethardsdaisy92
My name is Ethards Daisy. I come from New York. I have just registered a acount on this forums. I’m very glad to make friends with everyone. I hope we will help and share together about our knowledge and experiences on this forum. I wish this forum will grow and develop in the future. Have a

Re: atomics: Why is interlockedCompareExchange8 "safe"?

2017-11-24 Thread Jehan
> Does the {.inheritable.} pragma convert an object into a pointer or keep it > as a normal object with copy semantics? No. It means that the object gains a type header that allows for dynamic dispatch, RTTI, and such. > Should the compiler warn that putting an Obj2 into a seq of Obj1 will

atomics: Why is interlockedCompareExchange8 "safe"?

2017-11-24 Thread monster
@coffeepot I _think_ what you pointed out is _by design_. This is also how I would expect it to work. OTOH, I guess a compiler warning in the first case would be good.

Re: Pointer to generic type with unspecified generic parameter?

2017-11-24 Thread coffeepot
Does the {.inheritable.} pragma convert an object into a pointer or keep it as a normal object with copy semantics? Also, something to bear in mind, upon testing this it seems the type is erased when inserting into a seq: (Nim version 0.17.3 2017-10-13) import typetraits

Re: Question about sockets

2017-11-24 Thread euant
Buffered sockets don't work with UDP due to the way that UDP works. Buffering only works with streaming sockets. If you need per-client buffering of data, you need to implement that yourself by determining how to represent each client.

Re: Question about sockets

2017-11-24 Thread dawkot
Oh, well, too bad this proc doesn't support buffered sockets.