{"id":22513793,"url":"https://github.com/aliiahmadi/apl","last_synced_at":"2025-06-17T14:36:16.150Z","repository":{"id":208738252,"uuid":"718951219","full_name":"AliiAhmadi/APL","owner":"AliiAhmadi","description":"Ahmadi programming language","archived":false,"fork":false,"pushed_at":"2023-12-26T06:11:15.000Z","size":105,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T11:22:11.793Z","etag":null,"topics":["ahmadi-programming-language","golang","new-language","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Go","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/AliiAhmadi.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":"2023-11-15T05:56:59.000Z","updated_at":"2024-01-24T20:14:06.000Z","dependencies_parsed_at":"2023-12-17T07:37:56.541Z","dependency_job_id":null,"html_url":"https://github.com/AliiAhmadi/APL","commit_stats":null,"previous_names":["aliiahmadi/ahmadi","aliiahmadi/apl","lexurr/apl"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/AliiAhmadi/APL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliiAhmadi%2FAPL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliiAhmadi%2FAPL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliiAhmadi%2FAPL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliiAhmadi%2FAPL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AliiAhmadi","download_url":"https://codeload.github.com/AliiAhmadi/APL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliiAhmadi%2FAPL/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260380624,"owners_count":23000312,"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":["ahmadi-programming-language","golang","new-language","programming-language"],"created_at":"2024-12-07T03:14:29.694Z","updated_at":"2025-06-17T14:36:11.139Z","avatar_url":"https://github.com/AliiAhmadi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](https://github.com/AliiAhmadi/APL/assets/107758775/46a9faa6-7bed-4915-879e-56c20bcc3b1e)\n\n# APL\n\nAhmadi programming language is a language under development. This language is like high-level programming languages used today and it is a interpreted language. \nAPL is also dynamically typed language. At this point only support structured and functional paradigm.\n\n\u003e [!WARNING]  \n\u003e Do not use this language in your projects. This language is for fun now :)\n\n### Setup and use REPL\n\n```zsh\n# Clone APL source code.\ngit clone https://github.com/AliiAhmadi/APL.git\n```\n\nNavigate to APL directory and run tests.\n```zsh\ngo test ./... -v\n```\n\nNow compile source and use executable file.\n```zsh\ngo build -o APL\n```\n\n### Features\n\nNow is the time to use it and doing some evaluation:\n\n```APL\nAhmadi programming language - Copyright (c) 2023 Ali Ahmadi\n\nAPL\u003e\u003e \n```\n\nIn APL we can define a new variable of any type with `def` keyword(even functions and closures - in following):\n\n```APL\nAPL\u003e\u003e def age = 20;\nnull\nAPL\u003e\u003e def name = \"Ali\";\nnull\nAPL\u003e\u003e \n```\n\nAs you know to see value of a variable just type its identifier:\n\n```APL\nAPL\u003e\u003e age\n20\nAPL\u003e\u003e name\nAli\nAPL\u003e\u003e \n```\n\nAPL also support numerical calculations and most important operations will work with values or with identifiers (- / * +):\n\n```APL\nAPL\u003e\u003e 2 * 12\n24\nAPL\u003e\u003e 56 / 7\n8\nAPL\u003e\u003e def x = 100;\nnull\nAPL\u003e\u003e def y = 20;\nnull\nAPL\u003e\u003e x + y\n120\nAPL\u003e\u003e x * y\n2000\nAPL\u003e\u003e x - y\n80\nAPL\u003e\u003e y - x\n-80\nAPL\u003e\u003e \n```\n\nYou can define your `array` and `map` with `def` keyword in APL and use indexing like other programming language to access items:\n\n```APL\nAPL\u003e\u003e def arr = [100, 300, 200, 500];\nnull\nAPL\u003e\u003e arr[0];\n100\nAPL\u003e\u003e \n```\n\nYou can define multidimensional arrays:\n\n```APL\nAPL\u003e\u003e def first = [[1, 2]];\nnull\nAPL\u003e\u003e def second = [[4, 16], [5, 25]];\nnull\nAPL\u003e\u003e def result = (first[0][1] * second[1][0]) + second[0][0];\nnull\nAPL\u003e\u003e result\n14\nAPL\u003e\u003e \n```\nAs you can see should use parentheses to specify precedence of expressions (by default parser will have precedence like below):\n| operations      |\n|-----------------|\n| Index           |\n| Function call   |\n| Prefix          |\n| Product         |\n| Sum             |\n| Less \\| Greater |\n| Equality        |\n\nNow lets work with `map` data type in APL and also combine mutiple string(concatenating):\n\n```APL\nAPL\u003e\u003e def mp = {\"name\": \"Ali\", \"family\": \"Ahmadi\", \"age\": 20, \"country\": \"IR.\"};\nnull\nAPL\u003e\u003e mp[\"name\"]\nAli\nAPL\u003e\u003e mp[\"age\"]\n20\nAPL\u003e\u003e mp[\"name\"] + \" \" + mp[\"family\"] + \" from \" + mp[\"country\"]\nAli Ahmadi from IR.\nAPL\u003e\u003e \n```\nNow lets take a look at functions and closures in APL. Note that in APL you can write nested functions. In APL functions will define with `fun` keyword:\n\n```APL\nAPL\u003e\u003e def adder = fun(x, y) { return x + y; };\nnull\nAPL\u003e\u003e adder(100, 23);\n123\nAPL\u003e\u003e \n```\n\nAlso you can return a closure from a function and store it in a variable:\n\n```APL\nAPL\u003e\u003e def outer_function = fun() { return fun() { return \"this is from inner function\"; }; };\nnull\nAPL\u003e\u003e def inner_function = outer_function();\nnull\nAPL\u003e\u003e inner_function();\nthis is from inner function\nAPL\u003e\u003e \n```\n\nIf you want to see structure of a object in APL can write it down simply and it will printed:\n\n```APL\nAPL\u003e\u003e def arr = [1, 2, 3, 4, 5];\nnull\nAPL\u003e\u003e arr\n[1, 2, 3, 4, 5]\nAPL\u003e\u003e \n```\n\n```APL\nAPL\u003e\u003e def mp = {\"name\":\"APL\", \"version\":\"1.0.0\"};\nnull\nAPL\u003e\u003e mp\n{name: APL, version: 1.0.0}\nAPL\u003e\u003e \n```\n\n```APL\nAPL\u003e\u003e true\ntrue\nAPL\u003e\u003e false\nfalse\nAPL\u003e\u003e \n```\n\n```APL\nAPL\u003e\u003e def adder = fun(x, y, z) { return x + y + z; };\nnull\nAPL\u003e\u003e adder\nfun(x, y, z) {\nreturn ((x + y) + z);\n}\nAPL\u003e\u003e \n```\n\n```APL\nAPL\u003e\u003e def ad_mp = {\"func\": fun(x, y) { return x * y; }};\nnull\nAPL\u003e\u003e ad_mp\n{func: fun(x, y) {\nreturn (x * y);\n}}\nAPL\u003e\u003e ad_mp[\"func\"](12, 13);\n156\nAPL\u003e\u003e \n```\n\n```APL\nAPL\u003e\u003e def x = 18;\nnull\nAPL\u003e\u003e x == 18\ntrue\nAPL\u003e\u003e x != 18\nfalse\nAPL\u003e\u003e \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliiahmadi%2Fapl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliiahmadi%2Fapl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliiahmadi%2Fapl/lists"}