{"id":13678823,"url":"https://github.com/gonzula/splash","last_synced_at":"2025-04-29T15:33:27.026Z","repository":{"id":79922145,"uuid":"160523747","full_name":"gonzula/splash","owner":"gonzula","description":"Simple Programming LAnguage for SHortcuts","archived":true,"fork":false,"pushed_at":"2022-07-02T23:01:41.000Z","size":39489,"stargazers_count":232,"open_issues_count":6,"forks_count":16,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-08-02T13:24:47.483Z","etag":null,"topics":["compiler","ios","programming-language","siri-shortcuts"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gonzula.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-12-05T13:38:44.000Z","updated_at":"2024-06-02T01:18:48.000Z","dependencies_parsed_at":"2023-04-22T01:01:24.823Z","dependency_job_id":null,"html_url":"https://github.com/gonzula/splash","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzula%2Fsplash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzula%2Fsplash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzula%2Fsplash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzula%2Fsplash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gonzula","download_url":"https://codeload.github.com/gonzula/splash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224179147,"owners_count":17269011,"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":["compiler","ios","programming-language","siri-shortcuts"],"created_at":"2024-08-02T13:00:58.752Z","updated_at":"2025-04-29T15:33:26.967Z","avatar_url":"https://github.com/gonzula.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# SPLASH : Simple Programming LAnguage for SHortcuts\n\n## Project being archived\n\nUnfortunately, apple made some modifications to the Shortcuts app that make it very difficult to develop new features in this project. The fact that it is no longer possible to directly import .shortcut files unbearably delays the tests needed to add functionality to this language. Therefore I'm stopping my activities in this repo.\n\n![splash icon](https://raw.githubusercontent.com/gonzula/splash/master/imgs/RoundedIcon.png)\n[![AppStore badge](https://linkmaker.itunes.apple.com/en-us/badge-lrg.svg?releaseDate=2019-03-11\u0026kind=iossoftware\u0026bubble=ios_apps)](https://itunes.apple.com/us/app/splash-programming-language/id1455793030?mt=8)\n##### The first real programming language that compiles to Apple's `Shortcuts.app`\n\n## What it is\n\nAlthough the Shortcuts app is designed for non programmers/beginners, it's programming interface is similar to assembly in the meaning that very simple expressions need dozens of blocks.\n\nTo solve this problem, `SPLASH` is being developed as a programming language designed for non programmers/beginners that compiles directly to shortcuts.\n\n![Example GIF](https://raw.githubusercontent.com/gonzula/splash/master/imgs/quadratic.gif)\n\n## For what it's worth\n\nSplash is meant to reduce substantially the manual labor, improve readability and maintainability of shortcuts. It's still under development but with a few fully working features. Between them:\n\n* Complex mathematical expressions\n* Flow control (ifs and elses)\n* String interpolation (variables inside a string)\n\nAnd those are some of the features in the backlog:\n\n* Loops\n* Functions declarations\n\n## How it works\n\n### The programming language\n\nThe best way to learn is with some examples\n\nHere's an example splash program that given an age tells the person's stage of life.\n\n[shortcut file](https://github.com/gonzula/splash/blob/master/examples/age.shortcut)\n\n[video of the shortcut](https://github.com/gonzula/splash/blob/master/examples/age.mov)\n\n\n``` BASH\nage := AskNumber()  # The ':=' stores the right side expression\n                    # on the left side variable\n\n                    # And AskNumber() asks the user for a number input\n                    # when the shortcut is running\n\nif age \u003c 12 {\n    ShowResult(\"Child\")\n} else if age \u003c 18 {  # Blocks of code are surrounded by '{' and '}'\n    ShowResult(\"Teen\")\n} else if age \u003c 60 {\n    ShowResult(\"Adult\")\n} else {\n    ShowResult(\"Elder\")\n}\n\n# And comments are preceded by '#'\n```\n\nHere's an example with more advanced expressions that solves any quadratic expression in the form ax² + bx + c = 0\n\n[shortcut file](https://github.com/gonzula/splash/blob/master/examples/quadratic.shortcut)\n\n[video of the shortcut](https://github.com/gonzula/splash/blob/master/examples/quadratic.mov)\n\n``` BASH\na := AskNumber()\nb := AskNumber()\nc := AskNumber()\n\ndelta := b^2 - 4 * a * c  # a^b is a to the b power\n\nif a == 0 {\n    x := -c/b\n\n    answer := \"x = {x}\"  # This is a string interpolation\n                         # It resolves to \"x = (value of variable x)\"\n} else if delta == 0 {  # '==' tests for equality\n    x := -b / (2 * a)\n\n    answer := \"x1 = x2 = {x}\"\n} else if delta \u003e 0 {\n    x1 := (-b + delta^(1/2))/(2 * a)\n    x2 := (-b + -delta^(1/2))/(2 * a)\n\n    answer := \"x1 = {x1}\\nx2 = {x2}\"\n} else {\n    xr := -b / (2 * a)\n    xi := (-delta)^(1/2) / (2 * a)\n    nxi := -xi\n\n    answer := \"x1 = {xr} + {xi}i\\nx2 = {xr} + {nxi}i\"\n}\n\nShowResult(answer)  # ShowResult shows an alert with the\n                    # value passed inside the parenthesis\n```\n\nAnd a last example that tells if an year is a leap year:\n\n[shortcut file](https://github.com/gonzula/splash/blob/master/examples/leap_year.shortcut)\n\n[video of the shortcut](https://github.com/gonzula/splash/blob/master/examples/leap_year.mov)\n\n``` BASH\nyear := AskNumber()\n\nif year % 4 \u003e 0 {  # The % symbol performs the modulo operation\n    leap := 0\n} else if year % 100 \u003e 0 {  # And, diffently from shortcuts,\n                            # you can have math expressions in\n                            # the comparison\n    leap := 1\n} else if year % 400 \u003e 0 {  # So this line checks if year is divisible by 400\n    leap := 0\n} else {\n    leap := 1\n}\n\nif leap == 0 {\n    type := \"common\"\n} else {\n    type := \"leap\"\n}\n\nShowResult(\"{year} is a {type} year\")\n```\n\n## How to get started\n\nYou can use this language on your iOS device by [downloading the app from the App Store](https://itunes.apple.com/us/app/splash-programming-language/id1455793030?mt=8) or cloning this repo and compiling it on your Xcode. (You will need an Apple Developer account)\n\nOr you can compile the compiler on your computer. It's pure C code, without any dependencies, so it works on any operating system.\n\n## Installing the app via Xcode\n\nYou will need to have installed `bison` installed.\n```\nbrew install bison\nln -s /usr/local/opt/bison/bin/bison /usr/local/bin/bison\n```\nAnd then it's just a matter of building the Xcode project\n\n## Compiling the Compiler\n\n### The easy way\n\nDownload the compiled version from the latest release\n\n[linux version](https://github.com/gonzula/splash/releases/download/v0.1.1/splash.linux)\n\n[macOS version](https://github.com/gonzula/splash/releases/download/v0.1.1/splash.macOS)\n\nand run\n\n``` BASH\nchmod +x splash\n```\n\n\n### Compiling from source\n\nYou can compile the splash compiler from source, cloning this repo and running `make`. You will need `bison`, `flex` and a C compiler\n\nOn macOS you can install the dependencies with homebrew:\n\n```\nbrew install bison\nln -s /usr/local/opt/bison/bin/bison /usr/local/bin/bison\n```\n\nOn ubuntu:\n\n```\nsudo apt install bison flex gcc\n```\n\n## How to run\n\nOn a terminal window located at the folder you installed `splash`\n\n```\n./splash input_file output_file\n```\n\nThe splash compiler adds a `.shortcut` extension to output_file that is required by the shortcuts app.\n\nAlso, the name of that output file is the display name of your shortcut.\n\n## How to import the shortcuts\n\nThe easiest way is to airdrop the `.shortcut` file to your device.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgonzula%2Fsplash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgonzula%2Fsplash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgonzula%2Fsplash/lists"}