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.

Show HN: I wrote a VM and Compiler for a small language in Go

37 pointsby madrafiabout 5 years ago

2 comments

stevekempabout 5 years ago
Looks good, you might compare to this implementation of Monkey with a bunch of extensions (such as &quot;objects&quot;, regular expressions, and a standard-library written in the language itself):<p><a href="https:&#x2F;&#x2F;github.com&#x2F;skx&#x2F;monkey&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;skx&#x2F;monkey&#x2F;</a><p>A similar idea allows embedded usage of a scripting language, as a filter:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;skx&#x2F;evalfilter&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;skx&#x2F;evalfilter&#x2F;</a><p>Of course it gets addictive writing little languages, so you&#x27;ll probably want to have fun and try making more! I went with BASIC:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;skx&#x2F;gobasic" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;skx&#x2F;gobasic</a><p>But then you start thinking about assembly language:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;skx&#x2F;math-compiler" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;skx&#x2F;math-compiler</a>
madrafiabout 5 years ago
I recently took time to dive into compilers and programming languages by reading Thorsten Bell&#x27;s excellent books, and this is what came out !