Kotlin 1.2 EAP now available

Good news for all Kotlin coders - early access program of Kotlin 1.2 available
19 July 2017   1654
Kotlin

Statically-typed programming language that runs on the Java Virtual Machine and also can be compiled to JavaScript source code.

Kotlin team recently announced the start of the early access program for Kotlin 1.2. First milestone 1.2M1 was out recently. This is reported by official Kotlin Blog

Let's have a good look at the most interesting features of EAP.

Language feature: array literals in annotations

The single notable language feature proposed in this milestone is array literals, whose usages are constrained to annotation arguments.

In order to specify an array of values, coder had to write something like this:

@CacheConfig(cacheNames = arrayOf("books", "default"))
public class BookRepositoryImpl {
    // ....
}

Now, in Kotlin 1.2 a literal can be used instead of the arrayOf function:

@CacheConfig(cacheNames = ["books", "default"])

public class BookRepositoryImpl {

    // ....

}

Additionally, an IDE inspection will propose you to use the new syntax of collection literals where appropriate.

Inline function with optional functional parameters

Earlier, it was impossible to declare an inline higher order function with an optional functional parameter like the following:

inline fun <E> List<E>.printItems(transform: (E) -> String = { it.toString() })

One had to either make the function itself non-inline or mark the functional parameter as noinline. In either case that defeated the purpose of functional parameter inlining.

Now this case is fully supported.

Standard Library API

This release features two KEEPs (Kotlin Evolution and Enhancement Proposals) regarding the standard library API.

The first is KEEP-49 . It provides additional operations and conversion extensions for BigIntegerand BigDecimal types.

The second one is KEEP-11 which covers a number of functions related to partitioning collections and sequences:

  • chunked(size: Int) extension function partitions a collection into blocks of the given size;
  • windowed(size: Int, step: Int) takes a window of the given size and moves it along the collection with the given step returning the sublists of elements falling into each window;
  • pairwise() extension returns all subsequent pairs in a collection.

JavaScript

Earlier in 1.1.2 release developers have introduced the opt-in JS typed arrays support. When enabled it translates Kotlin primitive arrays, such as IntArrayDoubleArray etc, into JavaScript typed arrays. Now the opt-in is no longer required as this support is enabled by default.

You can find more info at changelog and Kotlin Blog.

Firefox to Launch Preview Browser

Firefox Preview uses the GeckoView engine built on the basis of Firefox Quantum and team states its 2x faster than previous Firefox browser for Android
28 June 2019   417

Mozilla introduced the first trial release of the Firefox Preview browser, developed under the codename Fenix ​​and aimed at initial testing by interested enthusiasts. The release is distributed through the Google Play catalog, and the code is available on GitHub. After stabilization of the project and implementation of all conceived functionality, the browser will replace the current edition of Firefox for Android, the release of which will be discontinued starting with the September release of Firefox 69 (only corrective updates of the Firefox 68 ESR branch will be published).

Firefox Preview uses the GeckoView engine built on the basis of Firefox Quantum technologies and a set of Mozilla Android Components libraries, which are already used to build Firefox Focus and Firefox Lite browsers. GeckoView is a version of the Gecko engine, designed as a separate library that can be updated independently, and Android Components includes libraries with typical components that provide tabbed browsing, automatic input completion, search hints, and other browser features.

Firefox Preview
Firefox Preview

These are some features developers claim their app has:

  • Faster than ever: Firefox Preview is up to 2x faster than previous versions of Firefox for Android.
  • Fast by design: with a minimalist start screen and bottom navigation bar, Preview helps you get more done on the go.
  • Stay organized: Make sense of the web with Collections, a new feature that helps you save, organize, and share collections of sites. Quickly save and return to tasks like your morning routine, shopping lists, travel planning and more.
  • Tracking Protection on by default: Everyone deserves freedom from invasive advertising trackers and other bad actors so Firefox Preview blocks trackers by default. The result is faster browsing and fewer annoyances.