{"id":27425660,"url":"https://github.com/jdm-github/jdm-language","last_synced_at":"2025-09-12T08:42:09.210Z","repository":{"id":195177951,"uuid":"687946518","full_name":"JDM-Github/jdm-language","owner":"JDM-Github","description":"JDMLanguage is my own language, it mainly created with ability to have freedom and constraint. It draws inspiration from Python's versatility while introducing its own distinctive features.","archived":false,"fork":false,"pushed_at":"2024-08-01T19:07:39.000Z","size":25900,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T12:09:17.188Z","etag":null,"topics":["cpp","jdm","lang"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JDM-Github.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-09-06T10:37:02.000Z","updated_at":"2025-03-24T09:05:09.000Z","dependencies_parsed_at":"2024-01-01T04:22:25.744Z","dependency_job_id":"b41212cc-ba3d-4ce0-a27f-c4bae38b3377","html_url":"https://github.com/JDM-Github/jdm-language","commit_stats":null,"previous_names":["jdm-github/jdm-language"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDM-Github%2Fjdm-language","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDM-Github%2Fjdm-language/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDM-Github%2Fjdm-language/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDM-Github%2Fjdm-language/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JDM-Github","download_url":"https://codeload.github.com/JDM-Github/jdm-language/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877960,"owners_count":21176244,"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":["cpp","jdm","lang"],"created_at":"2025-04-14T12:09:20.234Z","updated_at":"2025-04-14T12:09:21.753Z","avatar_url":"https://github.com/JDM-Github.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JDM Language\n\nJDM Language is langauge purely made in c++, This language is inspired in python where you can create a dynamic variable that can be\nchanged depend on what you want but in here you can create this in more secure manner.\n\n---\n\n### DataType\n- **jint** - ***INTEGER***\n- **jdouble** - ***DOUBLE***\n- **jstring** - ***STRING***\n- **jboolean** - ***BOOLEAN***\n- **jlist** - ***LIST***\n- **jmap** - ***MAP***\n- **jlambda** - ***FUNCTION***\n\n---\n\n### Keywords \n- **jconst** - Used to declare variables as constants.\n- **jforce** - Used to enforce a specific datatype, preventing type errors (e.g., jforce jint test = \"test\"; results in an error).\n- **jcforce** - Combines forcing a specific datatype with declaring it as a constant.\n- **jreverse**: Used to reverse the order of elements, typically in arrays or lists.\n- **jtrue**: Represents the boolean value `true`.\n- **jfalse**: Represents the boolean value `false`\n\n---\n\n### Control Flow\n- **jif** - Used for conditional statements.\n- **jelseif** - Used for additional conditional statements following an `jif` block.\n- **jelse** - Used to define an alternative block of code in case the condition of the preceding `jif` or `jelseif` statement is false.\n- **jfor** - Used to start a loop that iterates a specified number of times.\n- **jforeach** - Used to iterate over elements in a collection, such as arrays or lists.\n- **jwhile** - Used to create a loop that executes a block of code as long as a specified condition is true.\n- **jswitch** - Used to execute one out of multiple possible blocks of code based on the value of an expression.\n- **jcase** - Used within a `jswitch` block to define a specific case.\n- **jdefault** - Used within a `jswitch` block to define the default case, executed when no other `jcase` matches.\n- **jfunc** - Used to define a function or method.\n- **jreturn** - Used to exit from a function and optionally return a value to the caller.\n- **jbreak**: Used to exit from a loop or switch statement.\n- **jcontinue**: Used to skip the current iteration of a loop and proceed to the next iteration.\n\n---\n\n### Functions\n- **$log**: Outputs a log message.\n- **$logn**: Outputs a log message with a newline.\n- **$clear**: Clears the console or output.\n- **$sleep**: Pauses execution for a specified duration.\n- **$import**: Imports external files or modules.\n- **$include**: Include native package JDM provided.\n\n---\n\n### Comments\n\n- **|\u003e** - Used to comment 1 line.\n- **|-\u003e** - Used to open a comment block.\n- **\u003c-|** - Used to close a comment block.\n\n---\n\n# Usage\n### Example Usage for Control Flow Statements\n\n#### Example for `jif` Statement\n```jdm\njif (condition) =\u003e {\n    |\u003e Code block to execute if condition is true\n}\njelseif (condition) =\u003e {\n    |\u003e Code block to execute if previous conditions were false and this condition is true\n}\njelse =\u003e {\n    |\u003e Code block to execute if all previous conditions were false\n}\n```\n\n#### Example for `jfor` Statement\n```jdm\n|\u003e Syntax: jfor variable =\u003e [start, stop, step] =\u003e { code block }\n\n|\u003e Example 1: Start from 1, stop at 45, step by 1\njfor i =\u003e [1, 45, 1] =\u003e {\n    |\u003e Code to execute inside the loop with variable i\n}\n\n|\u003e Example 2: Start from 1, stop at 45 (step defaults to 1)\njfor i =\u003e 1, 45 =\u003e {\n    |\u003e Code to execute inside the loop with variable i\n}\n\n|\u003e Example 3: Stop at 45 (start defaults to 0, step defaults to 1)\njfor i =\u003e 45 =\u003e {\n    |\u003e Code to execute inside the loop with variable i\n}\n```\n\n#### Example for `jwhile` Statement, `jbreak` and `jcontinue`\n```jdm\njint count = 0;\njwhile (count \u003c 10) =\u003e\n{\n    |\u003e Code block to execute while count is less than 10\n    jif count == 5 =\u003e jcontinue;\n    jif count \u003e= 8 =\u003e jbreak;\n    count += 1;\n}\n```\n\n#### Example for `jforeach` Statement\n```jdm\njlist testList = [\"TESDT\", 0, 4, \"test\", 4.56, 2];\njmap  testMap  = {1 =\u003e \"Hello\", 2 =\u003e \"World\", 1 =\u003e \"TEST\"};\n\n$logn =\u003e \"FOREACH KEY ONLY\";\n$logn =\u003e \"MAP:\";\njforeach k =\u003e testMap =\u003e {\n\t$log =\u003e \"Key: \" =\u003e k =\u003e '\\n';\n}\n$logn =\u003e \"LIST:\";\njforeach v =\u003e testList =\u003e {\n\t$log =\u003e \"Value: \" =\u003e v =\u003e '\\n';\n}\n```\n\n#### Example for `jfunc` Statement, `jreturn` and `casting` \n```jdm\njfunc testFunction(jint arg1, arg2) =\u003e {\n\t$logn =\u003e arg1;\n\t$logn =\u003e gettype(arg2);\n\tjreturn arg1 + jint(arg2);\n}\n$logn =\u003e testFunction(20, \"50\");\n```\n\n---\n\n## Native Function\n\n#### Testing some of the Native Function\n```jdm\njfunc testFilterFunction( arg )        =\u003e jreturn arg % 2 == 0;\njfunc testReduceFunction( arg1, arg2 ) =\u003e jreturn arg1 + arg2;\njfunc testSortIfFunction( arg1, arg2 ) =\u003e jreturn arg1 \u003c arg2;\n\njlist testList = [1, 2, 3, 4, 5];\n$logn\n\t=\u003e \"input    : \" + jstring(input    (\"Test Input: \"))\n\t=\u003e \"split    : \" + jstring(split    (\"Test-Split\", \"-\"))\n\t=\u003e \"len      : \" + jstring(len      (testList))\n\t=\u003e \"abs      : \" + jstring(abs      (-436))\n\t=\u003e \"ceil     : \" + jstring(ceil     (34.3))\n\t=\u003e \"floor    : \" + jstring(floor    (34.3))\n\t=\u003e \"max      : \" + jstring(max      (testList))\n\t=\u003e \"min      : \" + jstring(min      (testList))\n\t=\u003e \"reverse  : \" + jstring(reverse  (testList))\n\t=\u003e \"round    : \" + jstring(round    (34.76))\n\t=\u003e \"sum      : \" + jstring(sum      (testList))\n\t=\u003e \"join     : \" + jstring(join     (testList, \" -\u003e \"))\n\t=\u003e \"index    : \" + jstring(index    (testList, 4))\n\t=\u003e \"randint  : \" + jstring(randint  (100, 200))\n\t=\u003e \"randfloat: \" + jstring(randfloat(10.0, 20.0))\n\t=\u003e \"filter   : \" + jstring(filter   (testList, testFilterFunction))\n\t=\u003e \"reduce   : \" + jstring(reduce   (testList, testReduceFunction))\n\t=\u003e \"sort_if  : \" + jstring(sort_if  (testList, testSortIfFunction))\n\t=\u003e \"chain    : \" + jstring(chain    (testList, testList, testList))\n\t=\u003e \"map      : \" + jstring(map      (testList, ( arg ) =\u003e { jreturn arg ** 2 } )) |\u003e Use anonymous function\n\t=\u003e \"gettype  : \" + jstring(gettype  (testFilterFunction))\n;\n```\n\n#### Testing some of the `jstring` function\n```jdm\njstring test = \"Hello World\";\n$logn =\u003e \"Size   : \" + test.size();\n$logn =\u003e \"Replace: \" + test.rreplace(\"o\", \"oo\");\n$logn =\u003e \"Concat : \" + test.rconcat(\"!\");\n$logn =\u003e \"Upper  : \" + test.rupper();\n$logn =\u003e \"Lower  : \" + test.rlower();\n$logn =\u003e \"Reverse: \" + test.rreverse();\n$logn =\u003e \"Compare: \" + test.compare(\"Hello, World\");\n$logn =\u003e \"Substr : \" + test.rsubstr(7, 5);\n$logn =\u003e \"Find   : \" + test.find(\"llo\");\n$logn =\u003e \"Count  : \" + test.count(\"o\");\n$logn =\u003e \"Empty  : \" + test.empty();\n$logn =\u003e \"StartsW: \" + test.startsw(\"Hello\");\n$logn =\u003e \"EndsW  : \" + test.endsw(\"World\");\n$logn =\u003e \"Insert : \" + test.rinsert(7, \"JD's \");\n$logn =\u003e \"Erase  : \" + test.rerase(7, 5);\n$logn =\u003e \"Trim   : \" + test.rtrim(2, 2);\n$logn =\u003e \"Token  : \" + test.tokenize(\"\\\\s+|,\\\\s*\");\n````\n---\n\n## Referencing Variable\n\n#### Example of Referencing Variable using `ref`\n```jdm\njint test = 10;\njany test2 = ref(test);\n\ntest = 20;\n$logn =\u003e test2;\n```\n\n#### Example of Referencing Variable in `jfunc` using `ref`\n```jdm\njfunc testFunc(arg) =\u003e {\n\targ += 10;\n}\njint test = 10;\ntestFunc(ref(test));\n$logn =\u003e test;\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdm-github%2Fjdm-language","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdm-github%2Fjdm-language","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdm-github%2Fjdm-language/lists"}