{"id":16148997,"url":"https://github.com/julianmendez/soda","last_synced_at":"2025-04-23T23:22:39.444Z","repository":{"id":54167319,"uuid":"520553636","full_name":"julianmendez/soda","owner":"julianmendez","description":"Object-oriented functional language to describe, analyze, and model human-centered problems","archived":false,"fork":false,"pushed_at":"2025-03-28T21:08:16.000Z","size":3752,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T21:28:10.582Z","etag":null,"topics":["functional-language","human-centered","object-oriented","soda-language","transparent"],"latest_commit_sha":null,"homepage":"https://julianmendez.github.io/soda/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/julianmendez.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-02T15:31:43.000Z","updated_at":"2025-03-28T20:52:46.000Z","dependencies_parsed_at":"2023-12-26T00:23:42.853Z","dependency_job_id":"f7e75879-9c2d-4d52-a4e2-d9e2a9f594f6","html_url":"https://github.com/julianmendez/soda","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julianmendez%2Fsoda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julianmendez%2Fsoda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julianmendez%2Fsoda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julianmendez%2Fsoda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/julianmendez","download_url":"https://codeload.github.com/julianmendez/soda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250529909,"owners_count":21445693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["functional-language","human-centered","object-oriented","soda-language","transparent"],"created_at":"2024-10-10T00:35:54.201Z","updated_at":"2025-04-23T23:22:39.433Z","avatar_url":"https://github.com/julianmendez.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Soda](https://julianmendez.github.io/soda/)\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)][license]\n[![build](https://github.com/julianmendez/soda/workflows/Scala%20CI/badge.svg)][build-status]\n[![Documentation Status](https://readthedocs.org/projects/soda-lang/badge/?version=latest)][doc-status]\n\n*Soda* (Symbolic Objective Descriptive Analysis) is a functional language with\nobject-oriented notation to describe, analyze, and model human-centered problems, especially\nethical problems.\n\nThis project includes a translator (or transpiler) to [Scala 3][scala], experimental\ntranslators to [Lean 4][lean] and [Coq 8][coq], and a [LaTeX][latex] documentation\nextraction tool.\n\n\n## Publications\n\n* \u003ca id=\"Me2023\"\u003e\u003c/a\u003e\n  Julian Alfredo Mendez.\n  **Soda: An Object-Oriented Functional Language for Specifying Human-Centered Problems**.\n  arXiv, 2023.\n  \u0026nbsp; DOI:[10.48550/arXiv.2310.01961][soda-doi]\n  \u0026nbsp; [Abstract][soda-abstract]\n  \u0026nbsp; [BibTeX][soda-bibtex]\n  \u0026nbsp; [PDF][soda-pdf]\n  \u0026nbsp; [Implementation][soda-impl]\n\n* \u003ca id=\"MeKa2025\"\u003e\u003c/a\u003e\n  Julian Alfredo Mendez, Timotheus Kampik.\n  **Can Proof Assistants Verify Multi-Agent Systems?**.\n  arXiv, 2025.\n  \u0026nbsp; DOI:[10.48550/arXiv.2503.06812][soda-mas-doi]\n  \u0026nbsp; [Abstract][soda-mas-abstract]\n  \u0026nbsp; [BibTeX][soda-mas-bibtex]\n  \u0026nbsp; [PDF][soda-mas-pdf]\n  \u0026nbsp; [Implementation][soda-mas-impl]\n\n\n## Online manual\n\n- [User manual][manual]\n\n\n## Where to start\n\nSteps to run a \"Hello world!\" example in Soda:\n\n1. To run these steps, you need to install:\n    - a. [Scala 3][scala]\n    - b. [sbt][sbt] (if you need to build the binaries)\n    - c. [Java][java] (to execute JAR files)\n2. Get the translator binary by either doing the following:\n    - a. download the Linux binary from [releases][soda-releases]\n    - b. **or** clone the [GitHub repository][soda-repo] and compile it, by either:\n        - i. run the `makeall.sh`, from a Linux compatible environment\n        - ii. **or** run `sbt` to get an executable JAR file as indicated in the\n          [release notes][release-notes]. The command itself is described in `build` and the\n          file is `release`. To execute a JAR file, you need a [Java][java] environment\n          installed, and you need to run `java -jar filename.jar`, for a JAR file named\n          `filename.jar`.\n3. Once you got the binary translator, go to an empty directory and try\n   `soda manual`. It will output a piece of code with many examples, but most importantly,\n   this mini-manual is a \"Hello, World!\" program itself. Write `soda manual \u003e Manual.soda` and\n   you get the manual.\n4. Once `Manual.soda` has been created, run `soda .`. This will create two files:\n   `Package.soda` and `Package.scala`.\n5. Run `scalac Package.scala`, which will compile sources and put the result in the\n   directory\n   `soda/manual`.\n6. Run `scala soda.manual.EntryPoint`, which will show you `Hello world!`.\n\n\n## How to learn Soda\n\nSoda is a functional language intended to be **easy to learn and to read**. However, writing\npurely functional style requires some practice, as some things are different from the\nimperative style. In addition, Soda includes an object-oriented notation to align it with\nmainstream object-oriented programming languages, and to make its notation familiar to users\nacquainted to those languages.\n\nThe first step is to **get familiar with the functional notation** and functional approach to\nalgorithms. This can be learned by rewriting imperative pieces of code, and use Scala, which\nallows both paradigms, to check that both approaches give similar results.\n\nThe next step is to **get familiar with classes and packages**. Modeling simple examples can\ngive a good basis to see what possibilities and limitations has to model with Soda. You will\nfind that modeling will seem faster and easier, but you will find some limitations when\nmodeling constrained instances. It is also a good practice to get acquainted to the syntax\nand naming conventions, which are useful when creating larger projects.\n\nThe next step is to **get familiar with the testing** possibilities. At the moment, this is\nonly\ndeveloped for the Scala translator. Some examples can be found in module\n[examples][examples-test], in the Soda repository. They can be run with `sbt test`.\n\nThe last step is to **get familiar with the verification** possibilities. For this, it would\nprobably work better to write Lean 4 proofs, as the Soda translator to Lean is more developed\nthan the translator to Coq. A good way to start proving theorems in Lean is to\nfollow the tutorials at the [Lean Game Server][lean-game-server], like the **Natural Number\nGame**.\n\n\n## Technical details\n\n\n### Reserved Words and Symbols\n\nThe **reserved words** are:\n\n- `:` (type membership symbol)\n- `-\u003e` (type mapping symbol)\n- `=` (definition symbol), `def` (optional)\n- `:=` (parameter definition symbol)\n- `lambda`, `any` (synonym of `lambda`), `fun` (synonym of `lambda`), `--\u003e` (lambda symbol)\n- `if`, `then`, `else`\n- `match`, `case`, `==\u003e` (implication symbol in pattern matching)\n- `datatype`, `inductive` (synonym of `datatype`), `data` (synonym of `datatype`)\n- `class`, `extends`, `abstract`, `end`\n- `this`, `subtype`, `supertype`\n- `false`, `true` , `not`, `and`, `or`\n- `package`, `import`\n- `directive`\n\nIn addition, the language has:\n\n- `(` and `)` (parentheses) for parameters and operator precedence\n- `[` and `]` (square brackets) for parametric types\n\nThe main arithmetic operators are:\n\n- `+`, `-`, `*`, `/`, `%` (modulus)\n\nComments are marked with `/*` and `*/`. Scaladoc / Javadoc markers are `/**` and `*/`.\n\nThe annotations (only available when translating to Scala) are:\n\n- `@new` to create JVM instances in translations to Scala 2\n- `@tailrec` to ensure a tail recursion\n- `@override` to override a JVM function\n\nThe following are special names:\n\n- `_tailrec_` as prefix indicates that the function is tail recursive\n- `_rec_` as prefix indicates that the function is recursive\n- `Main` is the entry point class, and `Main_ ()` its constructor\n\n\n### Integration\n\nThis language is **statically typed**. It is possible to define abstract and concrete classes.\nEach *class* (like a *trait* in Scala) can be extended and has a single class constructor.\nThis constructor is implemented with a *concrete class* (like a *case class* in Scala).\n\nSoda is designed to be integrated via the Java Virtual Machine. It is possible to define\npackages and to declare imports. This can be done in a separate\nfile `Package.soda`, which is in the same directory as the source\ncode.\n\nIn Soda, variables cannot change their value. Thus, it is not possible to write `x = x + 1`.\nLoops can be managed with `range` and `fold` functions and tail recursion.\nThe language does not provide `throw`, `try`, and `catch`, because those commands do not follow\nthe functional style. Nevertheless, it is possible to produce side effects, like using files,\nthrough packages provided by Scala.\n\nThe following tools can be configured to have **syntax highlighting**:\n\n- [IntelliJ][intellij] [configuration][intellij-conf]\n- [gedit][gedit] [configuration][gedit-conf]\n\n\n## Build\n\nThe project can be built with [sbt][sbt] with\n`sbt clean compile test package assembly`\n\nA Linux binary can be created with the script `makeall.sh`.\n\nMore detailed information can be found in the [release notes][release-notes].\n\n\n## Author\n\n[Julian Alfredo Mendez][author]\n\n[soda-doi]: https://doi.org/10.48550/arXiv.2310.01961\n\n[soda-abstract]: https://arxiv.org/abs/2310.01961\n\n[soda-bibtex]: https://julianmendez.github.io/soda/bibtex-2023.html\n\n[soda-pdf]: https://arxiv.org/pdf/2310.01961\n\n[soda-impl]: https://github.com/julianmendez/soda\n\n[soda-mas-doi]: https://doi.org/10.48550/arXiv.2503.06812\n\n[soda-mas-abstract]: https://arxiv.org/abs/2503.06812\n\n[soda-mas-bibtex]: https://julianmendez.github.io/soda/mas-bibtex-2025.html\n\n[soda-mas-pdf]: https://arxiv.org/pdf/2503.06812\n\n[soda-mas-impl]: https://github.com/julianmendez/market\n\n[author]: https://julianmendez.github.io\n\n[license]: https://www.apache.org/licenses/LICENSE-2.0.txt\n\n[build-status]: https://github.com/julianmendez/soda/actions\n\n[doc-status]: https://soda-lang.readthedocs.io/en/latest/?badge=latest\n\n[manual]: https://soda-lang.readthedocs.io/en/latest/\n\n[release-notes]: https://julianmendez.github.io/soda/RELEASE-NOTES.html\n\n[soda-repo]: https://github.com/julianmendez/soda\n\n[soda-releases]: https://github.com/julianmendez/soda/releases\n\n[examples-test]: https://github.com/julianmendez/soda/tree/master/examples/src/test/scala/soda/example\n\n[lean-game-server]: https://adam.math.hhu.de\n\n[sbt]: https://www.scala-sbt.org\n\n[scala]: https://scala-lang.org\n\n[java]: https://www.oracle.com/java/technologies/\n\n[lean]: https://lean-lang.org\n\n[coq]: https://coq.inria.fr\n\n[latex]: https://www.latex-project.org\n\n[sbt]: https://www.scala-sbt.org\n\n[intellij]: https://www.jetbrains.com/idea/\n\n[intellij-conf]: https://github.com/julianmendez/soda/blob/master/translator/src/main/resources/soda/translator/documentation/soda_for_intellij.txt\n\n[gedit]: https://gedit-technology.github.io/apps/gedit/\n\n[gedit-conf]: https://github.com/julianmendez/soda/blob/master/translator/src/main/resources/soda/translator/documentation/soda.lang\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulianmendez%2Fsoda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulianmendez%2Fsoda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulianmendez%2Fsoda/lists"}