需要一些有关解释器创建的指导
我正在尝试创建一个解释器。
我的想法是解析代码,将其转换为操作码(非常类似于 字节码、msil 等),现在创建一个解释器执行器,稍后创建一个 JIT 引擎。
我目前正在设计内存管理器和类型系统。
我创建了一个简单的内存管理器,支持一些基本数据类型(整数、浮点、字符、字符串、数组)。我可以成功分配内存并使用它。但我对此并不满意。我想创建一个垃圾收集器,使其面向对象并尽可能地扩展它。
我正在寻找建议、网站、书籍,以便了解有关该主题的更多信息。
I am trying to create an interpreter.
My thoughts are to parse the code, transform it into opcodes (very similar to
bytecode, msil etc) and for now to create an interpreter executor and later a JIT engine.
I am currently designing the memory manager and the type system.
I have created a simple memory manager that supports some basic datatypes (integer, float, char, string, array). I can successfully allocate the memory and use it. But I am not satisfied with it. I would like to create a garbage collector, make it object oriented and extend it as much as I can.
I am looking for suggestions, sites, books in order to learn more on this subject.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
建议:保持较小。意思是不要尝试做成熟口译员所做的一切。创建一个完整的解释器是一项艰巨的工作。相反,专注于一些您感兴趣的小话题。看起来您对内存管理感兴趣,所以尝试一下堆栈、堆和符号表。
参考资料:
Suggestion: Keep it small. Meaning don't try to do everything that mature interpreters do. Creating a full interpreter is a lot of work. Instead focus on a few small topic that interest you. It looks like you are interested in memory management, so play around with stack, heap, and symbol tables.
References:
我建议您查看 Quincy - Al Stevens 开发的 C 解释器,配有 IDE 和调试器。他的文章发表于90年代的《DDJ》。您可以使用 Google 查找他的文章。
I would ask you to look at Quincy - a C interpreter by Al Stevens, complete with an IDE and debugger. His articles appeared in DDJ in 90s. You can find his articles using Google.