TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Flex – transpile natural language to a programming language

10 点作者 faheel超过 2 年前
Flex [1] is a transpiler that converts a series of statements in natural language to either Python, Java or C++, and is trained using Rasa NLU [2], an open-source framework usually used for training chatbots and voice assistants.<p>Flex is a project I made in college in 2018 along with two of my classmates, Gourav and Sanjay. The initial idea was to create a voice assistant you could speak to that wrote code for you, similar to GitHub&#x27;s upcoming (and a lot more advanced) project &quot;Hey, Github&quot; [3].<p>We then had to reduce the project&#x27;s scope to complete it in a single semester while writing exams, preparing for job interviews and submitting reports and assignments. So we settled on creating a Python program that takes a file containing statements written in natural language as input and transpiles them to a valid Python&#x2F;Java&#x2F;C++ program. The project design is modular, so adding more languages and statement types is easy.<p>The next step we had thought of was to hook it up with some UI with voice input to have some kind of voice-driven IDE, but then as college was over and we got jobs, the project got abandoned as we moved on to other things.<p>Seeing the &quot;Hey, GitHub&quot; project on HackerNews today [4] reminded me of this project, so I just wanted to share it to inspire others to fork it and make something cool. Also looking forward to some feedback on how the project could be improved to make it more useful.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;Flex-lang&#x2F;transpiler" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Flex-lang&#x2F;transpiler</a>. Not to be confused with FLEX, a strictly-typed programming language with the same name (which was released first, so we should have used a different name!)<p>[2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;rasahq&#x2F;rasa" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rasahq&#x2F;rasa</a><p>[3]: <a href="https:&#x2F;&#x2F;githubnext.com&#x2F;projects&#x2F;hey-github&#x2F;" rel="nofollow">https:&#x2F;&#x2F;githubnext.com&#x2F;projects&#x2F;hey-github&#x2F;</a><p>[4]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33543946" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33543946</a>

4 条评论

leobg超过 2 年前
Can anyone explain to me what this does? I would have expected something like GPT-3 Codex or GitHub Copilot. But the example on the page looks a lot different. Specifically, I don’t see any natural language input.
评论 #33552273 未加载
kseistrup超过 2 年前
Also flex: fast lexical analyzer generator: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Flex_(lexical_analyser_generator)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Flex_(lexical_analyser_generat...</a><p>Edit: In case the parentheses don&#x27;t work (percentage encoding didn&#x27;t), try: <a href="https:&#x2F;&#x2F;github.com&#x2F;westes&#x2F;flex" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;westes&#x2F;flex</a>
philip-costa-jr超过 2 年前
I&#x27;ve been experimenting with chatbot frameworks lately and was getting a little bored of building toy ones, so this might be an interesting idea for me to explore! The dependencies seem a little old though, you should think about keeping them updated.
mintaka5超过 2 年前
this is so awesome!