Whoever is responsible for the superb handling of relative platform imports (ex: packages { base: "../roc/examples/hello-world/platform" }
), thank you! I tried that, thinking "surely it won't be this easy/possible", and then it just worked.
Haha, that's a pleasant error message: Screen-Shot-2021-12-21-at-8.27.20-AM.png
I just accidentally discovered that Num.mulWrap
(and its wrapping-related friends) exist. :face_palm: This seems obvious in hindsight. Until two minutes ago, I thought Roc had disallowed planned Num
overflows by design... but no, it's just a very flexible system that prevents unplanned overflows by default! Thank you, designers! I'm gonna add Num.*Wrap
to the docs and tutorial.
Now I can solve a TODO from a week ago! # TODO: Make this overflow-safe, somehow.
:laughing:
lol :)
record |> transform |> .field
works?!?! :heart_eyes: :tada: Soooooooooo clean.
(I know that point-free programming has drawbacks, but I didn't realize how many of my lambdas were syntactically unnecessary...)
Nah, tacit programming is amazing with zero drawbacks and everyone should be programming in APL, BQN, or some similar language. ~~~lots of sarcasm~~~
But actually, that is really cool and clean
personally I think pointfree function application is usually great and pointfree function composition is usually not :big_smile:
(saying . you . are . what) "?"
:D
I think point free composition is really nice if the functions are named well and have obvious meaning
hello:)
I'm just getting started learning about capabilities
(http://habitatchronicles.com/2017/05/what-are-capabilities/)
apparently it works well with OOP (smalltalk, java?)
roc being inspired by smalltalk, does it make use of capabilities?
I know smalltalk was mentioned in some editor chats, but to my knowledge roc isn't really inspired by smalltalk (could totally be wrong).
Anyway, to answer the question. I think that Roc, especially with the platform abstraction could be used in a way to facilitate capabilities, but I don't think there is much explicit about the langauge otherwise that pushes people towards capabilties.
With the platform abstraction, I think you could directly create this type of limit access control, even making compatible platforms with different sets of restrictions.
That said, you could also build it directly into a platform where has some way to interface with a user when resources are requested. This would be akin to building an OS wrapper that uses capabilities instead of direct access control.
Saying all of this, I am totally new to capabilities and would really need to see concrete code examples to try and make examples of how it could look in roc. Probably will dig into the article more later and search around.
On other note, Roc does not have linear types. Depending on how exactly you think of capabilities, that may be a requirement, but I don't really think so based on reading the article.
Last updated: Jul 06 2025 at 12:14 UTC