Every big program I've designed has been heavily informed by these concepts. The core memory management of I/O of s2n uses all of these ideas .. even though it's written in C. https://github.com/awslabs/s2n/blob/master/docs/DEVELOPMENT-GUIDE.md#a-tour-of-s2n-memory-handling-blobs-and-stuffers …
-
-
His blog post contains a 14 line implementation in C, and there's also a paper getting into it: https://arxiv.org/abs/1805.10941 , so there's great material to start from. But how can we make it more readable and easy to follow for a beginner or non-math-expert? how can we test it?
Show this thread -
Have at it and give it a go! Any programming language you like. Apache Software License so that it can be included in other things. Closing date: September 1st 2019.
Show this thread -
Message me a gist, or a link, or send me an e-mail, whatever works ... and we can talk readability and testing about it too!
Show this thread -
For further reference: here's my rejection sampling RNG implementation with more comments than code. https://github.com/awslabs/s2n/blob/master/utils/s2n_random.c#L182 … End of thread!
Show this thread
End of conversation
New conversation -
-
-
This sounds like fun. Can I blog about your contest?
-
Absolutely!
your algorithm and this is my way of getting more people to see and appreciate it, and despite being so small and simple, it's in the space of "intrinsically challenging to make understandable".
End of conversation
New conversation -
-
-
As I look at the algorithm I wonder: have you thought about a special case for “power-of-2” (which presumably could just use right shift)? If same range is frequently re-used, the shift distance could be memoized...
-
It's a fairly standard optimization and
@lemire mentions it in the paper. In practice though it doesn't work out, it only optimizes 63 values out of 2^64, which is minuscule; the cost of the branch more than undoes that on average.pic.twitter.com/Wg0fQSI79l
- 1 more reply
New conversation -
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.