Here's a first draft of a blog post announcing purity inference:
https://gist.github.com/rtfeldman/ac6e3a6da7714b9f8d03e50865403637
I don't plan to post this yet, since the transition is still in progress, but I did want to write up a draft to get feedback for when we're ready to announce it.
any feedback welcome!
Who is your intended audience with this post? Or rather, where do you plan on posting it?
the goal is for it to end up on the front page of Hacker News
I plan to post it on rtfeldman.com just like the others (if I remember right, I think the previous one made it to the front page whereas the one before did not)
the main reason for posting it on rtfeldman.com is that I wanted to avoid having an "official blog" because that creates an obligation to post on it regularly, or else people misread the lack of posting as a signal that something is wrong (e.g. that development is slowing down, or people have lost interest in the language, etc.)
whereas I figure that if there is no "official Roc blog" then that downside doesn't happen, and if I personally (or others) haven't posted in awhile, people won't read the same things into it (e.g. "oh maybe he's just got other demands on his time right now" etc.)
Love it. Really enjoyed reading the draft. :smiley:
Great post! Found one small typo: "... the LLVM perfomrance optimizations ..."
I'm loving the read so far. On the topic of typos, I found ...one of of pure...
, ...previous snytax used...
, ... a result so delighftful!
As part of the function syntax explanation I think it's worth mentioning ||
doesn't interfere with tuple syntax.
The "few more breaking changes" link is not a public zulip conversation.
Thank you for mentioning the kingfisher platform. Reading this forced me to create a new release, before you publish the post :sweat_smile:
Will the new function syntax with ||
be merged in main before you publish the post?
I'm assuming so, yeah!
Great post! One possible improvement could be to use collapsible sections for "What we consider observable" and "Algebraic Effects". A shorter looking post could mean the difference between "It's not so long, I can read this now." and "This is interesting but it's a little long, I'll save this for later." (And possibly forget about it).
@Oskar Hahn I'll try to get that going. Doing a bit of a PNC refactor to quiet the last of the fuzzer issues. I'll be doing that next
And I'm very humbled to be mentioned in the post Richard, it's gratifying to see basically every contribution I've made (outside of bugs - some of which I created :smile:) being called out.
I think this is a great post, and I'm sure the Orange Site chatter will be fun to read
thanks for making the contributions, they've been great! :smiley:
This looks great overall! I wonder if it'd be worth mentioning how we let you run effects from functions annotated to be pure while debugging. I've had really positive reactions to that fact.
Also, does my name intentionally link to roc-pg
's repo? :smiley:
oops, I'll fix that!
and good call on the running effectful functions anywhere while debugging!
Wow. I did not know that this is possible. I am excited to read about it in the post.
yeah it's just a warning
we might need to be careful with --optimize
and not annotating things as pure in llvm if they're not actually pure :thinking:
dbg
is stripped with --optimize
right?
I forget if it currently is, but the idea is not to
--optimize
should strip inline expect
and that's it
No. It's not. And it was really useful for AoC to have optimize with dbg.
That's troubling to me.
I would expect a production release to maintain the contract of the effectuality of all functions
Unless we are going to have a --optimize-prod
flag :smile:
we've talked about having like a --release
flag or something like that
which could fail if there are any warnings or dbgs
But why fail is there are debugs, and not just strip them?
Because people will add dbg to their code and spend time wondering why it's not printing anything, potentially a lot of time
I’d at least like a —strip-dbg flag
Maybe we can make an actual thread about this? We have yet to finalize this design. I can make an #ideas thread in about an hour unless someone else wants to do it
I think the only remaining syntax for this, once we land the staged breaking changes are;
|args|
"string ${interpolation}"
(removed)
The link isn't a publicly visible topic... should we update the Plans page maybe?
To date, Roc has never had a numbered release. We aim to change that by releasing version 0.1.0 sometime in 2025, after landing a few more breaking changes.
I like the link being to a topic that isn't public
if someone is curious enough what the breaking changes are, that's a good reason for them to join Zulip! :smiley:
Anthony Bullard said:
I’d at least like a —strip-dbg flag
hm, what would you use it for? :thinking:
it seems like the use case would be "I want to keep dbg
s in my code base but have them be no-ops"
I always think of dbg
as essentially a temporary debugging tool for just the thing I'm currently working on, and I actively don't want it to be persisted in the code base long-term
so I can appreciate a tool that helps me identify dbg
s that I might have forgotten to take out after I was done debugging
but I can't think of a situation where I want to keep them in the code base but have them be no-ops
Last updated: Jul 06 2025 at 12:14 UTC