{"id":19110108,"url":"https://github.com/laluxx/jade","last_synced_at":"2026-02-11T02:04:53.075Z","repository":{"id":242142187,"uuid":"808765005","full_name":"laluxx/jade","owner":"laluxx","description":"a C abstraction","archived":false,"fork":false,"pushed_at":"2025-10-21T21:15:50.000Z","size":48,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-21T23:24:39.050Z","etag":null,"topics":["programming-language","transpiler"],"latest_commit_sha":null,"homepage":"","language":"C","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/laluxx.png","metadata":{"files":{"readme":"README.org","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-31T19:11:13.000Z","updated_at":"2025-10-21T21:15:54.000Z","dependencies_parsed_at":"2024-06-05T17:59:52.733Z","dependency_job_id":"2f769cba-1fb0-4158-9ab2-b29fe3aeddfe","html_url":"https://github.com/laluxx/jade","commit_stats":null,"previous_names":["laluxx/jade"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/laluxx/jade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laluxx%2Fjade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laluxx%2Fjade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laluxx%2Fjade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laluxx%2Fjade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laluxx","download_url":"https://codeload.github.com/laluxx/jade/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laluxx%2Fjade/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29325366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T00:34:26.354Z","status":"online","status_checked_at":"2026-02-11T02:00:08.436Z","response_time":97,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["programming-language","transpiler"],"created_at":"2024-11-09T04:23:39.541Z","updated_at":"2026-02-11T02:04:53.069Z","avatar_url":"https://github.com/laluxx.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: TODO's\n\nTODO ability to convert c to jade and jade to c,\nwhen converting from c to jade remember the initial c input and compile to exactly that\n\n* Features to implement\n#+BEGIN_SRC rust\n  // NOTE Each function in an implementation will be translated as name_name\n  // e.g. \"Camera_add\"\n  // so we can have more than one function with the same name\n\n  // TODO Implicit return like Rust\n\n  type Camera {\n      int x;\n      int y;\n  };\n\n  impl Camera {\n      fn add(int x) {\n          self.x += x;\n      }\n\n  }\n\n  fn main() -\u003e i32 {\n      Camera camera;\n      camera.add(10);\n      Camera.add(\u0026camera, 10);\n      return 0;\n  }\n\n\n  // PATTERN MATCHING\n  rec fn last_char_in_string(string:str) -\u003e char {\n      match string {\n          [] -\u003e error!(\"empty string\");\n          [x] -\u003e x;\n          [_::xs] -\u003e last_char_in_string(xs);\n      }\n  }\n\n  rec fn last_in_array(array:[]i32) -\u003e i32 {\n      match array {\n          [] -\u003e error!(\"empty array\");\n          [x] -\u003e x;\n          [_::xs] -\u003e last_in_array(xs);\n      }\n  }\n\n  //                               maybe α\n  //                                 ^\n  rec fn last_in_list(list:()i32) -\u003e !i32 {\n      match list {\n          () -\u003e NONE;\n          (x) -\u003e x;\n          (_::xs) -\u003e last_in_list(xs);\n      }\n  }\n\n\n\n  let iarr:[10]i32 = {1,1,1,1,1,1}; // denoted array of 10 ints // NOTE {0} by default\n  let farr:[_] = {1.0, 1.1, 1.2}; // inferred as 3 floats\n  let farr:[] = {1.0, 1.1, 1.2}; // inferred as floats but not 3 there could be as many as we want\n  let carr:[2] = {\"two\", \"strings\"}; // inferred as strings\n\n  struct Vec2i { // NOTE will be a simple struct\n      x:i32;\n      y:i32;\n  }\n\n\n\n  asm { // NOTE asm src block in emacs jade-mode\n      mov %1, %0;\n      add $1, %0;\n      =r (dst);\n      r (src);\n  }\n\n  asm (\"mov %1, %0\\n\\t\"\n       \"add $1, %0\"\n       : \"=r\" (dst)\n       : \"r\" (src));\n\n  #+END_SRC\n\n* Bugs\nNOTE This version is more correct than the one currently used\nsince it passes only the actual value of the variable to infer_type_from_value()\nfor example \"29\" instead of \"29;  // comment\" but in this version comments are lost.\n#+begin_src C\n        // Transpile variable declarations\n        char *trimmed_line = line;\n        while (*trimmed_line == ' ' || *trimmed_line == '\\t') {\n            trimmed_line++;\n        }\n        if (strstr(trimmed_line, \"let \")) {\n            char var_name[MAX_LINE_LENGTH];\n            char var_type[MAX_LINE_LENGTH] = \"\"; // Initialize empty in case type is inferred\n            char var_value[MAX_LINE_LENGTH] = \"\";\n\n            // Check if an explicit type is provided\n            if (strstr(trimmed_line, \":\")) {\n                sscanf(trimmed_line, \"let %[^:]:%s = %[^\\n]\", var_name, var_type, var_value);\n            } else {\n                sscanf(trimmed_line, \"let %s = %[^\\n]\", var_name, var_value);\n            }\n\n            // Remove any trailing semicolon and comments from the original code\n            char *semicolon_pos = strchr(var_value, ';');\n            if (semicolon_pos) {\n                *semicolon_pos = '\\0';\n            }\n\n            // Trim trailing whitespace from the value\n            char *end_ptr = var_value + strlen(var_value) - 1;\n            while (end_ptr \u003e var_value \u0026\u0026 (*end_ptr == ' ' || *end_ptr == '\\t')) {\n                *end_ptr = '\\0';\n                end_ptr--;\n            }\n\n            // Infer the type if not explicitly provided\n            if (strlen(var_type) == 0) {\n                strcpy(var_type, infer_type_from_value(var_value)); // Infer the type from the value\n            }\n\n            // Map custom types or use inferred types\n            const char *c_type = strlen(var_type) \u003e 0\n                ? map_type(var_type)\n                : infer_type_from_value(var_value);\n\n            if (in_function) {\n                print_indentation(output_file, trimmed_line - line);\n            }\n            if (strlen(var_value) \u003e 0) {\n                fprintf(output_file, \"%s %s = %s;\\n\", c_type, var_name, var_value);\n            } else {\n                fprintf(output_file, \"%s %s;\\n\", c_type, var_name);\n            }\n            continue;\n        }\n#+end_src\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaluxx%2Fjade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaluxx%2Fjade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaluxx%2Fjade/lists"}