jvm-languages

Differences between JVM implementations

╄→尐↘猪︶ㄣ 提交于 2019-11-30 06:22:16
问题 Where do JVM Implementations differ (except licensing)? Does every JVM implement Type Erasure for the Generic handling? Where are the differences between: JRockit IBM JVM SUN JVM Open JDK Blackdown Kaffe ..... Deals one of them with Tail-Call-Optimization? 回答1: JVM implementations can differ in the way they implement JIT compiling, optimizations, garbage collection, platforms supported, version of Java supported, etc. They all must meet set of features and behaviors so that it will execute

Why not use GlobalScope.launch?

♀尐吖头ヾ 提交于 2019-11-30 04:25:21
问题 I read that usage of Globalscope is highly discouraged, here. I have a simple use-case. For every kafka message (let's say a list of Ids) that I receive I have to split it and invoke a rest service simultaneously and wait for it to be done and proceed with other synchronous tasks. There is nothing else is in that application that requires coroutine. In this case, Can I just get away with it? Note: This is not an android application. It's just a kafka stream processor running on server side.

Stack-based machine depends on a register-based machine?

白昼怎懂夜的黑 提交于 2019-11-29 23:09:20
问题 Normal CPUs (for example, Android devices) are register-based machines. The Java virtual Machine is a stack based machine. But does a stack-based machine depend on a register-based machine to work? Can't stack-based machines run lonely, because it is not a OS? Are there any stack-based machine examples except the JVM? Some are saying 1 operand, 2 operand; why do you need this? 回答1: The JVM does not mention the existence of registers anywhere. From its perspective, memory exists in only a few

Haskell on JVM?

老子叫甜甜 提交于 2019-11-29 20:14:01
I'm wondering if there is some way to make Haskell run on the JVM (compiled or interpreted)? There exists JHaskell on Sourceforge but this one seems to be empty and dead. GHC uses LLVM as compiler backend. Would it be a good idea or possible to compile LLVM to Java bytecode? Or maybe use a different compiler backend? You may want to investigate Frege . Quoting from that page: "Frege is a non-strict, pure functional programming language in the spirit of Haskell." "Frege programs are compiled to Java and run in a JVM." Based on a brief perusal of the language specification, Frege looks to be

Create a JVM programming language

三世轮回 提交于 2019-11-29 18:35:17
I have created a compiler in C (using lex & bison) for a dynamic typed programming language that supports loops, functions declarations inside functions, recursive calls etc. I also created a virtual machine that runs the intermediate code created by the compiler. I was now thinking instead of compiling to my own intermediate code, compile it to java byte code. I saw that the question about creating a JVM language has already been asked but I don't find the answer very informative. So here are my questions: I guess to create a language for JVM a must is to read the JVM specification book, what

Canonical reference on JVM internals for programmer/developers [closed]

家住魔仙堡 提交于 2019-11-29 12:31:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . The title captures my question fairly well. I'm wondering if there is a good resource or leaping-off point for questions about how a JVM (not just HotSpot, but that's obviously the place to start) implements or handles a specific functionality? I'm not looking for the stuff that's in the JLS or JVM Spec -- I know

Generating a 'Hello, World!' class with the Java ASM library

大兔子大兔子 提交于 2019-11-29 08:31:39
问题 I have started messing around with the ASM API for a compiler project I am working on. However, I am finding that the documentation is less than clear for a newcomer in many places and I thought having a good solid example of generating a class that simply prints "Hello, World!" would be a great example to have on here. Currently, I can generate a class with a main() (using the ClassWriter, ClassVisitor and MethodVisitor classes) but I can't seem to work out how to generate main's body. Could

Is Clojure compiled or interpreted?

為{幸葍}努か 提交于 2019-11-29 02:10:09
问题 I read somewhere Clojure is compiled. Is it really compiled, like Java or Scala, rather than interpreted, like Jython or JRuby? 回答1: Clojure is always compiled . The Clojure compiler produces Java byte code, which is typically then JIT-compiled to native code by the JVM. The thing that can be confusing is the dynamic and interactive nature of Clojure that means you can invoke the compiler at run-time if you want to. This is all part of the Lisp "code is data" tradition. For example, the

What is the maximum of number of arguments for varargs in java?

久未见 提交于 2019-11-29 01:25:36
What is the maximum of number of arguments which can be used by a vararg in java ? I believe there should be some limit and it is not infinite. A method (including the static class initializer) can have at most 64k. If the arguments are such that they can be pushed with a single bytecode that is 1 byte long each, you can have something about 64000 arguments on a call. 来源: https://stackoverflow.com/questions/18164255/what-is-the-maximum-of-number-of-arguments-for-varargs-in-java

Differences between JVM implementations

风格不统一 提交于 2019-11-28 17:18:13
Where do JVM Implementations differ (except licensing)? Does every JVM implement Type Erasure for the Generic handling? Where are the differences between: JRockit IBM JVM SUN JVM Open JDK Blackdown Kaffe ..... Deals one of them with Tail-Call-Optimization? James Schek JVM implementations can differ in the way they implement JIT compiling, optimizations, garbage collection, platforms supported, version of Java supported, etc. They all must meet set of features and behaviors so that it will execute your Java bytecodes correctly. As you've pointed out, the major difference tends to be in