Stream: beginners

Topic: Libraries without platforms?


view this post on Zulip Eric Rogstad (Jun 04 2024 at 22:46):

I'm trying to understand how the ecosystem of packages and platforms will coevolve. So I have some questions:

  1. Does every Roc package have to target a specific platform?
  2. If Roc is targeting a long tail of domains, doesn't that mean there will be dozens, if not hundreds or thousands of platforms?
  3. If a package has to target a platform, and there are hundreds of platforms, won't that make the package ecosystem super fragmented?

view this post on Zulip Luke Boswell (Jun 04 2024 at 22:52):

Great questions @Eric Rogstad

I think you may find the Module Params proposal an interesting read.

https://docs.google.com/document/d/110MwQi7Dpo1Y69ECFXyyvDWzF4OYv1BLojIm08qDTvg/edit?usp=drivesdk

Agus has done a lot of work on that and hopefully it's almost ready for prine time :grinning:

view this post on Zulip Luke Boswell (Jun 04 2024 at 22:53):

Basically the short answer is that packages are platform independent, and Tasks can be passed in as Module Parameters so the packages can use effects and implements things in an agnostic way. So platforms only need to define a low level set of primitives and then packages can take it from there with pure Roc. :rock_on:

view this post on Zulip Eric Rogstad (Jun 05 2024 at 00:35):

Thanks @Luke Boswell! Just to clarify — is everything after "Basically the short answer is that ..." a description of the current design, or a description of the Module Params proposal?

view this post on Zulip Brendan Hansknecht (Jun 05 2024 at 00:52):

It is a description of once module params are fully implemented

view this post on Zulip Brendan Hansknecht (Jun 05 2024 at 00:52):

Currently we have pure roc libraries, but they can't depend on types from platforoms

view this post on Zulip Brendan Hansknecht (Jun 05 2024 at 00:53):

That said, you can pass a lambda into each function and generate tasks from a pure roc library that way

view this post on Zulip Hannes (Jun 05 2024 at 00:53):

To answer 1 and 3, packages are orthogonal to platforms, and any package can be used with any platform. If you have code that's specific to a platform, you'll probably want to put it in the platform itself. Packages like JSON or date times have no side effects, so they're implemented in pure Roc and work with any platform

view this post on Zulip Hannes (Jun 05 2024 at 00:53):

Yeah, what Brendan said :point_up: :sweat_smile:

view this post on Zulip Brendan Hansknecht (Jun 05 2024 at 00:56):

Also, some packages will kinda be platform dependent. For example, a postgres querying library may take module params to manage tcp connections. That library will only work with platforms that have tcp primitives.

view this post on Zulip Eric Rogstad (Jun 05 2024 at 01:06):

Got it, so we have pure roc libraries / packages now. But if you want to depend on anything you might get from a platform, you'd currently be coupled to a specific platform. Whereas if the Module Params proposal goes through, then you could depend on stuff from platforms in a kind of generic way, that could be implemented differently in different platforms.

Do I have all that right?

view this post on Zulip Eric Rogstad (Jun 05 2024 at 02:16):

That Module Params proposal sounds really clever, btw. And it also sounds like it's what Richard starts describing at the 54:35 mark here:
https://www.youtube.com/watch?v=DzhIprQan68&t=3275s

Seems like a good design!

view this post on Zulip Brendan Hansknecht (Jun 05 2024 at 04:15):

yeah you have that right

if the Module Params proposal goes through

It is accepted. Just have to wait for it to be fully implemented.


Last updated: Jul 06 2025 at 12:14 UTC