News for hackers. Stuff that matters.
Re:How to make any immutable data structure distributed by pchiusano on Sunday December 05, 2021 @04:56PM (#29453748)
One of the authors of the article here, happy to answer any questions about it!
Re:How to make any immutable data structure distributed by lidatong on Sunday December 05, 2021 @06:26PM (#29454378)
I had a few questions:

1. The posts mention Spark, but were you (the Unison team) also inspired by dataflow / stream processing engines (e.g. Flink, Beam, Timely Dataflow etc.) or any other technologies?

2. Relatedly, are there any plans to add a stream processing API? Or perhaps that would belong in a 3rd-party library?

3. Broadly, where do you think (in your opinion) Unison fits in the ecosystem of tooling? Is Unison specialized at solving big data problems that require distributed execution e.g. something I pull out of my toolbox for a problem I'd otherwise solve with Spark? Or is it a truly general-purpose programming language?

4. With the Tree example, you show the "wrong" way and then the "right" way -- one problem I've experienced in the past is how do you as a new user know the right way. For example, I wrap my entire program in IO then .unsafeRunSync it -- technically following the rules, but got nothing out of doing that. Have you thought about how the APIs could guide the user to the idiomatic solution? Perhaps via types?

By the way, I really loved the FP in Scala book, it was my first step into FP -- thank you and Runar for writing it

Re:How to make any immutable data structure distributed by rlmark on Sunday December 05, 2021 @07:35PM (#29454851)
Hi there! I can't speak to questions 1-3, but with regards to question 4, some of the examples we generated were born from early mistakes I had stumbled into when writing the `Tree` functions, so I have some thoughts. It would be interesting to codify the behavior of evaluating the `Tree` in more types, but looking back, the thing that would have helped me most in avoiding some of the missteps might have been a richer test interpreter, where I could have "mocked" a network of, say, 3 nodes and distributed the `Tree` across them, emitting information about where the data was being moved, and where the various functions were being applied. We had actually briefly thought about writing such an interpreter for the purpose of this article and it's still something I'd like to do at some point.
Re:How to make any immutable data structure distributed by pchiusano on Sunday December 05, 2021 @08:10PM (#29455057)
So what we were going for with the core API is that it should be expressive enough for all kinds of distributed programming tasks, not just Spark-like or batch computing stuff.

We’re planning on doing several of these articles to show different applications. I think some distributed stream processing library would be super cool and there are lots of sources of inspiration for that like you mention. It would be a more interesting translation than the Spark-like stuff though. Likely using the channels ability for message passing.

> By the way, I really loved the FP in Scala book, it was my first step into FP -- thank you and Runar for writing it

That’s great to hear!

Re:How to make any immutable data structure distributed by lidatong on Monday December 06, 2021 @02:53PM (#29464704)
Thank you both for the answers!

> the thing that would have helped me most in avoiding some of the missteps might have been a richer test interpreter, where I could have "mocked" a network

This is a really intriguing idea. Debugging distributed can be a huge headache, and I can see a lot of value in having something like that.

> We’re planning on doing several of these articles to show different applications.

Looking forward to future articles and definitely will be following this project!

Re:How to make any immutable data structure distributed by anonymousDan on Monday December 06, 2021 @02:38AM (#29457198)
Could you point to some resources on how the underlying (distributed) runtime is architected/works? Also, is it primarily designed to support 'bringing the code to the data', or can it also support 'bringing the data to the code' a la snowflake?
Re:How to make any immutable data structure distributed by Touche on Sunday December 05, 2021 @06:18PM (#29454340)
How do you perform side effects in Unison (like reading a file as an example)?
Re:How to make any immutable data structure distributed by rlmark on Sunday December 05, 2021 @07:10PM (#29454674)
Hi there, the other article author chiming in here! You can perform side effects in Unison via abilities (our name for algebraic effects) - they're described here: https://www.unisonweb.org/docs/abilities/

Some basic IO functionality is supported by the `base` library (the standard lib) which contains functions like `openFile` which are effectful functions expressed in terms of the `IO` ability.