<p>Yes, and that is the ambition of the <a href="https://www.decoder-project.eu/" rel="nofollow noreferrer">Decoder</a> project (H2020 funded in Europe). Analyzing with NLP techniques the comments in e.g. C or C++ source code (of open source projects, and perhaps their <a href="https://git-scm.com/" rel="nofollow noreferrer"><code>git</code></a> logs).</p>
<p>I even happen to be on the photo.</p>
<p>My dream is to try similar things, in a few years, in <a href="http://refpersys.org/" rel="nofollow noreferrer">RefPerSys</a>. You could join that project, BTW.</p>

CC BY-SA 4.0
2020-09-10T19:33:25.540Z
I just discovered that we are neighbors :)
LMD
CC BY-SA 4.0
2020-09-10T19:17:25.530Z
2020-09-10T19:22:32.080Z
2020-09-10T19:22:32.080Z
Basile Starynkevitch
<p>I wonder if we can use Natural Language Processing (NLP) to process programming code:
Given a piece of code, can we</p>
<ol>
<li><strong>Translate</strong> it to human language to <em>understand</em> what it does? The input could be a function definition（normally lack of documentation) in Python and the output could be the documentation for that function.</li>
<li><strong>Compile</strong> or translate it to another programming language? Compile Python code to C or machine code, or translate C code to Python code?</li>
</ol>

<natural-language-processing><machine-translation>
Can we use NLP to understand/parse/compile programming code?
LMD
# Can we use NLP to understand/parse/compile programming code?

(Asked by: username_0 on 2020-09-10)

I wonder if we can use Natural Language Processing (NLP) to process programming code:
Given a piece of code, can we

1. **Translate** it to human language to *understand* what it does? The input could be a function definition（normally lack of documentation) in Python and the output could be the documentation for that function.
2. **Compile** or translate it to another programming language? Compile Python code to C or machine code, or translate C code to Python code?

**Tags:** natural-language-processing, machine-translation


---

## 1 answers

### Answer by username_1 on 2020-09-10. Score: 1

Yes, and that is the ambition of the [Decoder](https://www.decoder-project.eu/) project (H2020 funded in Europe). Analyzing with NLP techniques the comments in e.g. C or C++ source code (of open source projects, and perhaps their [`git`](https://git-scm.com/) logs).

I even happen to be on the photo.

My dream is to try similar things, in a few years, in [RefPerSys](http://refpersys.org/). You could join that project, BTW.

> **Comments:**
> **username_0**: I just discovered that we are neighbors :)  

---

