4 days ago
On 17/09/2025 11:09 PM, Denis Feklushkin wrote:
> On Tuesday, 16 September 2025 at 12:08:38 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> On 17/09/2025 12:04 AM, Denis Feklushkin wrote:
>>> Perhaps this is suitable for Phobos 3?
>>
>> Not for V2.
> 
> ...But why? My proposal does not involve changing to the current API.
> 
> But it will be possible to declare it obsolete later, gradually

I've had a chat with Adam Wilson regarding your question, unfortunately he isn't able to reply right now.

He is the one heading up V3.

The official position is that V2 is on life support, work like this is currently considered out of scope.

As for std.random replacement, first up is cryptography where calls out to systems libraries will be used in place of anything on our end. After which we can revisit non-cryptographic algorithms.

3 days ago

On Wednesday, 17 September 2025 at 09:00:44 UTC, Dmitry Olshansky wrote:

>

To be honest this seems like a major overengineering. It’s a given in a whole lot of languages that random means PRNG with optional seed. The seed could be obtained via some function to be largely unpredictable, with the benefit that you could replay the program with a particular seed to ease debugging / fuzzing etc.

Now of hardware sources most language would provide CryptoRandom which takes the bits from whatever deemed as secure source of random bits, most likely get_random or /dev/urandom (yes it is fine for generating keys, check the literature). Everything else is plain overengineering and deserves to be written in 3rd party library by these willing to pursue it.

Agreed. If anything, std.random is very well designed because it uses the range interface in a clever way.

2 days ago

On Thursday, 18 September 2025 at 12:53:25 UTC, IchorDev wrote:

> >

literature). Everything else is plain overengineering and deserves to be written in 3rd party library by these willing to pursue it.

Agreed. If anything, std.random is very well designed because it uses the range interface in a clever way.

Range interface is not unique to std.random. Same template patterns are possible in any other implementation.

I already made code which I described in the main post. This is how I propose generate randoms using ranges:

    int[] iarr = generate!(() => rndGen!int).take(5).array;

rndGen is helper template, it calls random generation for each range element. In my opinion, there's no difference in use such ranges with std.random.

In addition, you also get access to basic functions for generating cryptographically secure random sequences without overhead and with lower possibility of screwing up with its calling:

    ubyte[24] buf;

    getSeededRandomBlocking(buf);

It's very simple, yes. I think the last line covers 95% of all needings.

(And I hope someone will ask why this function is called this way)

1 day ago

On Friday, 19 September 2025 at 16:38:59 UTC, Denis Feklushkin wrote:

>

On Thursday, 18 September 2025 at 12:53:25 UTC, IchorDev wrote:

>

If anything, std.random is very well designed because it uses the range interface in a clever way.

Range interface is not unique to std.random.

That's what makes it well designed, obviously. You're the one who said

>

I don't like the way the module std.random is designed

An integral part of why its design is good is that it uses the range interface rather than reinventing the wheel. Someone like you who can't understand the good parts of std.random's design has no place in suggesting changes to it.

1 day ago

On Saturday, 20 September 2025 at 18:42:03 UTC, IchorDev wrote:

>

On Friday, 19 September 2025 at 16:38:59 UTC, Denis Feklushkin wrote:

>

On Thursday, 18 September 2025 at 12:53:25 UTC, IchorDev wrote:

>

If anything, std.random is very well designed because it uses the range interface in a clever way.

Range interface is not unique to std.random.

That's what makes it well designed, obviously. You're the one who said

>

I don't like the way the module std.random is designed

An integral part of why its design is good is that it uses the range interface rather than reinventing the wheel. Someone like you who can't understand the good parts of std.random's design has no place in suggesting changes to it.

Using ranges where they dont belong is bad design; I think v3 will deprecate at least my complaint that nullable shouldnt be a range

1 day ago

On Saturday, 20 September 2025 at 18:42:03 UTC, IchorDev wrote:

>

On Friday, 19 September 2025 at 16:38:59 UTC, Denis Feklushkin wrote:

>

On Thursday, 18 September 2025 at 12:53:25 UTC, IchorDev wrote:

>

If anything, std.random is very well designed because it uses the range interface in a clever way.

Range interface is not unique to std.random.

That's what makes it well designed, obviously.

This is neither a necessary nor a sufficient condition.

Also, wonderful D template ranges can be attached to any interface easily.

22 hours ago

On Saturday, 20 September 2025 at 18:42:03 UTC, IchorDev wrote:

>

Someone like you who can't understand the good parts of std.random's design has no place in suggesting changes to it.

Personal attacks are not allowed on this forum, please have a respectful discussion.

13 hours ago

On Saturday, 20 September 2025 at 22:11:37 UTC, Dennis wrote:

>

On Saturday, 20 September 2025 at 18:42:03 UTC, IchorDev wrote:

>

Someone like you who can't understand the good parts of std.random's design has no place in suggesting changes to it.

Personal attacks are not allowed on this forum

What personal attack? There is no personal attack.

13 hours ago

On Saturday, 20 September 2025 at 19:31:48 UTC, monkyyy wrote:

>

On Saturday, 20 September 2025 at 18:42:03 UTC, IchorDev wrote:

>

An integral part of why its design is good is that it uses the range interface rather than reinventing the wheel.

Using ranges where they dont belong is bad design

Every random number generator implementation that I've seen essentially functions like an infinite range:

  • front gets the current state.
  • popFront mutates the state, giving us our next random number.
  • empty is false.
8 hours ago

On Sunday, 21 September 2025 at 07:27:42 UTC, IchorDev wrote:

>

On Saturday, 20 September 2025 at 22:11:37 UTC, Dennis wrote:

>

On Saturday, 20 September 2025 at 18:42:03 UTC, IchorDev wrote:

>

Someone like you who can't understand the good parts of std.random's design has no place in suggesting changes to it.

Personal attacks are not allowed on this forum

What personal attack? There is no personal attack.

If you want an explanation, give that sentence to any LLM and it can tell you why it's a personal attack. Maybe you don't agree with the term 'personal attack', but either way, just see this as a friendly warning that in the future, using more of this kind of language can get your post deleted.

Denis Feklushkin has been very respectful so he's welcome to post suggestions for std.random.

1 2 3
Next ›   Last »