TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Would anyone be interested in a simple tiny compiler ebook?

5 pointsby bootcatover 7 years ago
https:&#x2F;&#x2F;github.com&#x2F;deepanprabhu&#x2F;simple-expression-compiler<p>Guys, would anybody be interested to read a simple, pithy ebook, that describes fundamentals of building a simple tiny compiler in Java to begin with ? I would also take the reader through building a simple compiler themselves, step by step, using Java. The exercise simple enough that i chose is, taking a mathematical expression like 6 * 5 + 3 * ( 2 -1 ), and generating NASM assembly code, that we would compile and execute using NASM. Please give me your thoughts !

3 comments

PhilWrightover 7 years ago
I think the best tutorial would not be for a toy language or just for simple expressions. But for a subset of a real language. That way the details learnt are directly applicable to the real world. Create a compiler for a subset of C or a subset of Java. Then it is possible for the reader to continue developing that compiler to include more and more features.
评论 #16264048 未加载
kotrungaover 7 years ago
That would be awesome! However, I think something that&#x27;s not Java... maybe, a &quot;simple&quot; book on building a compiler in C or something.
评论 #16272861 未加载
jettiover 7 years ago
One thing that I would be more interested in is either targeting LLVM IR, JVM or .NET instead of doing straight assembly with NASM.
评论 #16272856 未加载