I've heard Richard talk about effects on the podcast, and the most recent EYG episode goes in some depth with the EYG approach. My background is mostly in Ruby but maybe more of a fan of Elixir. I write mostly in a functional style, very comfortable with immutability, and understand pure functions and side effects. But this is really my first encounter with a language or approach that has a formal sense of Effects. What's a good starting point to learn more about Roc Effects?
A lot is in flux with purity inference about to land. Maybe the purity inference talk would be the best bet currently....I guess how are you trying to understand about them (implementation, relation to platforms, just what they are, how they appear in roc code, other)?
https://youtu.be/42TUAKhzlRI?si=D7pD6dGJyr_TY9BW
I understand platforms are responsible for handling effects, and that seems like a nice property. perhaps related, it's a neat quirk that the platform calls into the application, like a library, which gives Roc itself the purity guarantees, but in my head while I was learning, I was assuming Roc was calling out to the platform. Mainly I'm thinking about how to reason about programs with an explicit notion of effects. my approach for the last 10 years or so, in Ruby, is to minimize side effects, minimize state (object ivars, mostly), and adhere to mostly functional paradigms. This has meant more easily testable code and easy transitions to concurrency and parallelism.
So now, I'm wondering what amazing benefits will fall out of an explicit notion of effects, and how to harness the feature.
I have a bunch of minimal gems / libs, and I'll probably try to port one to Roc soon as an exercise
Watching now, thanks
7 minutes in, Richard is describing everything I just typed :rolling_on_the_floor_laughing:
side note: I've been silently hating the backslash until I heard Richard say it represents lambda. makes much more sense now
If you want to see purity inference in action, roc-ray graphics platform we've been using it there.
I may have gotten confused by earlier podcasts and the EYG one. Is it fair to say, that in the current version of Roc, before purity inference, that effects were mostly encapsulated by Tasks and not a first class citizen?
There was a version of roc where Task was a thing the platform library would export, another version of roc where Task was a language builtin used by exported platform functions, and the current version of roc, where you have platform functions that end in !
(like ruby), use =>
instead of ->
in their type signature, and return a normal Result
instead of a Task
. If you're writing a platform you could still export a task-like thing yourself, but it would just be your own unique thing instead of a language thing.
side note: my main technical task for today was to take down a 3-node proxmox cluster (currently doing nothing) and rebuild it with Incus. I'm pretty sure I'm going to install Arch, but I've got a ton of experience with Debian and been playing with NixOS lately. Once I've got Incus going, I want to define my containers in text (Infrastructure as code) and start running local services inside the LAN (torrent, weather, music, etc) and possibly some web stuff on the public net.
Instead I got nerdsniped by the EYG podcast :rolling_on_the_floor_laughing:
Dan: ok, so purity inference has landed? I just watched the video linked above
Yes - purity inference has landed. But theres only one (published?) platform that uses it currently.
so, one of my gems is a Nostr relay, with Schnorr signatures and everything. I think that might be too big of a spike for my first Roc port. But hypothetically speaking, could/should I write a platform that e.g. does the schnorr signatures?
The upgrade for basic-cli is done on a branch, but we have a bug with try
/ return
that makes it a less than ideal experience at the moment.
my plan is to use basic-cli heavily. that's my wheelhouse
We have a plan for crypto primitives to be builtins, as for security reasons you really need to control the implementation. I'm not familiar with Schnorr, would that need to be secure?
schnorr sigs use secp256k1
elliptic curve crypto. it's used mostly for bitcoin, but now Nostr etc
The first we implemented is sha256
in this PR but it's currently stuck on an LLVM bug
I've got a mostly-pure-ruby impl, but also one that leans on libsecp256k1
sha256 is used heavily by schnorr
to answer your question, yes, as I understand ;)
Back in June @Matthieu Pizenberg gave a talk about implementing some crypto stuff in roc for fun. Heres the online meetup, you can see the recording and also see his talk notes.
I've implemented 3DES, HMAC, and more. but not for production -- for QA use to verify and tickle prod. this was a long time ago. I would not have implemented schnorr sigs unless I had to (for Nostr), but I have some nice ruby code that closely matches the spec. long story short, not a crypto guy, and I'll probably want to use libsecp256k1
for any real work
https://github.com/rickhull/schnorr_sig
Luke: the google drive link? still waiting for the page to load...
looking at roc-ray ... I have https://github.com/rickhull/driving_physics, which is entirely numerical / text, with no graphics. I really want to add graphics, and I was looking at DragonRuby game engine, but it's proprietary and actually requires mruby (embedded ruby), which is actually a completely different beast than the Ruby I used
I think DragonRuby is mostly based on SDL. haven't looked at Raylib yet
for my driving_physics lib, it is a first principles approach. for example, I have a Disk class, which is used to model wheel+tire, gears, flywheel, etc. a disk has mass, radius, width, and can calculate torque, moment, etc
In case you missed it https://lukewilliamboswell.github.io/roc-ray-ball-physics/
Rick Hull said:
Luke: the google drive link? still waiting for the page to load...
Is google docs not working?
Matthieu Pizenberg said:
Luke Boswell said:
Here is the video link for anyone who couldn't make it today. Some awesome talks, thanks again :tada:
I really want to add graphics, and I was looking at DragonRuby game engine, but it's proprietary and actually requires mruby (embedded ruby), which is actually a completely different beast than the Ruby I used
If you port you simulator over to roc you can use roc-ray :smile:
We haven't added 3D yet, but that (should be :sweat_smile:) easy to implement from here if you wanted that.
@Dan G Knutson and I have mostly been messing around with real-time multiplayer networking stuff, and support for Windows, Linux, Macos, and Web
As Luke said, these are "crypto for fun" and learning implementations that I did while following a course on fundamentals of cryptography. The github with the code https://github.com/mpizenberg/crypto-0-to-hero
It hasn’t been updated to the current Roc syntax, so these will not compile. I also agree with you @Rick Hull that any serious cryptography usage must be done with vetted implementations.
Thanks for direct vid link, I'll check it out
Last updated: Jul 06 2025 at 12:14 UTC