How many layers of abstraction are enough?

How many layers of abstraction are enough?




n + 1

Like, maybe 5 or 6 right now. My dude.

s u c c


so if im not wrong java gets compiled to some bytecode that is ran in a virtual machine

how many layers is that?

assembly for the vm->java bytecode->java code

>implying it is this easy
Fuck off, pajeet

i dont know, i dont use java

explain it to me

No one actually knows how it works. Not even the developers themselves.


needs moar vms

Britty this.

it gets compiled to bytecode and then that bytecode gets compiled into for example x86 opcodes at runtime when a given code path is first used or the JIT feels like it


good post


i see, doesnt sound too bad which makes sense seeing as java is pretty fast

is there any way to keep java output machine code for next host reboot?

dude i have no idea lmao

>write java
>if you're evil and use preprocessors they compile to standard java
>java compiler compiles to bytecode
>jvm interpreters bytecode
>compiles it to native instructions when it feels like doing that
>also optimizes it heavy-handedly
>if it detects unusual situation it rolls back to bytecode interpretertation

sounds inefficient, but it just werks

its not that inefficient
since you're optimizing at runtime you know what the processor your program is running on supports
using java code for gui stuff sucks though

>using java code for gui stuff sucks though
Iktf, javafx is quite nice, but it's still a joke.

It's worth it though. JVM can continue interpreting while it inspects and compiles the code and after that java can be as fast or even faster than C++, depending on what you're running.

The actually inefficient part is the bytecode. For a layman it might sound like a huge performance boost but it actually doesnt help much. It'd be pretty much as slow intepreting the java source code by itself.


as many as you need to use an actual language

What about GWT?
>write java
>translate to javascript
>run on jit v8

and you can still write things like IsEvenlyDivisibleStrategy and it works and you can even debug it in the browser

you can if you freeze the jvm process
most of real industry application uses VMs btw
>vm on top of vm on top of the hw

All Intel chips from 2009 and later have a built-in hardware jvm.

Kek, this

That's not true.
Even if it was (and java instructions and memory management was hardwired to the cpu), the hypervisor would ban the java instruction set when running inside full virtualization, which is precisely the technique used in industry today. Forget parashit.

It's honestly a miracle that it runs as well as it does.

Please, should I start with Java or C, I don't know what to do, I like it that Java is supposed to protect me but I'm afraid Java will some how leave me dumber. Or does it matter at all. I wanted to try Python but was told to try Java instead which is as easy but is close enough to C to help your switch to C.

What should I do, I want to be protected by Java but I don't want to have bad habits? Please help.

Java does not protect you. It's an incredibly structured language that forces you to pick up only good habits.

With C things can work that dont aren't really a good way to do things, and the compiler is incredibly vague.

I'm a firm believer that Java or even Python is the place to start.

I WILL START WITH JAVA, Thank you so much sir.


how much memory do you have?


This is a myth. Initial JIT execution is a STW (Stop the World) event. Much like GC, and integer division. All threads are stopped, all execution is rolled back to the last function it entered. The JVM takes the wheel, runs the byte code, then runs the JIT code. And checks they produce the same result.

THEN all other threads resume.

There really is no HPC for Java. It is a system language you code in because ITJUSTWERKS, and its really easy to find developers who'll put up with your corporate BS.

S U C C layers is enough

Please don't troll newbies like this.

slow as shit