寻找一种同时支持解释和本机编译模式的新语言
我目前使用 Perl、Python、C#、C、C++、Java 和其他一些语言进行编程,并且我正在寻找一种新语言作为进行个人项目时的主要语言。
我当前的标准是:
- 可以作为解释语言运行(即无需等待编译即可运行);
- 可以编译为本机代码;
- 是强类型的(即使是可选的);
- 支持宏/模板/代码变形/你想调用它的wtf;
- 有相当数量的库,或者很容易访问它;
有想法吗?建议?
I currently program in Perl, Python, C#, C, C++, Java, and a few other languages, and I'm looking for a new language to use as a primary when doing personal projects.
My current criteria are:
- can be run as an interpreted language (i.e., run without having to wait to compile it);
- can be compiled to native code;
- are strongly typed (even if optionally);
- support macros/templating/code morphing/wtf you want to call it;
- has a decent number of libraries for it, or easily accessible to it;
Ideas? Suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我建议 Haskell 适合您的标准。
此外,听起来您已经了解很多命令式/面向对象语言。恕我直言,如果你学习另一种语言。它可能是您在其他地方已经看到的功能的稍微不同的排列。将函数式编程等另一种编程范例添加到您的工具箱中可能会是更好的学习体验。不过我想这是否是一个优势取决于你是否想学习新事物或快速提高工作效率。
I would suggest that Haskell suits your criteria.
Additionally, it sounds like you already know a lot of imperative/object oriented languages. IMHO if you learn another one of those langs. it will probably be a slightly different permutation of features you've already seen somewhere else. Adding another programming paradigm like functional programming to your toolbox will probably be a better learning experience. Though I guess whether that's an advantage or not depends on if you want to learn new things or be productive quickly.
Common Lisp 适合:有可选的类型,可以使用高效的本机编译,强大的 REPL 使其成为脚本编写的完美选择,并且有强大的宏元编程。
OCaml 也适合使用 CamlP4 进行元编程。
Common Lisp fits: there is an optional typing, efficient native compilation is available, powerful REPL makes it a perfect choice for scripting, and there is a powerful macro metaprogramming.
OCaml fits as well, with CamlP4 for metaprogramming.
斯卡拉?它确实运行脚本,尽管它们首先被编译(透明地)。我不确定你所说的代码变形等是什么意思,但这对于 DSL 来说非常好。它满足您的所有其他要求 - 与 Java 一样编译,强类型,并且拥有合理数量的自己的库以及所有 Java 的库。我还是个初学者,但到目前为止我很喜欢它。
Scala? It does run scripts, although they are compiled (transparently) first. I'm not sure what you mean by code morphing etc, but it's pretty good for DSLs. It meets all your other requirements - compiled as much as Java is, strongly typed, and has a reasonable number of its own libraries as well as all of Java's. I'm still a beginner with it, but I like it so far.