{"id":21905416,"url":"https://github.com/raffayk/just-in-time-compiler","last_synced_at":"2025-03-22T07:17:55.328Z","repository":{"id":240765165,"uuid":"803402180","full_name":"RaffayK/Just-In-Time-Compiler","owner":"RaffayK","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-20T16:54:41.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T07:28:51.594Z","etag":null,"topics":["compiler","compiler-construction","compiler-principles","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/RaffayK.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-20T16:48:43.000Z","updated_at":"2024-05-20T16:54:44.000Z","dependencies_parsed_at":"2024-05-20T20:11:34.778Z","dependency_job_id":"ea4275c5-2c81-4414-be10-30ec8a401eb1","html_url":"https://github.com/RaffayK/Just-In-Time-Compiler","commit_stats":null,"previous_names":["raffayk/just-in-time-compiler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaffayK%2FJust-In-Time-Compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaffayK%2FJust-In-Time-Compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaffayK%2FJust-In-Time-Compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaffayK%2FJust-In-Time-Compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RaffayK","download_url":"https://codeload.github.com/RaffayK/Just-In-Time-Compiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244918710,"owners_count":20531686,"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":["compiler","compiler-construction","compiler-principles","python"],"created_at":"2024-11-28T16:33:18.888Z","updated_at":"2025-03-22T07:17:55.281Z","avatar_url":"https://github.com/RaffayK.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Just-In-Time-Compiler\n\n1. **Problem Specification**: Building a programming language for learning compiler workings.\n   \n2. **Specification of Rules \u0026 Attributes**: Defining data types, keywords, syntax rules, comments, operators, and constructs like loops, conditionals, functions, etc.\n\n3. **Specification of Programming Language Constructs**: Covers sequences, selections, and iterations, fundamental for program design.\n\n4. **Possible Techniques to Implement Lexical Analyzer**: Methods like Finite State Automata, Regular Expressions, Table-Driven, or Hybrid approach.\n\n5. **Available Techniques/Algorithms to Implement Parser**: Includes Recursive Descent, LL(k), LR Parsing, Earley Parsing, etc.\n\n6. **Selected Parsing Technique and Application with Examples**: Opting for LL(1) parser for simplicity, efficiency, and predictive parsing capabilities, with examples of its applications.\n\n7. **Description of Errors for Each Phase**: Covers errors in Lexical Analysis, Syntax Analysis, Semantic Analysis, Code Generation, and Linking.\n\n8. **Description of All Semantic Rules**:\n   \nSemantic rules describe the meaning of the symbols and structures in a language and are used to check \nthe semantic correctness of a program. These rules are used during the semantic analysis phase of the \ncompiler to ensure that the program is semantically valid and to generate appropriate intermediate \nrepresentations.\nSome examples of semantic rules include:\n Type checking: This rule checks that the types of operands match the expected types of the \noperation being performed. For example, an operation that expects two integers as operands will \nraise an error if one of the operands is a floating-point number.\n Variable declaration: This rule checks that a variable has been declared before it is used and that \nit has a unique identifier.\n Scope resolution: This rule checks that variables and functions are used in the correct scope and \nthat their visibility is respected.\n Function call: This rule checks that the number of arguments passed to a function matches the \nnumber of parameters expected by the function and that the types of the arguments match the \ntypes of the parameters.\n Array access: This rule checks that the index used to access an array is within the bounds of the \narray.\n Constant folding: This rule evaluates constant expressions at compile time and replaces them \nwith their values.\n Constant propagation: This rule propagates the values of constants throughout the program and \neliminates dead code.\n Control flow analysis: This rule checks that the program has a well-defined control flow and that \nall branches of the program are reachable and terminates.\n Overloading resolution: This rule checks that the correct version of an overloaded function is \ncalled based on the types of the arguments passed.\n Inheritance: This rule checks that a subclass inherits the properties and methods of its superclass \nand that it respects the visibility and accessibility of the inherited members.\n Memory management: This rule checks that the program does not leak memory and that all \ndynamically allocated memory is freed when it is no longer needed.\n Threading: This rule checks that the program does not have race conditions or deadlocks when \nusing threads.\nAll these rules are used by the compiler to ensure that the program is semantically valid and that it will \nbehave as expected. However, the set of semantic rules varies from language to language and from \ncompiler to compiler and some languages may have additional semantic rules that are specific to their \ndesign and purpose.\nIt's worth noting that the semantic rules are not always enforced by the compiler but by the language's \nruntime or interpreter. For instance, some languages like python don't have strict typing rules and the \ntype checking is done at runtime.\nAdditionally, semantic rules are not always deterministic and sometimes the compiler or the interpreter \nmay have multiple options for resolving a semantic issue. In these cases, the compiler or the interpreter \nmay use heuristics or conventions to make a choice, sometimes even with a configuration options to \nadjust the behavior to the user's needs.\nOverall, semantic rules play a crucial role in ensuring that the program is semantically correct and that it \nwill behave as intended. The set of semantic rules varies depending on the language and the compiler, \nand they are used to check the semantic correctness of the program and to generate appropriate \nintermediate representation\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraffayk%2Fjust-in-time-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraffayk%2Fjust-in-time-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraffayk%2Fjust-in-time-compiler/lists"}