elect
10/16/2021, 9:58 AMsuresh
10/21/2021, 4:53 PMAlejandro Serrano Mena
10/21/2021, 8:16 PMFirTypeAttributeExtension
ensured to be run over all possible functions before the next steps in the analysis continue; if not, what is the best way to perform this?
• the analysis works in two stages; what is the best way for a FIR plug-in to introduce several stages?
thanks very much in advance!Mikhail Bolotov
10/22/2021, 6:41 PMfun <S> create(code: () -> S): S {
println("string")
return code()
}
fun create(code: () -> Unit) {
println("unit")
}
fun main() {
create { "a" } // prints unit
val a = { "a" }
create(a) // prints string
}
jw
10/28/2021, 3:09 AMDave
10/28/2021, 2:23 PMmoduleFragment.descriptor.allDependencyModules
but it does not seem to give me the depended on modules?
I also tried `
(pluginContext.symbolTable as SymbolTable).forEachPublicSymbol {
but I only get the symbols from the current module.
some pointers in the right direction for either of these would be great, thanksAlejandro Serrano Mena
10/29/2021, 2:18 PMJustin Tullgren
11/02/2021, 9:10 PMelect
11/04/2021, 8:06 AMkotlinc
this way (via gradle project.exe
):
[C:\Users\elect\IdeaProjects\lwjgl3\bin2\libs\kotlinc\bin\kotlinc.bat, -d, C:\Users\elect\IdeaProjects\lwjgl3\bin2\classes\generator, -jvm-target, 1.8, -module-name, generator, -progressive, -version, -Xlambdas=indy, -Xno-call-assertions, -Xno-param-assertions, -Xreport-perf, C:\Users\elect\IdeaProjects\lwjgl3\modules\generator\src\main\kotlin]
And I see on the output:
info: kotlinc-jvm 1.5.31 (JRE 11.0.9.1+1-LTS)
warning: advanced option value is passed in an obsolete form. Please use the '=' character to specify the value: -Xlambdas=...Which is weird, because I'm actually using that form.. This is on Windows though, on Linux no issues..
Chachako
11/06/2021, 5:14 PMval
of property to var
in IrElementTransformerVoid.visitPropertyNew
, but I found that isVar
is a immutable value. What should I do?Chachako
11/07/2021, 5:47 PMIrGenerationExtension.visitCall
?Deactivated User
11/10/2021, 1:50 PMralf
11/10/2021, 11:01 PMIrGenerationExtension
for the IR implementation and ExpressionCodegenExtension
. When KAPT is enabled in the stub generating task I see the ExpressionCodegenExtension
being called rather than the IR implementation. Is the stub generating task not using the IR backend and still relies on the old backend? I’ve tested with 1.5.31
and 1.6.0-RC2
.groostav
11/10/2021, 11:05 PMpublic class DoubleArrayList(): AbstractList<Double> {
public operator fun get(index: Int): Double //I want the signature (I)D.
// I do NOT want the signature (I)Ljava/lang/Double;
}
?
I cant help but feel like with all the sophistication of inline classes, kotlins type unification and etc, I could finally have a List<Double>
that doesnt do an enormous amount of boxing/unboxing.
Like, why not generate a function get()
that's (I)Lj/l/Double;
and a function get_$D()
that's (I)D
, and where the compiler can be certain ahead of time that we're calling DoubleArrayList's get
, it generates code for`get_$D` instead of get()
?
Again, I know theres a good reason, im just curious.
I'm doing some profiling of my app right now, which itself delegates most work to some (fairly recent) fortran code, but it does have some hot loops on the VM, and most are related to poor performance of Map<String, Double>
and List<Double>
Some of those are architectural but, it would be nice if i could flip a kind of switch to say "stop using Double[]
as your backing data types and start using double[]
" to see how that helps performanceGlen
11/11/2021, 12:41 AMKarel Petránek
11/11/2021, 12:53 AMcompileProductionLibraryKotlinJs
task and it seems JS gets compiled twice - once into a klib where the compiler plugin is called correctly and later into a JS library where the compiler plugin is not invoked at all. This means that my changes are visible in the klib but not in the resulting JS library code. Is this an expected behavior? Can I get the IR plugin to execute every time a JS compilation is running? It also seems inefficient to run it twice (I don’t necessarily need the klib...).
I’m on Kotlin 1.5.31, Gradle 7.2. My Gradle configuration:
js(IR) {
moduleName = "facemoji-core"
browser {
webpackTask {
output.libraryTarget = "commonjs-module"
}
}
binaries.library()
compilations.all {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.ExperimentalStdlibApi -Xopt-in=kotlin.RequiresOptIn"
}
}
}
galex
11/11/2021, 10:29 AMandroid-kotlin-extensions
! I love it and I don’t want to use ViewBinding
as we have lots and lots of layout and running its annotation processor is making the project quite unstable.
So the question is, where do I start for the core of its functionality, meaning adding a Hashmap to any class that uses it, and call findViewById
on the first use of a property? 😄Nathan Bedell
11/12/2021, 1:15 AMModuleDescriptor
from a KtFile
in version 1.5.0 of the kotlin-compiler-embeddable
?
I'm working on a compiler plugin, and using some utilities from forge that require a ModuleDescriptor
in their API, but I can't figure out how to properly construct one from a KtFile
.holgerbrandl
11/12/2021, 8:31 AMfun interface SmthgSAMGeneric<T> {
fun foo(): (T, T) -> String
}
val samAsObject = object : SmthgSAMGeneric<String> {
override fun foo(): (String, String) -> String {
return { s: String, s2: String -> "42" }
}
}
val inlineSam = SmthgSAMGeneric<String> {
{ s: String, s2: String -> "42" }
}
See also https://github.com/EsotericSoftware/kryo/issues/867Zac Sweers
11/16/2021, 8:47 PMKType.javaType
intentionally left out of the 1.6 API promotions to stable or an oversight? Seems surprising to see that not included with the typeOf()
promotions
Edit: filed a request here in case it helps https://youtrack.jetbrains.com/issue/KT-49743nikolaymetchev
11/17/2021, 12:21 PMHakob Astvacatryan
11/19/2021, 2:30 PMTyron Scott
11/21/2021, 4:52 PMClaude Brisson
11/23/2021, 12:17 PMorg.gradle.workers.max=1
kotlin.test.junit5.maxParallelForks=1
kotlin.parallel.tasks.in.project=false
org.gradle.parallel=false
in my gradle.properfies file, but it just made the tests much slower and the same errors appeared.
The command I am running is: ./gradlew -Porg.gradle.java.installations.auto-detect=false compilerTest
. Maybe it's too wide a task, but how to refine it? Especially, how would I specifically test tweaks to the lexer and the parser? Thanks for your help.Rob Elliot
11/23/2021, 8:50 PMtypealias Result<F : Throwable, S> = Either<F, S>
Still curious what the reason for Bounds are not allowed on type alias parameters
is.Chachako
11/24/2021, 12:22 PMuseFir
in Gradle before it can be used?Zac Sweers
11/24/2021, 6:09 PMmcpiroman
11/26/2021, 9:27 AMmbonnin
11/26/2021, 9:32 AM@OptIn(SomeExperimentalApi::class)
usages? It's quite easy to leave them cluttering the codebase after the declarations have been promoted to stable (or something else is used).Johann Beleites
12/03/2021, 1:57 PMBindingContext
. Now this takes quite a while and I know the compiler is doing a lot of work in that time. Is it possible to run the compiler multi-threaded, so that I can make use of multiple cores when available and hence speed up the analysis?