{"id":40497280,"url":"https://github.com/itay2805/vork","last_synced_at":"2026-01-20T19:00:36.734Z","repository":{"id":89411068,"uuid":"212652475","full_name":"Itay2805/Vork","owner":"Itay2805","description":"A V compiler and interpreter","archived":false,"fork":false,"pushed_at":"2019-11-24T10:36:13.000Z","size":374,"stargazers_count":28,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-11-01T18:24:19.432Z","etag":null,"topics":["interpreter","lark-parser","parser","v","vlang"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Itay2805.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}},"created_at":"2019-10-03T18:39:45.000Z","updated_at":"2025-04-11T14:24:03.000Z","dependencies_parsed_at":"2023-10-20T21:31:38.670Z","dependency_job_id":null,"html_url":"https://github.com/Itay2805/Vork","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Itay2805/Vork","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Itay2805%2FVork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Itay2805%2FVork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Itay2805%2FVork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Itay2805%2FVork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Itay2805","download_url":"https://codeload.github.com/Itay2805/Vork/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Itay2805%2FVork/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28609548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["interpreter","lark-parser","parser","v","vlang"],"created_at":"2026-01-20T19:00:18.966Z","updated_at":"2026-01-20T19:00:36.718Z","avatar_url":"https://github.com/Itay2805.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vork\r\n\r\nVork will eventually be a fully fledged V implementation.\r\n\r\nRight now it is just a parser, once I get a full parser then I will start working on code gen.\r\n\r\n## Example\r\nfor now all that it does is read in a file and try to parse it. Right now there is no error\r\nrecovery on a syntax error, but there is a nice printout so you can hopefully understand what went wrong.\r\n\r\nThe parse output will be printed and is formated in a lisp like way\r\n\r\n```v\r\nfn fib(n int) int {\r\n        if n \u003c= 1 {\r\n                return n\r\n        }\r\n        return fib(n - 1) + fib(n - 2)\r\n}\r\n\r\nfn main() {\r\n        i := 0\r\n        for i = 0; i \u003c 10; ++i {\r\n                println(fib(i))\r\n        }\r\n}\r\n```\r\n\r\n```lisp\r\n(func fib ((n int)) int\r\n  (block\r\n    (if (\u003c= n 1)\r\n      (block\r\n        (return n)))\r\n    (return (+ (call fib ((- n 1))) (call fib ((- n 2)))))))\r\n(func main () \r\n  (block\r\n    (var (i) 0)\r\n    (for (= i 0) (\u003c i 10) (prefix ++ i)\r\n      (block\r\n        (call println ((call fib (i))))))))\r\n```\r\n\r\n## Formal grammar\r\nThe [lark](v.lark) file has an old formal grammar I defined which I am going to keep as a reference, maybe after finishing the hand written parser I will go back and rewrite the formal grammar to be updated.\r\n\r\nhopefully by the done I am finished with the parser the (official) formal grammar will be out already :shrug:\r\n\r\n## Implemented\r\n* All binary and unary expressions\r\n    * post fix operators are not added to the ast yet\r\n    * Function calls can not take `mut` modifier to expression for now\r\n* Almost full type parsing support\r\n    * missing function types\r\n* Functions, methods and interop functions\r\n    * missing generics\r\n    * missing multiple return value\r\n    * missing auto wrapping of optional values\r\n* Module and Imports\r\n* Structs with their access modifiers\r\n    * missing the base type\r\n    * missing generics\r\n* asserts\r\n* if\\if else\\else\r\n* Most of the for loops\r\n    * in c like for loops can not declare a variable at the start...\r\n    * missing for with only condition (`for true`)\r\n* Constants\r\n* Variable declarations\r\n* Enums declarations \r\n* Integer, Float and arrays literals\r\n* or statement\r\n* Super basic type checking\r\n    * missing mut checks\r\n    * missing unsafe checks\r\n    * missing access checks (pub)\r\n    * missing implicit enum\r\n\r\n## Missing\r\n* string and map\r\n* interfaces\r\n* match\r\n* go statement\r\n* attributes\r\n* compile time if\r\n\r\n## Problems\r\nRight now the parser ignores new lines **completely**, that is because from what I could see the official V compiler also does that, but in an inconsistent way... sometimes it ignores it and sometimes not...\r\n\r\nfor the most part it is not actually a problem, but specifically for the `*` operator it makes a problem, because it is used both for deref and for multipication\r\n```v\r\na := 123\r\nb := \u0026a\r\n*b = 456\r\n```\r\nwill not give the correct output! \r\n\r\nthe simplest way to get around it for now is to simply seround it with a block\r\n```v\r\na := 123\r\nb := \u0026a\r\n{*b = 456}\r\n```\r\n\r\nbut the real solution is to wait for a formal grammar and see how newlines should actually be handled.\r\n\r\nnote that this problem happens on any operator which may be used in both unary and binary way, including `-` and alike...","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitay2805%2Fvork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitay2805%2Fvork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitay2805%2Fvork/lists"}