Skip to main content
Post Closed as "Duplicate" by gnat, Ixrec, CommunityBot
I removed the big EDIT banner at the top as it spoiled the way the question reads. I'll put a comment to the author too explaining what I did :)
Source Link

Edit:

Clarified question, as I feel that the linked question is similar but not exactly the same as what I was asking.


I just learned about Scala yesterday, and I'd like to learn more about it. One thing that came to mind, however, from reading the Scala website is that if Scala runs on the JVM, then how is it possible for bytecode compiled from Scala source to be able to achieve things that Java can't readily do, such as (but not limited to) reified generics?

I understand that the compiler is what generates the bytecode; so as long as the compiler can massage source code into valid bytecode supported by the JVM, then both should be equivalent. But I was under the impression that Java couldn't even reify its own generics, so how could another compiler be able to pull this off?

Edit:

Clarified question, as I feel that the linked question is similar but not exactly the same as what I was asking.


I just learned about Scala yesterday, and I'd like to learn more about it. One thing that came to mind, however, from reading the Scala website is that if Scala runs on the JVM, then how is it possible for bytecode compiled from Scala source to be able to achieve things that Java can't readily do, such as (but not limited to) reified generics?

I understand that the compiler is what generates the bytecode; so as long as the compiler can massage source code into valid bytecode supported by the JVM, then both should be equivalent. But I was under the impression that Java couldn't even reify its own generics, so how could another compiler be able to pull this off?

I just learned about Scala yesterday, and I'd like to learn more about it. One thing that came to mind, however, from reading the Scala website is that if Scala runs on the JVM, then how is it possible for bytecode compiled from Scala source to be able to achieve things that Java can't readily do, such as (but not limited to) reified generics?

I understand that the compiler is what generates the bytecode; so as long as the compiler can massage source code into valid bytecode supported by the JVM, then both should be equivalent. But I was under the impression that Java couldn't even reify its own generics, so how could another compiler be able to pull this off?

added 131 characters in body
Source Link
Mirrana
  • 1.1k
  • 2
  • 13
  • 20

Edit:

Clarified question, as I feel that the linked question is similar but not exactly the same as what I was asking.


I just learned about Scala yesterday, and I'd like to learn more about it. One thing that came to mind, however, from reading the Scala website is that if Scala runs on the JVM, then how is it possible for bytecode compiled from Scala source to be able to achieve things that Java can't readily do, such as (but not limited to) reified generics?

I understand that the compiler is what generates the bytecode; so as long as the compiler can massage source code into valid bytecode supported by the JVM, then both should be equivalent. But I was under the impression that Java couldn't even reify its own generics, so how could another compiler be able to pull this off?

I just learned about Scala yesterday, and I'd like to learn more about it. One thing that came to mind, however, from reading the Scala website is that if Scala runs on the JVM, then how is it possible for bytecode compiled from Scala source to be able to achieve things that Java can't readily do, such as (but not limited to) reified generics?

I understand that the compiler is what generates the bytecode; so as long as the compiler can massage source code into valid bytecode supported by the JVM, then both should be equivalent. But I was under the impression that Java couldn't even reify its own generics, so how could another compiler be able to pull this off?

Edit:

Clarified question, as I feel that the linked question is similar but not exactly the same as what I was asking.


I just learned about Scala yesterday, and I'd like to learn more about it. One thing that came to mind, however, from reading the Scala website is that if Scala runs on the JVM, then how is it possible for bytecode compiled from Scala source to be able to achieve things that Java can't readily do, such as (but not limited to) reified generics?

I understand that the compiler is what generates the bytecode; so as long as the compiler can massage source code into valid bytecode supported by the JVM, then both should be equivalent. But I was under the impression that Java couldn't even reify its own generics, so how could another compiler be able to pull this off?

Edit to clarify question
Source Link
Mirrana
  • 1.1k
  • 2
  • 13
  • 20

If Scala runs on the JVM, how can it be much different thanScala do things that Java (except for maybe syntax)seemingly cannot?

I just learned about Scala yesterday, and I'd like to learn more about it. I'm mostly familiar with Java, so it may not be too much of a stretch to learn it. But oneOne thing that came to mind, however, from reading the scalaScala website is, that if Scala runs on the JVM, then how is it possible for a program written inbytecode compiled from Scala source to dobe able to achieve things any differently than whatthat Java can alreadycan't readily do at the bytecode level? Can, such as (or could at some pointbut not limited to) Scala handle reified generics?

Basically my thought isI understand that if it's not possible to do in Javathe compiler is what generates the bytecode; so as long as the compiler can massage source code into valid bytecode supported by the JVM, then I'd assumeboth should be equivalent. But I was under the impression that it's not possibleJava couldn't even reify its own generics, so how could another compiler be able to do in Scala either.pull this off?

If Scala runs on the JVM, how can it be much different than Java (except for maybe syntax)?

I just learned about Scala yesterday, and I'd like to learn more about it. I'm mostly familiar with Java, so it may not be too much of a stretch to learn it. But one thing that came to mind from reading the scala website is, if Scala runs on the JVM, then how is it possible for a program written in Scala to do things any differently than what Java can already do at the bytecode level? Can (or could at some point) Scala handle reified generics?

Basically my thought is that if it's not possible to do in Java, then I'd assume that it's not possible to do in Scala either.

If Scala runs on the JVM, how can Scala do things that Java seemingly cannot?

I just learned about Scala yesterday, and I'd like to learn more about it. One thing that came to mind, however, from reading the Scala website is that if Scala runs on the JVM, then how is it possible for bytecode compiled from Scala source to be able to achieve things that Java can't readily do, such as (but not limited to) reified generics?

I understand that the compiler is what generates the bytecode; so as long as the compiler can massage source code into valid bytecode supported by the JVM, then both should be equivalent. But I was under the impression that Java couldn't even reify its own generics, so how could another compiler be able to pull this off?

Tweeted twitter.com/#!/StackProgrammer/status/592073123232673792
edited tags
Link
yannis
  • 39.7k
  • 40
  • 185
  • 218
Loading
Source Link
Mirrana
  • 1.1k
  • 2
  • 13
  • 20
Loading