{"id":26554110,"url":"https://github.com/neverrare/stringed","last_synced_at":"2025-03-22T09:50:33.449Z","repository":{"id":55628895,"uuid":"269838906","full_name":"neverRare/stringed","owner":"neverRare","description":"an esolang with first-class strings","archived":false,"fork":false,"pushed_at":"2021-09-10T04:34:18.000Z","size":157,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-03T20:38:12.258Z","etag":null,"topics":["esolang","programming-language","stringed"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neverRare.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}},"created_at":"2020-06-06T02:09:24.000Z","updated_at":"2021-09-10T04:34:21.000Z","dependencies_parsed_at":"2022-08-15T04:50:48.948Z","dependency_job_id":null,"html_url":"https://github.com/neverRare/stringed","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverRare%2Fstringed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverRare%2Fstringed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverRare%2Fstringed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverRare%2Fstringed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neverRare","download_url":"https://codeload.github.com/neverRare/stringed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244937743,"owners_count":20535124,"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":["esolang","programming-language","stringed"],"created_at":"2025-03-22T09:50:32.971Z","updated_at":"2025-03-22T09:50:33.442Z","avatar_url":"https://github.com/neverRare.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stringed\n\n[![Rust][Rust CI Status]][Rust CI Link]\n\n[Rust CI Status]: https://github.com/neverRare/stringed/workflows/Rust/badge.svg\n[Rust CI Link]: https://github.com/neverRare/stringed/actions?query=workflow%3ARust\n\nAn esolang with first-class strings. Stringed have utf8 string as the only data type with simple IO and few string operations.\n\n## Installation\n\nTODO\n\n## Examples\n\n```txt\n\"Hello world!\"\n```\n\n```txt\n\"Please enter your name: \"+(?|\"\nHello \"+_+\"!\")\n```\n\nTODO: FizzBuzz\n\n## Syntax and Semantics\n\nThe following are syntax of Stringed code representing its few operation. The capital letter denotes another Stringed expression and the ellipsis `...` denotes another special syntax.\n\n| Syntax             | Name    |\n| ------------------ | ------- |\n| `\"...\"` or `{...}` | Literal |\n| `(A)`              | Group   |\n| `?`                | Prompt  |\n| `_`                | Var     |\n| `A|B`              | Closure |\n| `A+B`              | Concat  |\n| `A[B:C]`           | Slice   |\n| `A=B`              | Equal   |\n| `#A`               | Length  |\n| `$A`               | Eval    |\n\nWith the following precedence from highest to lowest.\n\n- Grouping\n- Length\n- Slice\n- Concat\n- Equal\n- Closure\n- Eval\n\n## Literal\n\nString literal are enclosed with either double quotation marks `\"\"` or curly braces `{}`.\n\nIt can contain any characters and it doesn't have escaping functionality.\n\nLiterals enclosed with `{}` can contain quotation mark or another braces. It can be nested: `{{}}` and `{{{}}{}}` are both valid literal and `{}}` is a syntax error. It doesn't recognize quotation mark for nesting: `{\"{\"}` is a syntax error.\n\n## Basic Operations\n\nPretty basic, you'll understand it in few examples.\n\n```txt\n\"concat\"+\"enation\"\n\"concatenation\"\n\n\"slice\"[\"2\":\"4\"]\n\"ic\"\n\n\"slice\"[\"2\":]\n\"ice\"\n\n\"slice\"[:\"4\"]\n\"slic\"\n\n\"slice\"[:]\n\"slice\"\n\n\"slice error\"[\"a number\":\"-10\"]\nError: Bound is not convertible to unsigned integer\n\n\"slice error\"[\"\":\"100\"]\nError: Upper bound is larger than the length\n\n\"slice error\"[\"10\":\"0\"]\nError: Lower bound is larger than upper bound\n\n\"equal\"=\"equal\"\n\"true\"\n\n\"not equal\"=\"not really equal\"\n\"false\"\n\n#\"length\"\n\"6\"\n\n#\"size\"\n\"4\"\n\n(\"group\"+\"ings\")[:\"8\"]\n\"grouping\"\n```\n\n## Closure and Var\n\nClosure creates a scope in which gives variable `_` a value: It evaluates to the second operand as if the variable is the first operand.\n\n```txt\n\"apple\"|\"my favorite fruit is \"+_\n```\n\nClosure is right to left associative and the first operand is evaluated first.\n\n```txt\nA|B|C\nis evaluated as\nA|(B|C)\n\nA is evaluated first, then B|C\n```\n\nClosure creates a scope in a way variable can be shadowed.\n\n```txt\n\"a\"|\"b\"+_+(\"nan\"|_)+_\n```\n\nThe first operand can even use the variable of outer closure.\n\n```txt\n\"a\"|\"b\"+_+(\"n\"+_+\"n\"|_)+_\n```\n\n## Eval\n\nStringed can immediately evaluate strings as Stringed expression and return a... string. We may need to include a literal inside a literal, this is where `{}` can be useful.\n\n```txt\n${\"evaluation\"}+{[:\"4\"]}\n```\n\nEvals can also capture variable.\n\n```txt\n\"world\"|${\"hello \"+_}\n```\n\nLiterals in `{}` doesn't look like literals, nice!\n\n## IO and execution\n\nStringed have `?`, when evaluated, it ask the user to input then it is evaluated to that value.\n\n```txt\n?|\"\nYou inputted: \"+_\n```\n\nStringed also have output, which is pretty weird. It is explained below.\n\n```txt\n\"some\"+\"thing\"\n```\n\nWhen not dealing with input, we could think of stringed code as an expression and it output whatever it evaluates to. The example above could be imagined as the following pseudo-code:\n\n```txt\nprint(\"some\" + \"thing\")\n```\n\nBut this is what stringed actually does:\n\n```txt\nprint(\"some\")\nprint(\"thing\")\n```\n\nEvery stringed operation have 2 modes: evaluation and execution. Evaluation means it will be evaluated normally as an operation, it does what explained earlier, and it evaluates to a string. Execution means it is executed, it may output something, and it doesn't evaluates to any value.\n\n| Operation | Execution                                               |\n| --------- | ------------------------------------------------------- |\n| Group     | It executes any expression inside                       |\n| Concat    | It executes each operand one by one                     |\n| Closure   | It evaluates its first operand then executes the second |\n| Eval      | It evaluates its operand then it is executed            |\n| any other | It is evaluated then outputted                          |\n\nStringed expression on top level are executed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneverrare%2Fstringed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneverrare%2Fstringed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneverrare%2Fstringed/lists"}