Nuevo Kotlin User Group en Valencia y event "Estado de Machine Learning en Kotlin"
¡Se acaba de inaugurar el nuevo Kotlin Valencia User Group! Inicialmente organizado por Carlos Cáceres
Nos complace anunciar la liberación de Kotlin/Native v0.3.
¡Con esta versión vamos a nuevos lugares! A partir de la v0.3 Windows tanto como host de compilación, como host de ejecución, y dispositivos Android como target de ejecución con actividades nativas. De tal forma, un <code class="highlighter-rouge">'Hello World'
con el API de Windows, es algo tan sencillo como esto:
fun main(args: Array
Y el proceso de eventos de las actividades nativas de Android:
if (AInputQueue_getEvent(queue, event.ptr) < 0) { logError("Failure reading input event") return } if (AInputEvent_getType(event.value) == AINPUT_EVENT_TYPE_MOTION) { when (AKeyEvent_getAction(event.value) and AMOTION_EVENT_ACTION_MASK) { AMOTION_EVENT_ACTION_DOWN -> { animating = false currentPoint = getEventPoint(event.value, 0) startTime = getEventTime(event.value) startPoint = currentPoint } AMOTION_EVENT_ACTION_UP -> { val endPoint = getEventPoint(event.value, 0) val endTime = getEventTime(event.value) .... } AMOTION_EVENT_ACTION_MOVE -> { val numberOfPointers = AMotionEvent_getPointerCount(event.value).toInt() for (i in 0 until numberOfPointers) move(getEventPoint(event.value, i)) } } AInputQueue_finishEvent(queue, event.value, 1)
Con esta versión soportamos depuración a nivel de código fuente (únicamente paso a paso). Por ejemplo, probad:
$ bin/konanc string0.kt -g -o string0 $ lldb ./string0.kexe (lldb) target create "string0.kexe" Current executable set to 'string0.kexe' (x86_64). (lldb) b string0.kt:1 Breakpoint 1: where = string0.kexe'kfun:main(kotlin.Array<kotlin.String>) + 4 at string0.kt:1, address = 0x0000000100001344 (lldb) r Process 12288 launched: '/Users/jetbrains/kotlin/kotlin-native-release/kotlin-native/string0.kexe' (x86_64) Process 12288 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x0000000100001344 string0.kexe'kfun:main(kotlin.Array<kotlin.String>) at string0.kt:1 -> 1 fun main(args: Array
Y por último, pero no por ello menos importante, hemos introducido un formato de librería nuevo, llamado .klib, cuyo propósito es ser el formato de distribuciónpor defecto, de las librerías de Kotlin/Native. Las librerías nativas y frameworks pueden interoperar fácilmente usando .klib y usarse con el compilador de Kotlin/Native especificando el switch de la línea de comandos -library library o con la opción del plugin de Gradle library.
La herramienta de interoperabilidad ya produce archivos .klib por defecto. Para más detalles sobre este formato de librería, por favor, mirad aquí.
Los binarios se pueden descargar desde las siguientes direcciones:
Cualquier bug o problema que encontréis se puede reportar en el bug tracker de Kotlin.