Stream: show and tell

Topic: Random Numbers Example


view this post on Zulip Luke Boswell (Apr 18 2023 at 10:05):

Just wanted to share something I think is pretty cool, and think it's one of the best examples I've contributed to so far, and only possible thanks to @JanCVanB and his JanCVanB/roc-random library.

Just added roc-lang/examples#20 which shows how to generate Random Numbers using a URL build of the package, and the basic-cli platform. I also made a Github Pages link so you can see the example pre-merge.

view this post on Zulip Richard Feldman (Apr 18 2023 at 12:16):

super cool! :smiley:

view this post on Zulip Richard Feldman (Apr 18 2023 at 12:16):

I think it would also be cool to show an example with backpassing

view this post on Zulip Richard Feldman (Apr 18 2023 at 12:17):

where you build up a generator using an equivalent of https://package.elm-lang.org/packages/elm/random/1.0.0/Random#andThen

view this post on Zulip Richard Feldman (Apr 18 2023 at 12:17):

(rather than passing the seed around)

view this post on Zulip Luke Boswell (Apr 18 2023 at 18:18):

There is a next function which does that I think. I'll play with it some more and see if I can make a good example that shows a few different methods. I'm also considering dropping the basic-cli part, and just make this an interface and use tests to show the results. This might make it easier to combine multiple different methids, and also reduces that dependency.

view this post on Zulip jan kili (Apr 27 2023 at 19:22):

Wow, I love seeing this (new to me) roc-lang/examples repo, and I'm proud to see my algorithm put to good use! Thank you, @Luke Boswell :D

view this post on Zulip jan kili (Apr 27 2023 at 19:23):

@Luke Boswell It looks like Roc has a (new to me) remote package sourcing feature - should I/we make a new release on my repo to support this forkless?

view this post on Zulip jan kili (Apr 27 2023 at 19:23):

I'm also happy to add you/anyone as a collaborator on the repo if we want to centralize work

view this post on Zulip jan kili (Apr 27 2023 at 19:25):

Ooh, nvm, now I see 1 new issue and 1 new PR on the repo - woohoo!


Last updated: Jul 05 2025 at 12:14 UTC