Today, I worked a little on improving test coverage for my Lox implementation. I made a little progress.
Besides that, I sketched out ideas I might try for applying what I learned to creating a language of my own. I'm pretty good at implementing these kinds of small language specifications (especially if I'm not actively working against the design of the reference implementation), but actually writing a specification is much more work. For now, I tried sketching out some ideas.
These ideas include:
- Lua-style linear syntax. The fact that Lua doesn't really need semicolons or line breaks to divide statements seems pretty neat to me.
- Rust-style lifetimes. I gave up on this when I tried sketching an iterator implementation, and realized that I'd need both "unsafe" and an equivalent of Rust's "Copy" trait to make it even vaguely ergonomic. On reflection, maybe I would have had more luck with a Python-style generator than a Lua-style iterator, but I don't want to go that way right now.
- Separating the different kinds of inheritance. I didn't get too far sketching this out, but I think this is what I want to focus on.
Thinking about how to sketch out these ideas, I wasn't really sure before, but it just occurred to me that I might be able to get inspiration from Rosetta Code.
I'll have to look into that later. For now, I want to wrap things up.