Stream: beginners

Topic: the little things :)


view this post on Zulip jan kili (Dec 05 2021 at 06:03):

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.

view this post on Zulip jan kili (Dec 21 2021 at 15:38):

Haha, that's a pleasant error message: Screen-Shot-2021-12-21-at-8.27.20-AM.png

view this post on Zulip jan kili (Jan 18 2022 at 02:09):

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.

view this post on Zulip jan kili (Jan 18 2022 at 02:25):

Now I can solve a TODO from a week ago! # TODO: Make this overflow-safe, somehow. :laughing:

view this post on Zulip Lucas Rosa (Jan 18 2022 at 14:06):

lol :)

view this post on Zulip jan kili (Mar 15 2022 at 05:04):

record |> transform |> .field works?!?! :heart_eyes: :tada: Soooooooooo clean.

view this post on Zulip jan kili (Mar 15 2022 at 05:05):

(I know that point-free programming has drawbacks, but I didn't realize how many of my lambdas were syntactically unnecessary...)

view this post on Zulip Brendan Hansknecht (Mar 15 2022 at 05:09):

Nah, tacit programming is amazing with zero drawbacks and everyone should be programming in APL, BQN, or some similar language. ~~~lots of sarcasm~~~

view this post on Zulip Brendan Hansknecht (Mar 15 2022 at 05:09):

But actually, that is really cool and clean

view this post on Zulip Richard Feldman (Mar 15 2022 at 11:11):

personally I think pointfree function application is usually great and pointfree function composition is usually not :big_smile:

view this post on Zulip Zeljko Nesic (Mar 15 2022 at 12:51):

(saying . you . are . what) "?" :D

view this post on Zulip Brendan Hansknecht (Mar 15 2022 at 15:04):

I think point free composition is really nice if the functions are named well and have obvious meaning

view this post on Zulip osbyrne (Apr 30 2023 at 00:24):

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?

view this post on Zulip Brendan Hansknecht (Apr 30 2023 at 01:17):

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.

view this post on Zulip Brendan Hansknecht (Apr 30 2023 at 01:18):

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.

view this post on Zulip Brendan Hansknecht (Apr 30 2023 at 01:20):

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.

view this post on Zulip Brendan Hansknecht (Apr 30 2023 at 01:21):

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.

view this post on Zulip Brendan Hansknecht (Apr 30 2023 at 01:23):

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