- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图了解Kotlin源代码在编译时所经历的旅程。 The documentation状态
When targeting the JVM, Kotlin produces Java compatible bytecode. When targeting JavaScript, Kotlin transpiles to ES5.1 and generates code which is compatible with module systems including AMD and CommonJS. When targeting native, Kotlin will produce platform-specific code (via LLVM).
最佳答案
<...> the code is compiled/translated down to bytecode and then the JVM interprets(?) it down to machine code. Would this be an example of JIT(Just in time) compilation?
*.class
文件,这是一种字节码格式,以后可以由JVM解释,也可以由JVM在程序运行(JIT)期间编译为机器代码,甚至进行编译提前(AOT)到机器代码。在这里,Kotlin编译器不需要知道字节码的使用方式。
When targeting javascript the word "transpiles" is used. What exactly is the code compiled down to and is it interpreted or compiled further down at any step?
*.js
output files,其中包含将Kotlin代码转换为JS的源代码。我相信这里使用了transpile(翻译+编译)一词来强调目标格式是源代码,而不是二进制,而编译器仍然执行许多转换和优化。
When targeting native, is code compiled directly to machine code? What steps does LLVM take it through?
*.klib
库,可以在另一个Kotlin/Native项目中重用。这是a ZIP archive containing LLVM bitcode along with some Kotlin-specific metadata。 lld
来链接LLVM位代码中的二进制文件。 关于kotlin - Kotlin是如何专门编译的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53472710/
我有一个带有模板函数的基类,该函数具有通用模板类型和专用版本。 #ifndef BASE_CLASS #define BASE_CLASS #include using namespace std;
我有这个 3D vector 模板 template class Vec3TYPE{ public: union{ struct{ TYPE x,y,z; }; struct{ TY
我是一名优秀的程序员,十分优秀!