Proposal: Nanopass compiler support
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- compilers
Hướng nghiên cứu
Bắt đầu với đề xuất và luận án Nanopass được liên kết trong đó, cùng với tài liệu Racket; issue không nêu tên tệp, kiểm thử hoặc điểm vào nào của Langkit. Để hoàn tất, cần có một thiết kế đã được thống nhất cho các ngôn ngữ trung gian, các pass, phép biến đổi, việc xác thực, các pipeline và các Ada stub được sinh ra trước khi có thể xác định phạm vi triển khai.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This is a proposal for adding support for building Nanopass compilers to Langkit (most likely in a fork rather than something that will ever be upstreamed). I'm looking to get some feedback on this from other Langkit users to help refine this idea before I start implementing this. For some background on Nanopass compilers, refer to the following:
In short, from the second document:
The nanopass framework provides a tool for writing compilers composed of several simple passes that operate over well-defined intermediate languages. The goal of this organization is both to simplify the understanding of each pass, because it is responsible for a single task, and to simplify the addition of new passes anywhere in the compiler.
Currently it is entirely possible to write a Nanopass compiler using Langkit by manually writing a series of transformations, however this involves a lot of boilerplate, especially if one wants to formally define and check intermediate languages. I propose the addition of a set of new Langkit constructs to easily and formally define intermediate languages, pipelines, and transformers. I imagine this would look something like the following:
language parsed_foolang from grammar foolang_grammar;
language flat_foolang extends parsed_foolang {
remove BlockStatement;
}
pass flatten_blocks : parsed_foolang -> flat_foolang
with Libfoolang.Nanopass.Passes.Flatten_Blocks;
where Libfoolang.Nanopass.Passes.Flatten_Blocks is an Ada package with a Transform functions which takes some kind of rewriting handle. Langkit would generate the stub for this package.
In addition to remove, which makes a node invalid to have in a language, we would also have add to make a node valid and replace to change the shape of a node. I'm not sure exactly what this would look like yet.
Langkit would also be able to generate a pipeline function which calls a series of passes and checks that the outputs are valid between then.
That's about all I have on this idea for now, I plan to start prototyping it after I finish some other projects. Any ideas on how to design this are welcome.
- Ngôn ngữ chính
- Ada
- Star
- 94
- Fork
- 34
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AdaCore/langkit
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Struggles building Langkit with AlireCó thể làm lại được @pmderodat đã nhận 857 ngày trước và không có pull request nào đang mở. Đang mở
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Tất cả issue của AdaCore/langkit
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
todo:ticket
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
publicodes/publicodes#868 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 89/100
Maintainer thường phản hồi trong vòng 1 ngày