Why do we need other JVM languages

前端 未结 17 1546
滥情空心
滥情空心 2021-02-02 10:30

I see here that there are a load of languages aside from Java that run on the JVM. I\'m a bit confused about the whole concept of other languages running in the JVM. So:

17条回答
  •  -上瘾入骨i
    2021-02-02 11:23

    The advantage for these other languages is that they get relatively easy access to lots of java libraries.

    The advantage for Java people varies depending on language -- each has a story tell Java coders about what they do better. Some will stress how they can be used to add dynamic scripting to JVM-based apps, others will just talk about how their language is easier to use, has a better syntax, or so forth.

    What's required are the same things to write any other language compiler: parsing to an AST, then transforming that to instructions for the target architecture (byte code) and storing it in the right format (.class files).

    From the users' perspective, you just write code and run the compiler binaries, and out comes .class files you can mix in with those your java compiler produces.

提交回复
热议问题