Насколько актуально сегодня использовать JVM?

263
R S

Разве у нас сегодня нет достаточного количества компиляторов (для разных платформ)? Например, Python - он считается кроссплатформенным языком.

0
Напротив, существует множество инструментов системного администрирования и сетевого мониторинга, написанных на Java, не зависящих от какой-либо конкретной архитектуры. ManageEngine OpManager, чтобы назвать тот, который я использую. Существуют также среды разработки, такие как Eclipse, и целые пакеты, такие как OpenOffice. boot13 8 лет назад 1
Например, почему Eclipse был написан для виртуальной машины, почему бы не использовать обычный скомпилированный язык? Затмение нужно только на ПК. R S 8 лет назад 0
На случай, если вы не знали, @ boot13, есть также [другие языки программирования, работающие на JVM] (https://en.wikipedia.org/wiki/List_of_JVM_languages). (И я не думаю, что OpenOffice работает на JVM, хотя ранние версии использовали Java для сценариев или что-то в этом роде.) Arjan 8 лет назад 0
Как вы думаете, почему люди, использующие Linux или Mac OS X, не используют Eclipse? (Кстати, этот вопрос здесь не по теме.) Arjan 8 лет назад 0
Вы знаете, сколько на самом деле стоит работа по созданию компилятора? a CVn 8 лет назад 1
@Arjan, ПК - я имею в виду персональный компьютер, настольный компьютер. Где такая тема? R S 8 лет назад 0

1 ответ на вопрос

0
grawity

There is a lot of such code. Every day you use dozens of websites which need this. Although these days they're mostly written in JavaScript and sometimes Flash's ActionScript, but the general idea remains the same.

(Remember that one of the primary uses of Java was for applets in websites – similar to Flash later and JavaScript today.)

There are also many more architectures than "PC and mobile". Over the past two decades, PCs have used a few dozen different CPU architectures – for example: 68000, PowerPC, x86, amd64, Alpha, SPARC, ARM, ARM64 – and that's just the popular ones.

So that creates problems in distributing the compiled programs.

With native code, every such website's owners would have to distribute many different versions of the same program – one for every CPU architecture (remember, it's not just two), or maybe even for every OS × CPU combination (as different operating systems have different services, different APIs, different calling conventions on the same CPU).

(Even within the same architecture, many programs compiled for Intel i686 won't run on i486 even though that's technically the same x86 – but with different features. For example, Debian Linux compiles everything for i486, so it won't make use of any modern CPU features which means programs may be a little slower. On the other hand, Arch Linux is compiled for i686, so it won't run at all on an old i486 CPU.)

With bytecode, Sun/Oracle can distribute JVMs for all architectures, and webmasters don't need to do anything other than that – they only need one .jar file for everyone.