{"id":19764322,"url":"https://github.com/grahms/samora-lang","last_synced_at":"2025-07-06T04:33:53.649Z","repository":{"id":170072539,"uuid":"646178805","full_name":"GraHms/Samora-Lang","owner":"GraHms","description":"Samora Lang - A Simple Interpreted Programing Language just for Educational Purposes","archived":false,"fork":false,"pushed_at":"2023-10-31T05:06:12.000Z","size":12398,"stargazers_count":23,"open_issues_count":6,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-10-31T06:21:33.361Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/GraHms.png","metadata":{"files":{"readme":"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}},"created_at":"2023-05-27T14:39:19.000Z","updated_at":"2023-10-31T06:21:38.301Z","dependencies_parsed_at":"2023-10-31T06:21:35.253Z","dependency_job_id":null,"html_url":"https://github.com/GraHms/Samora-Lang","commit_stats":null,"previous_names":["grahms/latin","grahms/latin-lang","grahms/samora-lang"],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraHms%2FSamora-Lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraHms%2FSamora-Lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraHms%2FSamora-Lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraHms%2FSamora-Lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GraHms","download_url":"https://codeload.github.com/GraHms/Samora-Lang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224214019,"owners_count":17274524,"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":[],"created_at":"2024-11-12T04:13:26.290Z","updated_at":"2024-11-12T04:13:26.852Z","avatar_url":"https://github.com/GraHms.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Samora Lang\n\nSamora Lang is a simple and expressive programming language designed just for fun, mostly for learning purposes.\n\n\n## Getting Started\n\nTo get started with Samora Lang, follow these steps:\n\n1. Install the Samora Lang compiler and interpreter from the binary corresponding to your OS Architecture.\n\n### Arch Linux\nUsing the Arch User Repository\n```\n$   yay -S samora-lang\n```\n\n2. Write your Samora Lang code in a text editor or an integrated development environment (IDE).\n3. Save your Samora Lang code with a `.sml` extension.\n\n## Hello, World!\n\nTo familiarize yourself with Samora Lang, here's a \"Hello, World!\" example:\n\n```sml\nprint(\"Hello, World!\");\n```\n\n## Read a file from the filesystem\n```sml\nlet content = readFile(\"file.txt\")\nprintln(content)\n```\n## Write data to a file\n```sml\nlet data = \"This is some content\"\nwriteFile(\"file.txt\", data)\n```\n## Delete a file\n```sml\ndeleteFile(\"file.txt\")\n```\n\n## Create Directory\n```sml\nmakeDir(\"path\")\n```\n## Language Features\n\nSamora Lang boasts the following key features:\n\n### Recursion\n\nSamora Lang supports recursion, allowing functions to call themselves. This enables the solution of problems that can be divided into smaller, similar subproblems. Recursive algorithms and data structures can be implemented efficiently in Samora Lang.\n\n### Nested if Statements\n\nSamora Lang allows for nested if statements, providing the ability to have conditional statements within other conditional statements. This grants developers more control over the flow of their programs by allowing multiple conditions to be evaluated in a structured and hierarchical manner.\n\n### Closures\n\nClosures in Samora Lang enable functions to access and manipulate variables defined outside their own scope. They capture the environment in which they are created, retaining access to variables and their values. This feature allows for the creation of functions that can \"remember\" and operate on specific data, even after exiting their original scope.\n\n## Examples\n\nHere are some examples to illustrate the usage of Samora Lang's features:\n\n### Recursive Factorial Function\n\n```sml\nlet factorial = fn(n) {\n  if (n == 0) {\n    1;\n  } else {\n    n * factorial(n - 1);\n  }\n};\n\nlet result = factorial(5);\nprint(\"The factorial of 5 is: \", result);\n```\n\nIn this example, the `factorial` function calculates the factorial of a given number using recursion.\n\n### Closure Example\n\n```\nlet adder = fn(x) {\n  fn(y) {\n    x + y;\n  };\n};\n\nlet addTwo = adder(2);\nlet result = addTwo(3);\nprint(\"2 + 3 = \", result);\n```\n\nIn this example, the `adder` function returns a closure that adds the provided value `x` to any value `y` passed to it. The closure `addTwo` adds 2 to its argument `3` and returns the result `5`.\n\n### Single-line Comments Example\n\n```sml\n// This is a single-line comment.\n# This is also a single-line comment.\n```\n### Array Example\n\n```sml\nlet numbers = [1, 2, 3, 4, 5];\nprint(numbers[2]); \n```\n\nIn this example, an array `numbers` is created, and its third element (index 2) is accessed and printed.\n\n### Hash (Dictionary) Example\n\n```sml\nlet person = {\"name\": \"John\", \"age\": 25};\nprint(person[\"name\"]);\n```\n\nIn this example, a hash `person` is created with keys `\"name\"` and `\"age\"`. The value corresponding to the key `\"name\"` is accessed and printed.\n\n### Map and Reduce Example\n    ```sml\n    let numbers = [1, 2, 3, 4, 5];\n    let squared = map(numbers, fn(x) { x * x });\n    let sum = reduce(squared, fn(acc, x) { acc + x }, 0);\n    print(\"The sum of squared numbers is: \", sum);\n    ```\n## Contributing\n\nContributions to Samora Lang are welcome! If you find any issues, have ideas for improvements, or would like to add new features, please open an issue or submit a pull request on the official Samora Lang GitHub repository.\n\n## License\n\nSamora Lang\n\nis released under the [MIT License](https://opensource.org/licenses/MIT).\n\n## Acknowledgments\n\nSamora Lang was inspired by various programming languages and their respective communities. We would like to express our gratitude to all the contributors and developers who have played a role in shaping programming languages and making them accessible to a wide audience.\n\n## Contact\n\nFor any inquiries or questions, please contact the Samora Lang development team at [grahms@outlook.com]\n\n---\n\nFeel free to customize this README to include more details, provide installation instructions, and incorporate any other relevant information about your language.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrahms%2Fsamora-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrahms%2Fsamora-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrahms%2Fsamora-lang/lists"}