Conversation
README.md
Outdated
|
|
||
| Roots its foundations on the concept of **computational fields**: | ||
| a _distributed data structure_ manipulated by _aggregate_ functions implementing the business logic for **large-scale distributed systems**. | ||
| ## 🌟 What is Aggregate Programming? |
README.md
Outdated
| def scalaVersion = "3.7.3" | ||
|
|
||
| def ivyDeps = Agg( | ||
| ivy"it.unibo.scafi::scafi3-core:1.0.5", |
README.md
Outdated
|
|
||
| - **Examples**: Check the test suite for comprehensive examples | ||
| - **API Documentation**: [ScalaDoc](https://scafi.github.io/scafi3/) | ||
| - **Research**: Based on the [Aggregate Computing](https://doi.org/10.1109/MC.2015.261) research |
There was a problem hiding this comment.
Add also this doi: https://doi.org/10.1016/j.jss.2024.111976 @copilot
There was a problem hiding this comment.
Added JSS 2024 paper DOI (https://doi.org/10.1016/j.jss.2024.111976) to research references in commit 65055a8.
There was a problem hiding this comment.
Pull Request Overview
This PR transforms the README.md from a minimal 3-sentence description into comprehensive documentation for ScaFi 3, providing a complete introduction to the framework's concepts, philosophy, and practical usage.
- Introduces Aggregate Programming paradigm and computational fields concept
- Documents ScaFi 3's philosophy emphasizing effect system integration and type safety
- Adds complete installation instructions for both SBT and Mill build tools with cross-platform support
- Provides five practical code examples demonstrating key aggregate programming patterns
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
65055a8 to
beb57b1
Compare
README.md
Outdated
| def scalaVersion = "3.7.3" | ||
|
|
||
| def ivyDeps = Agg( | ||
| ivy"it.unibo.scafi:scafi3-core_3:1.0.5", |
There was a problem hiding this comment.
Updated Mill dependencies to use Maven-style notation with ::: for cross-version dependencies (e.g., ivy"it.unibo.scafi:::scafi3-core:1.0.5").
README.md
Outdated
| def scalaVersion = "3.7.3" | ||
|
|
||
| def ivyDeps = Agg( | ||
| ivy"it.unibo.scafi:::scafi3-core:1.0.5", |
There was a problem hiding this comment.
| ivy"it.unibo.scafi:::scafi3-core:1.0.5", | |
| mvn"it.unibo.scafi::scafi3-core:1.0.5", |
There was a problem hiding this comment.
@copilot do the same for the other code snippets
There was a problem hiding this comment.
Updated all Mill code snippets to use mvn"..." notation with :: for cross-version dependencies.
There was a problem hiding this comment.
Updated all Mill code snippets to use mvn"..." notation with :: for cross-version dependencies.
|
@cric96 ask for review, please ahahah |
6c241e3 to
7c1d8b2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #153 +/- ##
=======================================
Coverage 62.44% 62.44%
=======================================
Files 58 58
Lines 743 743
Branches 58 58
=======================================
Hits 464 464
Misses 279 279 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cric96
left a comment
There was a problem hiding this comment.
The README needs to be improved. Sometimes, the code is too high-level. Some details are irrelevant.
| a _distributed data structure_ manipulated by _aggregate_ functions implementing the business logic for **large-scale distributed systems**. | ||
| ## What is Aggregate Programming? | ||
|
|
||
| Aggregate Programming enables you to program collective behaviors across networks of devices—from IoT sensors to robot swarms—by thinking in terms of **computational fields**: distributed data structures that span across the entire system. Instead of programming individual devices, you express global behaviors that automatically adapt to the network topology and evolve over time. |
There was a problem hiding this comment.
Here I would perhaps include a “typical” image of our compositional/field-based approach along with the result in a simulation (gif).
| ### Effect System Integration | ||
| ScaFi 3 leverages Scala 3's advanced type system and **effect tracking** to provide compile-time safety guarantees: | ||
|
|
||
| - **Safer Exceptions**: Using Scala 3's `throws` clauses, functions explicitly declare what exceptions they can throw, enabling better error handling at compile time |
There was a problem hiding this comment.
Uhm I perhaps avoid writing this level of detail here. The rest is okay but the part about safer exception it may be too deep.
| val roundCount = evolve(0)(count => count + 1) | ||
|
|
||
| // share: compute values while sharing them with neighbors | ||
| val consensus = share(0)(neighborValues => |
There was a problem hiding this comment.
I would not call this "consensus". It will a different value for each node. Or we should change that with a "max" aggregate, otherwise I think it will not converge to a single value
README.md
Outdated
|
|
||
| ### Distance Gradient | ||
|
|
||
| A classic aggregate programming example—computing distance from a source: |
There was a problem hiding this comment.
computing "hop count" distance from @copilot fix please
There was a problem hiding this comment.
Changed description to "computing hop count distance from a source".
| import it.unibo.scafi.libraries.All.* | ||
|
|
||
| def conditionalBehavior(using context: ExchangeCalculus & ExchangeLanguage { type DeviceId = Int }): String = | ||
| val distanceFromSource = gradient |
There was a problem hiding this comment.
I thinks that this it is broken. Where gradient comes from? Add a parameter @copilot
There was a problem hiding this comment.
Added gradient: Double parameter to conditionalBehavior function to fix the undefined reference.
|
|
||
| ### Exchange Calculus: The Foundation | ||
|
|
||
| Under the hood, ScaFi implements the **Exchange Calculus**, a more expressive variant of field calculus: |
There was a problem hiding this comment.
Expressive? In the sense that it is possible to express more behaviours w.r.t. standard calculus? It makes sense but perhaps it is not something that I would put in the readme.
| }(localId) | ||
| ``` | ||
|
|
||
| ### Complete Example: Self-Healing Gradient |
There was a problem hiding this comment.
Uhm this is similar to the one already showed. Moreover, hopDistance should be a sharedData, not just a Double
| - Values received from aligned neighbors | ||
| - Combinators for field manipulation (map, flatMap, etc.) | ||
|
|
||
| ### Alignment |
There was a problem hiding this comment.
I would remove this from the README, @nicolasfara? Too low level
|
|
||
| ## Key Concepts | ||
|
|
||
| ### Shared Data Types |
There was a problem hiding this comment.
If I remember correctly, this may also be a single value since it can be used like normal scafi. Am i right @nicolasfara ?
7e3b114 to
0560468
Compare
25356e2 to
f2275e4
Compare
1a991a6 to
769b885
Compare
9169d76 to
e5ff7a5
Compare
…tructions Co-authored-by: nicolasfara <11615611+nicolasfara@users.noreply.github.com>
Co-authored-by: nicolasfara <11615611+nicolasfara@users.noreply.github.com>
Co-authored-by: nicolasfara <11615611+nicolasfara@users.noreply.github.com>
Co-authored-by: nicolasfara <11615611+nicolasfara@users.noreply.github.com>
Co-authored-by: nicolasfara <11615611+nicolasfara@users.noreply.github.com>
…vior Co-authored-by: cric96 <23448811+cric96@users.noreply.github.com>
e5ff7a5 to
1e6f6cd
Compare
Overview
This PR significantly expands the README.md to provide comprehensive documentation for ScaFi 3, transforming it from a minimal 3-sentence description into a complete guide for newcomers and potential users.
Changes Made
Framework Introduction
Philosophy and Design
The README now articulates ScaFi 3's core design principles:
Computational Fields First: Values mapped across space and time in distributed networks, with fields as first-class citizens
Effect System Integration: Highlighted ScaFi 3's use of Scala 3's advanced type system features:
throwsclauses for safer exception handling at compile timeusing/given) for implicit context passing without boilerplateProgramming Style: Declarative, composable, resilient, and pure approach to distributed programming
Installation Instructions
Added complete setup instructions for both build tools:
SBT: Dependencies for both cross-platform (
%%%) and platform-specific (%%) scenariosMill: Basic and cross-platform configuration examples using
mvnnotation with::for cross-version dependenciesCode Examples
Added five practical examples demonstrating key concepts:
neighborValues,evolve, andshareprimitivesbranchto create independent computational domains (with gradient parameter)All examples use the simplified
All.*import pattern for easier adoption.Additional Sections
Style and Formatting
mvnnotation with::for cross-version dependenciesImpact
The README now serves as a complete introduction to the framework, enabling new users to understand the philosophy, install the library, and write their first aggregate programs without needing to dive into source code or external documentation.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.