4 ms·
The API doesn't actually run on the CPU, it's just metadata.
by icebraining 7y ago
The API doesn't actually run on the CPU, it's just metadata.
- treis 7y agoCan you expand on what "actually run" and "metadata" mean in this context?
- icebraining 7y agoWhen the code of a function is compiled fully until CPU instructions, the line declaring the function name and arguments disappears in the process; it's only used as metadata by the compiler (AOT or JIT). There's no x86/ARM/etc instructions that represent a function declaration.
- treis 7y agoNo java code you write is represented by an x86/ARM/etc instruction. Everything disappears when it's compiled to byte code. If that's what makes an API metadata then every line of Java written is just metadata.
- deleted 7y ago[deleted]
- shawnz 7y agoDisagree. When you write a Java statement you are clearly intending for certain instructions to get executed as a result of processing that statement. When you write a method signature, that doesn't represent any kind of intention for something to take place.
- treis 7y agoI'm not sure what you're disagreeing with, but all the Java code you write definitely does go away > When you write a Java statement you are clearly intending for certain instructions to get executed as a result of processing that statement. When you write a method signature, that doesn't represent any kind of intention for something to take place. If we accept this argument then that means APIs are more copyrightable than code. Instructions, as in the context of recipes or process definitions, are not copyrightable. If we say code is an intent for something to be executed then that's an argument that it should not be copyrightable. Saying that an API is different and not simply instructions means that it should be subject to copyright.
- monocasa 7y agoThe code that ends up getting executed is formally equivalent to the JVM bytecode, but the method signatures completely disappear.
- btilly 7y agoThe question is to what extent that content is functionally necessary. It is possible to have two different programs that do the same thing. And therefore the exact code used is copyrightable. But it is not possible to compile my code written for Oracle against Google instead unless the method signatures match exactly. Therefore the method signatures are more functionally necessary than the exact code.
- shawnz 7y agoAgreed, I think code is more like a recipe than an API is. But I don't think the parent was arguing that APIs should or shouldn't be copyrightable because of how they compare to recipes, they were just answering your question as to how they can be clearly differentiated from code.
- saagarjha 7y agoNote that many languages embed function names in the binary, though they would work just as well with any other name that mangled in a way that wouldn't break ABI.