开发者

Scripting Language Design?

If I were to go to a 开发者_高级运维dev. company and say "Please build me 'this' scripting language", are there any specific documents, and what types of documents that I should create, so they know exactly what I am wanting?

Any guidance is much appreciated.

Thank you


As Dave Swersky says, there are lots and lots of very well developed scripting languages already out there. Lua, for example, is very simple yet surprisingly powerful and has tiny yet efficient implementations.

But if you really, really want a scripting language custom built for you, then the nicest thing you could do for the implementor would be to provide him with a description of the language in Backus-Naur form. Ideally, that will allow them to create a scanner and parser for your language with very little effort. In addition, you will need to define your language's data types and how the map to the hardware's data types, and you will need to specify which library or built-in functions you want to provide, and how those will have effects in the outside world. The Lua Reference Manual is concise yet complete and defines that language and its library well. You'll want to come up with something comparable, or make do with a hand-waving simplification and hope your implementors invest their own brain power in filling the gaps left by your description.


It would help if you could offer some detail on why you would want to go to the time and expense to develop your own scripting language when there are at least three or four excellent options out there for free. If you have a targeted need for a language that does something specific, read up on Domain Specific Languages.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜