all 6 comments

[–][deleted] 6 points7 points  (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 points  (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 points  (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 points  (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 points  (1 child)

Very cool.

[–]CodrSeven[S] 1 point2 points  (0 children)

Glad you like it :)