哪些语言可以很好地替代 Java?

发布于 2024-09-14 22:28:56 字数 341 浏览 2 评论 0原文

我可能会提出一个不成熟的问题,也许我只是无缘无故地惊慌失措,但 Oracle 处理 Java 的方式并不是很有希望。我是一个书呆子,一见钟情,并在我的个人/自由项目中一直使用它,但现在我正在考虑替代方案。

我也精通 C#/VB.NET,但我正在寻找更像这样的东西:

  1. 开源
  2. 编译
  3. 跨平台 面向
  4. 对象
  5. 大型标准库
  6. 广泛的文档
  7. Web 开发是一个主要优点

我正在考虑一个折衷方案:Python/Django for web开发(或 PHP),以及用于胖客户端开发的 Qt。有人有更好的想法吗?

I may be posting a premature question, and maybe I'm just freaking out for no reason, but the way Oracle is handling Java is not very promising. I am a nerd who fell in love with Java from the first sight, and use it all the time in my personal/freelance projects but now I am thinking of a replacement.

I am fluent in C#/VB.NET too but I am looking for something more like:

  1. Open Source
  2. Compiled
  3. Cross-Platform
  4. Object Oriented
  5. Large standard library
  6. Extensive documentation
  7. Web development is a major plus

I was thinking about a compromise: Python/Django for web development (or PHP), and Qt for thick client development. Anyone with better thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

无声无音无过去 2024-09-21 22:28:56

不久前,我决定脱离 JVM 进行探索。我踏上了Python,尽管我还远未达到专家/大师的水平,但我并不后悔。没有选择 C#(考虑过它),因为我认为它更相似。我已经了解(并且非常喜欢)C++,所以 python 看起来像是一些新东西,这正是我一直在寻找的东西。

它满足您的许多要求。特别是,我决定不学习 PHP,所以 python 中的 Web 框架就派上用场了。

更不用说,Python 有一个庞大的社区(另请参阅这里),总是渴望提供帮助和教导,我认为这非常重要。

只是我的两分钱。

Not so long ago, I decided to explore away from the JVM. I set foot on python, and even though i'm nowhere near the expert/ guru level, I dont regret it. Didn't choose C# (considered it) because I consider it to be more of the same. I alredy know (and like a lot) C++, so python seemed like something new, which is what I was looking for.

It fullfils many of your requirements. Particularly, i'm decided not to learn PHP, so the web frameworks in python came in great.

Not to mention, Python has a large community (also see here), always eager to help and teach, which I consider to be very important.

Just my two cents.

你的他你的她 2024-09-21 22:28:56

可能值得看看其他 JVM 语言 - Clojure 和 Scala 是我个人认为最有前途的两种语言。

是的,您使用的是 JVM,但是您非常独立于 Java 语言,如果您不愿意,也不必使用任何 Sun/Oracle 实现。

话虽如此,我认为您对 Java 的担心有点太多了,太多的玩家(包括 Oracle!)投入了太多,以至于不能让它偏离轨道太远。

Might be worth loking at the other JVM languages - Clojure and Scala are the two I personally think are most promising.

Yes you are on the JVM, but you're pretty independent from Java the langauage and don't have to use any Sun/Oracle implementations if you don't want to.

Having said that - I think that you are worrying a little too much about Java, too many players (including Oracle!) have too much invested to let it go too far off course.

兲鉂ぱ嘚淚 2024-09-21 22:28:56

尝试 Scala。它看起来非常优雅和有前途。面向对象,并以非常简洁的方式与 java 共享很多内容。

Try Scala. It looks extremely elegant and promising. Being object oriented and sharing a lot with java in a very concise manner.

韬韬不绝 2024-09-21 22:28:56

你所说的一切都指向 C#,除了开源这一点。

为了解决这个问题,有 Mono

Everything you said points to C#, except for the Open Source point.

To fix that, there's Mono.

月牙弯弯 2024-09-21 22:28:56

你可以尝试 D。我用一句话描述了为什么它是一种很棒的语言,它的通用编程/编译时自省/模板元编程设施足以为你提供几乎鸭子类型语言的灵活性,同时它的执行速度和静态类型检查可与 C++ 和 C# 相媲美或超过。

我认为它非常符合您的要求。

  • 开源:参考 DMD 实现的前端是开源的(后端不受作者控制之外的限制)。将参考前端粘合到开源后端(例如 LLVM (LDC) 和 GCC (GDC))的工作正在进行中。就 D1(该语言的较旧版本)而言,LLVM 移植相当成熟。
  • 已编译:D 旨在编译为本机机器代码,即原始的、难以理解的十六进制数字。
  • 跨平台:参考DMD编译器支持x86 Windows、Linux、Mac OS X和FreeBSD。 GDC 和 LDC 可能会支持更多的 CPU 架构。
  • 面向对象:D 不是一种“纯”OO 语言,从 Ruby 的意义上来说,一切都是对象,或者从 Java 意义上来说,不支持任何其他范例。然而,它确实完全支持 Java 风格的 OO 作为该语言的子集,以及过程式和函数式编程。
  • 大型标准库:D1 有 Tango,符合条件。 D2 有 Phobos,按照现代标准它还不是“大”,但比 C 或 C++ 的标准库大。然而,最近人们对贡献产生了浓厚的兴趣,Andrei Alexandrescu(其主要设计师)已经接受了几位新的贡献者,包括我自己。
  • 广泛的文档:Digital Mars 网站上对标准库和语言进行了相当详细的记录。还有 Andrei Alexandrescu 的书“D 编程语言”
  • Web 开发:这是一个公认的弱点。 D 还没有一个好的 Web 框架,尽管它的原生 unicode 支持和出色的通用编程支持应该使编写一个框架相对容易。

You could try D. My one-sentence description of why it's an awesome language is that its generic programming/compile-time introspection/template metaprogramming facilities are good enough to give you almost flexibility of a duck-typed language, while its execution speed and static type checking rival or exceed C++ and C#.

I think it meets your requirements quite well.

  • Open source: The frontend to the reference DMD implementation is open source (the back end isn't due to restrictions beyond the author's control). Work is underway to glue the reference frontend to open source backends such as LLVM (LDC) and GCC (GDC). In the case of D1 (the older version of the language) the LLVM port is fairly mature.
  • Compiled: D is meant to be compiled to native machine code, i.e. raw, inscrutable hexadecimal numbers.
  • Cross-platform: The reference DMD compiler supports x86 Windows, Linux, Mac OS X and FreeBSD. GDC and LDC will likely support a lot more CPU architectures.
  • Object oriented: D isn't a "pure" OO language in the Ruby sense of everything being an object, or in the Java sense of not supporting any other paradigm. It does, however, fully support Java-style OO as a subset of the language, along with procedural and functional style programming.
  • Large standard library: D1 has Tango, which qualifies. D2 has Phobos, which is not "large" yet by modern standards but is larger than C or C++'s standard lib. However, recently there has been a large interest in contributing and Andrei Alexandrescu (its main designer) has accepted several new contributors, including myself.
  • Extensive documentation: The standard library and language are reasonably well documented at the Digital Mars website. There's also Andrei Alexandrescu's book "The D Programming Language".
  • Web development: This is an admitted weakness. D doesn't (yet) have a good web framework, though its native unicode support and excellent generic programming support should make writing one relatively easy.
纸短情长 2024-09-21 22:28:56

我也希望出现另一种类似 Java 的技术。最近我一直在做 Flex/Actionscript。虽然我真的很喜欢它,但 Actionscript 技术严重缺乏 Java 所具有的优雅性。 Adobe 可以编写一些优秀的跨平台 API,但他们只是没有足够的资本来构建优雅的语言和编译器。我也尝试过 Ruby,但是 Ruby 的 VM 非常糟糕。在尝试过其他技术之后,我又回到了 Java,我认为这是因为该语言足够好,但 JVM 是迄今为止最好的。

那么您想继续使用 JVM 还是真的想完全离开 JVM?留在 JVM 上有很多选择:JRuby、Scala、Groovy、Javascript、Clojure 是主要参与者。然而,有大量优秀的语言可以利用 JVM 的功能。

除了 JVM 之外,还有一些不错的选择,例如 python、ruby 和 erlang。但是,您放弃了 JVM 的一些优秀特性,例如性能(重要的特性),以及如果您需要速度,则可以选择使用 Java 等优秀语言。其他的则意味着使用 C 或根本不使用 C。

我终于不再担心 Java 的未来了。 Sun 竭尽全力把事情搞砸,但结果仍然非常好。我认为开源对 Java 成功的影响力比 Oracle 或 Sun 的影响力大得多。

I too would like another Java-like technology to come along. Lately I've been doing Flex/Actionscript. While I really enjoy it, Actionscript technology seriously lacks the elegance that Java has. Adobe can write some good cross platform APIs, but they just don't have the head capital to build elegant languages and compilers. I've also tried Ruby, but the VM for Ruby is really bad. I've gone back to Java after my flirtation with other technologies and I think it's because the language is good enough, but the JVM is by far the best out there.

So do you want to stay with the JVM or do you really want to the leave the JVM altogether? Staying on the JVM there are lots of options: JRuby, Scala, Groovy, Javascript, Clojure are the big players. However, there are tons of great languages that can take advantage of the JVM's features.

Leaving the JVM there are still good options like python, ruby, and erlang. But you give up some of the nice features of the JVM like performance (big one), and the ability to drop down to a nice language like Java if you need speed. Those others mean using C or nothing at all.

I finally stopped worrying about Java's future. Sun did all it could to screw it up and it still turned out pretty darn good. I think Opensource has a lot more influence over Java's success than Oracle or Sun could ever have had.

舟遥客 2024-09-21 22:28:56

我还不能发表评论,所以我发布了与 Python 讨论相关的答案。虽然 Python 没有编译为机器代码,但有一个名为 Cython 的 Python 到 C 编译器,它几乎可以编译所有有效的 Python —— 闭包终于(!)出现在最新的开发版本中。它对 Python 社区的某些部分产生了很大的影响,例如,我最近在 Euroscipy,超过一半的演讲都提到了 Cython。

I can't post comments yet, so I'm posting an answer related to the Python discussion. Though Python isn't compiled to machine code, there is a Python-to-C compiler called Cython, which can compile nearly all valid Python -- closures are finally (!) in the latest development release. It's have a big impact on some parts of the Python commmunity, e.g., I was at Euroscipy recently, and over half the talks mentioned Cython.

赢得她心 2024-09-21 22:28:56

我个人不喜欢PHP,但它确实满足您的所有要求。它并不正式支持编译,但有 Hip Hop 项目可以编译 PHP到 C 代码。 Facebook 目前正在领导这个项目。

也就是说,我强烈建议您不要使用它:)

I personally don't like PHP, but it does meet all of your requirements. It doesn't officially support compilation but there is the Hip Hop project which compiles PHP to C code. Facebook is currently heading up this project.

That said, I highly discourage you from using it :)

孤者何惧 2024-09-21 22:28:56

C# 是唯一能够满足您的需求,并且不会让人感到无可救药的过时,或者因库有限而感到沮丧的东西。对于开源/非 Windows,请使用 mono。它是 CLR 中大部分重要内容的良好、成熟的实现。

有些东西(WPF、WCF 等)在 Mono 中“缺失”,但它们并不是平台的一部分,因为它们是特定于 Windows 的专有工具包。其中一些正在 Mono 中缓慢实现,有些则不然。来自 Java 的您不会错过它们,因为您正在寻找一个平台和良好的标准库来构建,而不是 GUI 工具包或高超的通信框架。

就使用“类似”java 构建内容并提供类似级别功能的平台而言,C# + CLR 是最明确的选择。

C# is the only thing that will meet your needs and not feel hopelessly archaic, or frustrate with limited library. For open source/non-windows, use mono. It's a good, mature implementation of most of what's important in the CLR.

Some things (WPF, WCF, etc) are "missing" from mono, but these aren't so much part of the platform as they are windows-specific proprietary toolkits. Some of them are being implemented slowly in mono, some aren't. Coming from java you won't miss them because you're looking for a platform and good standard libraries to build upon, not a gui toolkit or whiz-bang communication framework.

As far as a platform to build stuff with that's "like" java and offers similar levels of functionality, C# + CLR is the clearest option.

冧九 2024-09-21 22:28:56

使用 Cython,您可以充分利用这两个世界:使用 python 进行编码的能力、使用 C 和 C++ 进行编码的能力,当然还可以编译代码,以及开箱即用使用 python ac/c++ 库的能力。如果您不喜欢 C++ 语法,cython 语法是 python 语法等等。

链接文本

Using also Cython you get the best of the two worlds , the ability to code in python , the ability to code in C and C++ and of course compile your code and the ability to use both python a c/c++ libraries out of the box. And if you dont like C++ syntax , cython syntax is python syntax and more.

link text

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文