-
Notifications
You must be signed in to change notification settings - Fork 5
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
Jvav 20240922 Internal Update #27
Merged
Merged
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
…into remove-shared
Signed-off-by: heckerpowered <[email protected]>
heckerpowered
added a commit
that referenced
this pull request
Sep 22, 2024
This reverts commit fb7ccb0.
Zopiclone-main
approved these changes
Sep 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
更新日志
智能指针
在此次更新中,移除了所有shared_ptr的使用,改为原始指针
字面量滥用
在先前的版本中,允许对字面量类型(Literal)进行运算,并对储存的结果进行了精度/符号上的区分,经高人指点,字面量类型已被重构,目前仅能储存字符串、浮点数、无符号整数、布尔值,且字面量类型不支持运算,需将其转换为常量后进行计算。
感谢 @Adttil
代码现代化
Mamba的代码经过重构,更加高效,更加现代化。例如,先前获取SyntaxNode的所有子节点时,返回的是一个副本,这导致了额外的内存分配以及不必要的复制,改进过后的SyntaxNode在获取子节点时返回一个范围,范围内的元素直接对应了节点的储存,避免了额外的内存分配及复制。
此外,现代化的Mamba代码还更加强调视图的概念,例如每个SyntaxNode都对应了Jvav源代码中的某一部分,SyntaxNode会储存它们的视图而非复制,这样既高效也避免了额外的分配及复制。SyntaxTree也经过重构,现在更加简洁。
内部编译器错误
此次更新添加了“内部编译器错误”的概念,在Mamba遇到部分意外情况退出时可以输出信息已帮助改进。
本地化
经 @Awu-Miao 的建议,此项目添加了对中文的支持,所有编译器诊断目前已经改为中文,稍后会添加多语言的支持,工作草案也计划改为中文。
编译器诊断
现在Mamba支持更加现代化的编译器诊断。
上述代码输出以下诊断:
移除对链接器的支持
Jvav计划可以将Jvav源代码编译到MSIL,并交由.NET编写的链接器来生成二进制,但现决定移除.NET链接器并在稍晚时间重构并重新支持。
LLVM 后端
改进后的Mamba已接入LLVM后端,但还未实现代码生成功能。
使用LLVM后端来实现代码生成是目前最优先的选项。
错误修复
修复了一个有关作用域的编译器实现错误。
CMake 支持
XMake的功能很强大,但考虑到使用CMake的人数居多,现已添加了对CMake的支持。
工作草案
改进了标准草案,添加了封面和目录。