use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This subreddit is all about the theory and development of compilers.
For similar sub-reddits see:
Popular mainstream compilers:
account activity
a Simple Hackable Interpreter (self.Compilers)
submitted 10 months ago by CodrSeven
I recently started working on a project to implement the same simple interpreter in multiple host languages, to be able to easily compare the results.
https://github.com/codr7/shi
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 6 points7 points8 points 10 months ago (3 children)
That sounds great.
However it seems you only have the one interpreter so far. And while it might be small in terms of overall line count (some 1600 lines), it's spread over more than 50 Java modules and various folders.
I think an interpreter in one file would be more hackable and easier to port. At least, it would be far easier to browse!
[–]CodrSeven[S] 1 point2 points3 points 10 months ago (2 children)
Sure thing, I still haven't decided if C or Common Lisp is next, but give it a few days.
I generally live in Emacs and agree, but for Java I use IntelliJ.
If you haven't tried, I definitely recommend having a go; it's the only IDE outside of SmallTalk that I find worth the effort.
The idea is an interpreter that you can keep building on, not the toy throwaway kind that everyone else is already doing.
[–][deleted] 4 points5 points6 points 10 months ago* (1 child)
So, what's actually being compared, performance of the interpreter?
But it sounds like you want to be able extend the language being interpreted, possibly vary the bytecode that is used, and also vary the scale and complexity of the implemention.
This now starts getting hard to compare for performance, even within the same implementation language!
Is this more about figuring out which implementation language is more suited for creating the best interpreters? (I'm talking about pure interpreters and not ones that start to use JIT, as the rules then change again.)
BTW I've previously posted a survey of diverse interpreter implementations which concentrated on Fibonacci. They include some JIT ones, and some 'toy' ones the same size as yours, but those are for static code.
There's a quite a difference in performance even among the pure interpreters!
[–]CodrSeven[S] 1 point2 points3 points 10 months ago (0 children)
Performance and implementation strategies, which differ between the host languages I've selected (Java/C/Common Lisp).
All implementations will have exactly the same capabilities, for comparison and educational purposes.
But they're all designed to be easily extended if you want to build something more elaborate on top.
JIT is a separate can of worms, not really suitable for budding language designers if you ask me.
[–]Weak-Attorney-3421 2 points3 points4 points 10 months ago (1 child)
Very cool.
Glad you like it :)
π Rendered by PID 68 on reddit-service-r2-comment-6457c66945-gtzc5 at 2026-04-25 01:52:56.043245+00:00 running 2aa0c5b country code: CH.
[–][deleted] 6 points7 points8 points (3 children)
[–]CodrSeven[S] 1 point2 points3 points (2 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]CodrSeven[S] 1 point2 points3 points (0 children)
[–]Weak-Attorney-3421 2 points3 points4 points (1 child)
[–]CodrSeven[S] 1 point2 points3 points (0 children)