-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite Compiler #23
Merged
Merged
Rewrite Compiler #23
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mertcandav
added
documentation
Improvements or additions to documentation
compiler/runtime
Related with runtime
proposal
A proposal for new feature or changings
compiler
Related with compiler/compile-time
labels
May 24, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
compiler/runtime
Related with runtime
compiler
Related with compiler/compile-time
documentation
Improvements or additions to documentation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rewrite JuleC
This PR includes a redeveloped form of the compiler from scratch. Various enhancements and improvements are available. However, a number of problems have also been resolved.
The reason why the compiler was rewritten is undoubtedly because the code base is bad and difficult to maintain and add/improve features. While this is of course a relatively subjective concept, with the compiler re-development the source code is made more readable and easier to maintain.
Changes
Listed above are the main changes. The code base has been almost completely revamped and improved. However, a few features that have been removed may be reimplemented at a later time. These are not permanent removals.
Cycles
One of the things that the old compiler doesn't do or does is superficial is the detection of illegal cycles. This new compiler; Adds full illegal cycle checking for type aliases, variables, and structs. The order of related definitions in the source code may be completely different, but in code generation they are generated sequentially, in an order that they follow their dependencies. Also, type aliases have been removed from the generated source code, using direct types instead.
Generic Types
Generic types are handled in completely different ways. In the old approach, C++ generic types were also used in the codes created for the C++ code base. Obviously, this brought with it many problems. For example, although some types were suitable for Duck Typing, their functioning in C++ was not the same as other types. This actually paved the way for code generated in situations like Duck Typing to potentially cause bugs.
In the new approach, the generated C++ code is handled completely free of generic types. Each unique type combination handles differently and generates code differently. Each combination uses the custom code base that has been checked and built for itself. For functions and structures that use generic types, this means generating unique code for each combination.