将语言特性集成到其他语言中
当设计或研究一种新语言时,其他语言中存在的功能有哪些限制?例如,如果我创建了一种新语言,并且确定我真的很喜欢 C# 的部分类,那么我可以直接将其撕掉吗?
When designing or looking at a new language, what are the limits of features that exist in other languages? For example, if I made a new language and decided that I really liked C#'s partial classes, is it OK for me to just rip it straight off?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须考虑这些功能的用途,以及它们如何与其他功能重叠。
同样,某些功能可能存在实际的技术障碍。例如,您可能需要自动类型推断,但给定的功能可能会使这种情况无法确定。
因此,在大多数情况下,您可以做任何您想做的事情,但值得考虑如何使用它们。也许尝试用一种语言编写一些程序,利用所有功能,看看它们是否可以相互实现,以及它们是否可以正确地协同工作。
我不久前写了一篇博客文章,介绍了可能有用的语言设计的一些注意事项:
http://www.plsadventures.com/2009/09/why-programming-language-design-is-hard.html
如果您是从法律角度谈论的,那么是的,可能没问题。
You have to consider what these features are used for, and how they overlap with other features.
Similarly, there may be actual technical barriers with certain features. For example, you might want automatic type inference, but a given feature might make this undecidable.
So for the most part, you can just do whatever you want, but it's worth thinking about how they will be used. Maybe try writing some programs in the language that make use of all the features and see if they can be implemented in terms of one another and if they work together correctly.
I wrote a blog post a while ago about some considerations for language design that might be useful:
http://www.plsadventures.com/2009/09/why-programming-language-design-is-hard.html
If you were talking about from a legal perspective, then yes, it's probably fine.