编写编程语言的建议? [英] Suggestions for writing a programming language?

查看:138
本文介绍了编写编程语言的建议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于想要编写程序设计或脚本语言的人,你能给出什么提示? I
不用担心如何编程或设计编译器,但是如何使用工具和代码生成器快速开发编译器。

What tips can you give a person who is looking to write a programming or script language? I am not worried about how to program nor design a compiler but how to develop one quickly using tools and code generators.

上次我尝试编码在c ++和状态和语法花了几乎只要写实际的逻辑。我知道以下工具将有所帮助。

Last time i tried i coded it in c++ and the states and syntax took almost as long as writing the actual logic. I know the follow tools would help.

我想我可以生成c ++代码,并有gcc编译。使用上面的工具你估计需要多长时间编写程序或脚本语言?

I was thinking i could generate c++ code and have gcc compile that. Using the tools above how long would you estimate it would take to write a program or script language?

此问题的变化已被反复询问,早在学会编写一个编译器此主题上的SO资源列表不完整

Variations on this question have been asked repeatedly, as far back as Learning to write a compiler. Here is an incomplete list of SO resources on the topic.

推荐答案

估计这样的东西可能需要多长时间取决于许多不同的因素。例如,有经验的程序员可以在几个小时内用单元测试轻松敲出一个简单的算术表达式求值程序。但是新手程序员可能需要了解解析技术,递归下降,表达式树的抽象表示,树形走路策略等。这可能很容易需要几个星期或更长的时间,只是为了算术表达式。

Estimating how long something like that might take is dependent on many different factors. For example, an experienced programmer can easily knock out a simple arithmetic expression evaluator in a couple of hours, with unit tests. But a novice programmer may have to learn about parsing techniques, recursive descent, abstract representation of expression trees, tree-walking strategies, and so on. This could easily take weeks or more, just for arithmetic expressions.

但是,不要让你不鼓励。由于Jeff和Joel正在与Eric Sink讨论最近的Stack Overflow播客,编写一个编译器是一个优秀的方式来了解编程的许多不同方面。我已经建立了几个编译器,他们是我最难忘的编程项目。

However, don't let that discourage you. As Jeff and Joel were discussing with Eric Sink on a recent Stack Overflow podcast, writing a compiler is an excellent way to learn about many different aspects of programming. I've built a few compilers and they are among my most memorable programming projects.

一些关于编译器的经典书籍是:

Some classic books on building compilers are:

  • Compilers: Principles, Techniques, and Tools (also known as The Dragon Book)
  • The Structure and Interpretation of Computer Programs (also known as SICP)
  • Algorithms + Data Structures = Programs

这篇关于编写编程语言的建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆