{"id":22120955,"url":"https://github.com/alphaharrius/veil","last_synced_at":"2025-03-24T06:44:24.742Z","repository":{"id":54289878,"uuid":"522117844","full_name":"Alphaharrius/Veil","owner":"Alphaharrius","description":"The implementation of the Veil programming language.","archived":false,"fork":false,"pushed_at":"2023-03-22T05:26:29.000Z","size":343,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T12:29:21.731Z","etag":null,"topics":["cpp","cpp17","custom-language","language-runtime","programming-exercises","programming-language"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alphaharrius.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-07T04:46:11.000Z","updated_at":"2023-12-01T06:52:00.000Z","dependencies_parsed_at":"2024-12-01T14:42:21.919Z","dependency_job_id":null,"html_url":"https://github.com/Alphaharrius/Veil","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/Alphaharrius%2FVeil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alphaharrius%2FVeil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alphaharrius%2FVeil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alphaharrius%2FVeil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alphaharrius","download_url":"https://codeload.github.com/Alphaharrius/Veil/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245224172,"owners_count":20580362,"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","cpp17","custom-language","language-runtime","programming-exercises","programming-language"],"created_at":"2024-12-01T14:31:44.913Z","updated_at":"2025-03-24T06:44:24.717Z","avatar_url":"https://github.com/Alphaharrius.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Veil\n\nVeil is planned to be a gradually typed, and multi-paradigm programming language supports both object-oriented \u0026 functional programming.\n\nThis project serves as an exercise on ```C++``` and a way to learn how a programming language with a runtime could work under the hood.\nMy current goal of this project is to complete the runtime, then implement a simple compiler in whatever language I feel comfortable in\n(```Python``` or ```Java```), and re-implement the compiler in Veil language as a proof of principle.\n\nOfcoz there is a much harder quest to implement a just-in-time compiler targeting branches (or I should say it is a trace JIT), which\nbased on a exposed compiler interface in the runtime, so that we can support any type of compiler backend. The JIT will most likely be\nbuilt with a language with memory-safety, maybe in ```Rust``` or even in ```Veil``` itself...\n\n## The Fabric runtime\n\nThe Fabric runtime is for running the Fabric bytecode generated by a compiler from the Veil code, and is implemented\nby C++, is designed from the ground up to support multi-threaded environment. And to be fully embeddable into other ```C++```\nprojects, there will be no globally defined states.\n\nTo keep the code structure as clear as possible, I planned to use the fully power of OOP provided by ```C++```, and leave all rooms of\nperformance enhancements \u0026 optimizations to the JIT compiler.\n\nFuture prospects includes adding a JIT compiler, rewrite part of the VM service code base using Veil... etc.\n\n### Structure Diagram\n\n![image](https://user-images.githubusercontent.com/47113671/218408370-62ccc500-b42c-4ad9-a5a5-44ebfab9e195.png)\n\n### Naming conventions\n\n- Namespaces: ```lowercase``` single word.\n- Class: ```CamelCase```\n- Methods: ```snake_case```, with single words for public action methods; multi-word for private methods or methods\n           that are not supposed to be used or exposed outside of class scope.\n- Variables: ```snake_case``` and better to be verbose with at least one ```_``` to avoid collision with comments.\n- Attributes: ```snake_case``` and better to be verbose with at least one ```_``` to avoid collision with comments.\n- Constants: ```ALL_CAPS``` and use keyword ```const``` but not macros.\n- Structs: ```CamelCase``` as a multi-part wrapper; ```snake_case_t``` as a primitive capsule.\n- Macros: ```CamelCase```\n- Labels: ```CamelCase```\n\n### Code structure\n\n- Integer like types in the code should use the ```typedef``` defined types in ```fabric/src/typedefs.hpp```.\n- All error code of the VM runtime should be type ```uint32``` and reside in a namespace specific for their usage, and\n  defined only in ```fabric/src/errors.hpp```.\n- Except for special header files, all code under a subdirectory of ```fabric/src``` should be defined in a\n  specific ```namespace```.\n- All native or OS related platform specific code of a subdirectory of ```fabric/src``` should all be placed\n  within ```os.hpp``` \u0026 ```os.cpp```, and reside in the namespace of ```veil::os```.\n- Platform specific methods under the namespace of ```veil::os``` should all contain an error return\n  parameter: ```some_native_method(..., uint32 \u0026error)```.\n- All ```class``` that will be part of the VM structure should either be a subtype of ```HeapObject```\n  , ```Arenaobject``` or ```ValueObject```.\n\n### Implementation roadmap\n\n1. [ ] Implement utility structures.\n   - [ ] ```ArrayList```\n\n2. [ ] Implement the memory management.\n    - [x] Implement the core modules.\n        - [x] ```Management```\n        - [x] ```Pointer```\n        - [x] ```Allocator```\n        - [x] Interface of ```Algorithm```\n    - [ ] Implement the standard management algorithm.\n\n3. [ ] Implement all encapsulations of OS specific threading primitives.\n    - [ ] ```Thread```\n      - [x] Implement the basic encapsulations.\n      - [x] Able to execute a ```VMService```.\n      - [ ] Priority settings for all OS threads.\n    - [x] ```Mutex```\n    - [x] ```ConditionVariable```\n    - [x] Atomics\n    - [x] Add handling for spurious wakeup of ```ConditionVariable```.\n\n4. [x] Implement VM specific threading primitives.\n    - [x] A low object memory footprint queue-based thread synchronization primitive ```OrderedQueue```.\n\n5. [x] Exchange all existing usage of ```\u003catomic\u003e``` and ```\u003ccondition_variable\u003e``` to the encapsulations.\n    - [x] ```OrderedQueue```\n\n6. [ ] Implement the thread management.\n    - [x] All management's functionality should be protected by a mutex.\n      - This is a legacy requirement, since the management (aka. scheduler) is running a single threaded loop to process\n        all thread controls.\n    - [x] Service spawning \u0026 termination using the underlying thread.\n    - [x] Thread sleep \u0026 wake.\n    - [x] Thread interrupt.\n    - [x] Thread pause \u0026 resume.\n    - [ ] ```VMService``` joining with another ```VMService```.\n    - [x] Scheduler termination.\n\n7. [ ] Implement the Veil execution environment.\n    - [ ] Design the Veil VM bytecode specifications.\n    - [ ] Implement the Veil bytecode interpreter.\n    - [ ] Implement ```VeilThread```.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphaharrius%2Fveil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphaharrius%2Fveil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphaharrius%2Fveil/lists"}