Skip to content

Commit 7747fb6

Browse files
committed
Adding Blog Functionality for Planned Blog Posts
- Preparing to add multiple Blog Posts (including Xeus-Cpp) that I've gathered info on. Will also share to LinkedIn. - Added blog.html layout and blog.md page to add Blog functionality - Reformatted existing articles to work with default blog functionality (file names, excerpts, etc.) - moved articles from "_pages/blogs" to "_posts" as per standard Jekyll practice (this helps generate default variables like post.url) - moved articles still work with old link, so linkbacks will not be broken (tested) - example: https://compiler-research.org/blogs/gsod23_quillpusher_experience_blog/ - Did not add "Blog" menu to Home page navigation, will do that as part of Front Page Customization PR - Note: I found that following images were missing on Fred's blog (cc1.gif, cc2.gif, tcc.gif). I have added screenshots from his presentation for now and emailed him for actual moving GIF files that show Code Completion demo
1 parent d9412dd commit 7747fb6

10 files changed

+198
-138
lines changed

_layouts/blog.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: default
3+
title: Blog
4+
---
5+
<h3>Latest Posts</h3>
6+
7+
<div>
8+
{% for post in site.posts %}
9+
<div class="well">
10+
<h3>{{ post.title }}</h3>
11+
{{ post.excerpt }}
12+
<p>Read more <a href="{{ post.url }}">here</a></p>
13+
</div>
14+
{% endfor %}
15+
</div>

_pages/blog.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: "Blog"
3+
layout: blog
4+
excerpt: "Blog Posts"
5+
sitemap: false
6+
permalink: /blog/
7+
---
8+
9+
<div id="textid" class="col-sm-12">
10+
{{ content }}
11+
</div>
12+
13+

_pages/blogs/GSoC22_M_Izvekov_Project_Experience.md renamed to _posts/2022-11-30-extend-clang-to-resugar-template-specialization-accesses.md

+38-30
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
11
---
2-
title: "GSoC 2022 Experience of Matheus Izvekov"
3-
layout: gridlay
4-
excerpt: "GSoC 2022 Experience of Matheus Izvekov"
2+
title: "Extend Clang to Resugar Template Specialization Accesses"
3+
layout: post
4+
excerpt: "Clang is an LLVM native C/C++/Objective-C compiler, which aims to
5+
deliver amazingly fast compiles, extremely useful error and warning messages
6+
and to provide a platform for building great source level tools. The Clang
7+
Static Analyzer and clang-tidy are tools that automatically find bugs in
8+
your code, and are great examples of the sort of tools that can be built
9+
using the Clang frontend as a library to parse C/C++ code. When
10+
instantiating a template, the template arguments are canonicalized
11+
before being substituted into the template pattern. Clang does not
12+
preserve type sugar when subsequently accessing members of the instantiation.
13+
This leads to many infamous pathological errors which have haunted C++
14+
developers for decades."
515
sitemap: false
616
permalink: blogs/gsoc22_izvekov_experience_blog/
717
---
818

9-
# Extend Clang to resugar template specialization accesses
10-
11-
**Developer:** Matheus Izvekov
12-
13-
**Mentors:** Richard Smith (Google), Vassil Vassilev (Princeton University/CERN)
14-
15-
**Funding:** [Google Summer of Code 2022](https://summerofcode.withgoogle.com/)
16-
17-
---
18-
19-
**Contact me!**
20-
21-
22-
23-
Github Username: [mizvekov](https://github.com/mizvekov)
24-
25-
**Link GSoC project proposal:** [Matheus_Izvekov_Proposal_2022](https://compiler-research.org/assets/docs/Matheus_Izvekov_Proposal_2022.pdf)
26-
27-
28-
---
29-
30-
31-
## Overview of the Project
19+
### Overview of the Project
3220

3321
Clang is an "LLVM native" C/C++/Objective-C compiler, which aims to deliver
3422
amazingly fast compiles, extremely useful error and warning messages and to
@@ -56,7 +44,7 @@ Clang has the
5644
[clang::preferred_name](https://clang.llvm.org/docs/AttributeReference.html#preferred-name)
5745
attribute to improve the situation but with limited success.
5846
59-
## My approach
47+
### My approach
6048
6149
To further enhance Clang’s expressive error diagnostics system, I implemented an
6250
eager approach to syntactic resugaring in Clang. The novel approach does not
@@ -72,7 +60,7 @@ approach, although more efficient, required some intrusive modifications on the
7260
way substitutions are represented in the AST.
7361
7462
75-
## Contributions
63+
### Contributions
7664
7765
The main contributions to this project are listed here.
7866
@@ -90,7 +78,7 @@ Pull Requests:
9078
8. [D127695 - Implement Template Specialization Resugaring](https://reviews.llvm.org/D127695)
9179
9280
93-
## Contributions
81+
### Contributions
9482
9583
1. Syntactic resugar of Non Type Template Parameters (NTTPs) is still under
9684
development. When checking template arguments, we perform substitutions on NTTPs
@@ -110,8 +98,28 @@ terms of desugared code, improving the relationship between the user's source
11098
program and the program evaluation.
11199
112100
113-
## Acknowledgements
101+
### Acknowledgements
114102
115103
I thank my mentors Richard Smith and Vassil Vasilev for their excellent
116104
support, their welcoming behavior motivated me and gave me the opportunity to
117105
increase my confidence as a developer in the LLVM open community!
106+
107+
---
108+
109+
### Credits
110+
111+
**Developer:** Matheus Izvekov
112+
113+
**Mentors:** Richard Smith (Google), Vassil Vassilev (Princeton University/CERN)
114+
115+
**Funding:** [Google Summer of Code 2022](https://summerofcode.withgoogle.com/)
116+
117+
---
118+
119+
**Contact me!**
120+
121+
122+
123+
Github Username: [mizvekov](https://github.com/mizvekov)
124+
125+
**Link GSoC project proposal:** [Matheus_Izvekov_Proposal_2022](https://compiler-research.org/assets/docs/Matheus_Izvekov_Proposal_2022.pdf)

_pages/blogs/GSoC22_J_Zhang_P_Chaudhari_Experience.md renamed to _posts/2022-12-02-recovering-from-errors-in-clang-repl-and-code-undo.md

+42-30
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
11
---
2-
title: "Summer 2022 Experience of Jun Zhang and Purva Chaudhari"
3-
layout: gridlay
4-
excerpt: "Summer 2022 Experience of Jun Zhang and Purva Chaudhari"
2+
title: "Recovering from Errors in Clang-Repl and Code Undo"
3+
layout: post
4+
excerpt: "Incremental C++ enables exploratory programming by considering the
5+
translation unit to be an ever-growing entity. This allows implementation of
6+
interpreter-like tools such as Cling and Clang-Repl, which consume C++ code
7+
piece by piece and use the JIT infrastructure to run each piecewise. One of
8+
the challenges of Incremental C++ is the reliable recovery from errors which
9+
allows the session to continue after faulty user code. Supporting reliable
10+
error recovery requires splitting the translation unit into a sequence of
11+
Partial Translation Units (PTUs). Each declaration is associated with a
12+
unique PTU that owns it. Owning PTU isn’t always the “active” (most recent)
13+
PTU and it isn’t always the PTU that the declaration comes from. Even a new
14+
declaration that isn’t a declaration or or specialization of anything
15+
belongs to the active PTU. However, in case of a template specialization,
16+
it can be pulled into a more recent PTU by its template arguments."
517
sitemap: false
618
permalink: blogs/gsoc22_zhang_chaudhari_experience_blog/
719
---
820

9-
# Recovering from Errors in Clang-Repl and Code Undo
10-
11-
**Developers:** Jun Zhang (Software Engineering, Anhui Normal University, WuHu,
12-
China) and Purva Chaudhari (California State University Northridge, Northridge
13-
CA, USA)
14-
15-
**Mentor:** Vassil Vassilev (Princeton University/CERN)
16-
17-
---
18-
19-
**Contact us!**
20-
21-
22-
23-
GitHub username: [junaire](https://github.com/junaire)
24-
25-
26-
Purva: [Webpage](https://purva-chaudhari.github.io/My-Portfolio/)
27-
28-
GitHub username: [Purva-Chaudhari](https://github.com/Purva-Chaudhari)
29-
30-
---
31-
32-
## Overview of the Project
21+
### Overview of the Project
3322

3423
Incremental C++ enables exploratory programming by considering the translation
3524
unit to be an ever-growing entity. This allows implementation of
@@ -82,7 +71,7 @@ clang-repl> float x = 24 // not an error
8271
```
8372

8473

85-
## Contributions
74+
### Contributions
8675

8776
The main contributions to this project are listed here.
8877

@@ -102,7 +91,7 @@ Pull Requests:
10291
11. [D130831 - Track DeferredDecls that have been emitted](https://reviews.llvm.org/D130831)
10392
12. [Code gen passing](https://gist.github.com/Purva-Chaudhari/1555b887618cec569b638e96056d9679)
10493

105-
## Results
94+
### Results
10695

10796
1. We implemented the initial code undo for Clang-Repl, the patch we submitted
10897
extends the functionality used to recover from errors and adds functionality to
@@ -133,11 +122,34 @@ auto r4 = printf("bar() = %d\n", bar()); // This fails before my patch. Note thi
133122
```
134123
5. We fixed some issues in lambda usage in Clang-Repl.
135124
136-
## Conclusion
125+
### Conclusion
137126
138127
During this summer, I not only improved my technical skills but also enhanced my ability to work with others and
139128
appreciate the charm of open source. I would like to thank all the people who helped me, especially my mentor Vassil,
140129
who is not only an experienced programmer but also a respected life teacher. I'm also pretty happy working with my
141130
partner Purva, who made a great effort when preparing our LLVM Dev lightning talk this year.
142131
143132
In the future, I'll continue my journey into the world of open source, and bring the code and love to all!
133+
134+
---
135+
136+
### Credits
137+
138+
**Developers:** Jun Zhang (Software Engineering, Anhui Normal University, WuHu,
139+
China) and Purva Chaudhari (California State University Northridge, Northridge
140+
CA, USA)
141+
142+
**Mentor:** Vassil Vassilev (Princeton University/CERN)
143+
144+
---
145+
146+
**Contact us!**
147+
148+
149+
150+
GitHub username: [junaire](https://github.com/junaire)
151+
152+
153+
Purva: [Webpage](https://purva-chaudhari.github.io/My-Portfolio/)
154+
155+
GitHub username: [Purva-Chaudhari](https://github.com/Purva-Chaudhari)

_pages/blogs/GSoC22_A_Ghosh_Project_Experience.md renamed to _posts/2022-12-07-shared-memory-based-jitlink-memory-manager.md

+43-36
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,20 @@
11
---
2-
title: "GSoC 2022 Experience of Anubhab Ghosh"
3-
layout: gridlay
4-
excerpt: "GSoC 2022 Experience of Anubhab Ghosh"
2+
title: "Shared Memory Based JITLink Memory Manager"
3+
layout: post
4+
excerpt: "LLVM JIT APIs include JITLink, a just-in-time linker that links
5+
together objects code units directly in memory and executes them. It uses the
6+
JITLinkMemoryManager interface to allocate and manage memory for the generated
7+
code. When the generated code is run in the same process as the linker, memory
8+
is directly allocated using OS APIs. But for code that runs in a separate
9+
executor process, an RPC scheme Executor Process Control (EPC) is used. The
10+
controller process invokes RPCs in the target or executor process to allocate
11+
memory and then when the code is generated, all the section contents are
12+
transferred through finalize calls."
513
sitemap: false
614
permalink: blogs/gsoc22_ghosh_experience_blog/
715
---
816

9-
# Shared Memory Based JITLink Memory Manager
10-
11-
**Developer:** Anubhab Ghosh (Computer Science and Engineering, Indian Institute
12-
of Information Technology, Kalyani, India)
13-
14-
**Mentors:** Stefan Gränitz (Freelance Compiler Developer, Berlin, Deutschland),
15-
Lang Hames (Apple), Vassil Vassilev (Princeton University/CERN)
16-
17-
**Funding:** [Google Summer of Code 2022](https://summerofcode.withgoogle.com/)
18-
19-
---
20-
21-
**Contact me!**
22-
23-
24-
25-
Github Username: [argentite](https://github.com/argentite)
26-
27-
**Link to GSoC project proposal:** [Anubhab_Ghosh_Proposal_GSoC_2022](https://compiler-research.org/assets/docs/Anubhab_Ghosh_Proposal_2022.pdf)
28-
29-
**Link to GSoC project proposal:** [Anubhab_Ghosh_Final_Report_GSoC_2022](https://compiler-research.org/assets/docs/Anubhab_Ghosh_GSoC2022_Report.pdf)
30-
31-
---
32-
33-
34-
## Overview of the Project
17+
### Overview of the Project
3518
LLVM JIT APIs include JITLink, a just-in-time linker that links together objects
3619
code units directly in memory and executes them. It uses the
3720
JITLinkMemoryManager interface to allocate and manage memory for the generated
@@ -42,14 +25,14 @@ controller process invokes RPCs in the target or executor process to allocate
4225
memory and then when the code is generated, all the section contents are
4326
transferred through finalize calls.
4427

45-
### Shared Memory
28+
#### Shared Memory
4629
The main problem was that EPC runs on top of file descriptor streams like Unix
4730
pipes or TCP sockets. As all the generated code and data bytes are transferred
4831
over the EPC this has some overhead that could be avoided by using shared
4932
memory. If the two processes share the same physical memory pages then we can
5033
completely avoid extra memory copying.
5134

52-
### Small code model
35+
#### Small code model
5336
While we are at it, another goal was to introduce a simple slab-based memory
5437
manager. It would allocate a large chunk of memory in the beginning from the
5538
executor process and allocate smaller blocks from that entirely at the
@@ -97,9 +80,9 @@ Small code model is the default for most compilations so this is actually
9780
required to load ordinary precompiled code, e.g., from existing static archives.
9881

9982

100-
## My Approach
83+
### My Approach
10184

102-
### Memory Mappers
85+
#### Memory Mappers
10386
I introduced a new `MemoryMapper` abstraction for interacting with OS APIs at
10487
different situations. It has separate implementations based on whether the code
10588
will be executed in the same or different process. The `InProcessMemoryMapper`
@@ -116,7 +99,7 @@ address. Once JITLink has written the code to those mapped addresses, they are
11699
now already in place in the executor processes so finalization is just a matter
117100
of sending the memory protections.
118101

119-
### Slab-based allocator
102+
#### Slab-based allocator
120103
Furthermore, I developed a slab-based memory allocator for JITLink, reserving a
121104
large region of memory in the address space of the target process on the first
122105
allocation. All subsequent allocations result in sub-regions of that to be
@@ -125,7 +108,7 @@ involvement. Furthermore as our all the allocation are from a contiguous memory
125108
region, it also guarantees that JIT’d memory satisfies the layout constraints
126109
required by the small code model.
127110

128-
### Concurrency problems
111+
#### Concurrency problems
129112
After the implmentation, I tried JIT linking the CPython interpreter to
130113
benchmark the implementation. We discovered that our overall CPU execution time
131114
decreased by 45% but somewhat paradoxically clock time increased by 45%. In
@@ -149,9 +132,33 @@ For a more detailed description and all the patches, please consult my
149132
[GSoC final report](https://compiler-research.org/assets/docs/Anubhab_Ghosh_GSoC2022_Report.pdf).
150133

151134

152-
## Acknowledgements
135+
### Acknowledgements
153136

154137
I would like to share my gratitude for the LLVM community members and my mentors
155138
Stefan Gränitz, Lang Hames, and Vassil Vassilev, who shared their suggestions
156139
during the project development. I hope that this project will find its place in
157140
many applications.
141+
142+
---
143+
144+
### Credits
145+
146+
**Developer:** Anubhab Ghosh (Computer Science and Engineering, Indian Institute
147+
of Information Technology, Kalyani, India)
148+
149+
**Mentors:** Stefan Gränitz (Freelance Compiler Developer, Berlin, Deutschland),
150+
Lang Hames (Apple), Vassil Vassilev (Princeton University/CERN)
151+
152+
**Funding:** [Google Summer of Code 2022](https://summerofcode.withgoogle.com/)
153+
154+
---
155+
156+
**Contact me!**
157+
158+
159+
160+
Github Username: [argentite](https://github.com/argentite)
161+
162+
**Link to GSoC project proposal:** [Anubhab_Ghosh_Proposal_GSoC_2022](https://compiler-research.org/assets/docs/Anubhab_Ghosh_Proposal_2022.pdf)
163+
164+
**Link to GSoC project proposal:** [Anubhab_Ghosh_Final_Report_GSoC_2022](https://compiler-research.org/assets/docs/Anubhab_Ghosh_GSoC2022_Report.pdf)

0 commit comments

Comments
 (0)