{"id":21662853,"url":"https://github.com/ktravis/trout-script","last_synced_at":"2025-03-20T05:48:59.967Z","repository":{"id":27466785,"uuid":"30945949","full_name":"ktravis/trout-script","owner":"ktravis","description":"Compiled, strongly-typed scripting language written in javascript.","archived":false,"fork":false,"pushed_at":"2015-10-18T19:03:29.000Z","size":216,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T07:27:33.301Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ktravis.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}},"created_at":"2015-02-18T00:47:49.000Z","updated_at":"2016-05-11T10:06:44.000Z","dependencies_parsed_at":"2022-09-02T07:51:06.680Z","dependency_job_id":null,"html_url":"https://github.com/ktravis/trout-script","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktravis%2Ftrout-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktravis%2Ftrout-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktravis%2Ftrout-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktravis%2Ftrout-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktravis","download_url":"https://codeload.github.com/ktravis/trout-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244560373,"owners_count":20472219,"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-25T10:18:23.257Z","updated_at":"2025-03-20T05:48:59.941Z","avatar_url":"https://github.com/ktravis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trout-script\nCompiled, strongly-typed scripting language written in javascript.\n\n*This was my first (real) attempt at writing a full programming language.\nI learned a lot in the process, and will eventually return to make it stable and\nclean everything up.*\n\n## Features\n\n- strictly typed variables\n- runtime within Javascript\n- compiler emits 'runtime operations' as js\n- struct types\n- function closures\n- explicit control of context within closures\n- readable, unambiguous syntax\n\n## Examples\n\n  ```c\n  var x = 1  // inferred type\n  var y:int  // not initialized, but declared\n  var hello:string\n  hello = \"world\"\n  \n  struct Node {\n    val:string\n    next:Node   // struct allows recursive definition\n  }\n\n  struct vec {\n    x:int = 0,  // default values\n    y:int = 0\n  }\n\n  // functions declared with 'fn' and '(' arguments ')'\n  fn factorial(x:int) int { // return type can be inferred by compiler\n    var out = 1             // specified following arguments\n    loop (x \u003e 0) {\n      out *= x--\n    }\n    return out\n  }\n  print('fact(10) = '|to_string(factorial(10))) // '|' concatentates strings\n\n  var head:Node // structs are initialized when declared\n  head.val = \"I'm first\"\n  var next:Node\n  next.val = \"I'm next\"\n  head.next = next\n\n  loop {\n    if (head.next == null) {\n      break\n    } else {\n      print(head.val)\n      head = head.next\n    }\n  }\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktravis%2Ftrout-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktravis%2Ftrout-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktravis%2Ftrout-script/lists"}