Kotlin library provides the keys for building interactive web apps

Share
  • December 11, 2018

Have you fallen in love with Kotlin yet? It’s not just for Android development! Today we focus on a Kotlin library that’s as fun to say out loud as it is to program with. Meet Kweb.

Pure Kotlin web apps

Kweb is a Kotlin library for building web applications and “virtually eliminates the separation between browser and server from the programmer’s perspective”.

It is lightweight with minimal overhead, since it allows for the user to interact to the browser DOM directly. Kweb will have you creating live-update web apps in no time.

SEE ALSO: Spotlight on libraries: Top 5 open source libraries for Kotlin

How does it work? From its site:

Kweb keeps all of the logic server-side, and uses efficient websockets to communicate to web browsers. We also take advantage of Kotlin’s powerful new coroutines mechanisms to efficiently handle asynchronicity, largely invisibly to the programmer.

kweb.io

Why Kotlin?

In order to get started with this library, you will build off of your Kotlin knowledge base as well as the Java ecosystem. If you haven’t learned Kotlin yet, how can we convince you to give this first-class programming language a try? For starters, Kotlin is the brainchild of software development company JetBrains. You may already know them from their popular tool IntelliJ.

Read about the latest release, Kotlin version 1.3. Version 1.3 added coroutines and reworked the model of multiplatform projects for improved flexibility.

Kotlin fixes some of the gripes that many users have with Java. Read about the comparisons here and weigh the pros and cons against each other. Kotlin has fewer issues than Java and less bugs. If you already have Java under your belt, Kotlin is an easy learn. As an added bonus, the two languages work well together.

Learn some of the basics and see how it feels.

As for its fanbase, Kotlin took the number two spot in StackOverflow’s 2018 survey for the most loved language, trailing right behind Rust and ahead of Python. It’s slowly been climbing up the charts, and while it may never reach the heights of Java, we expect to see it grow even more in 2019!

Examples & how to start

SEE ALSO: Haven: A simple Kotlin library to keep your JSON data safe

Looking for code examples? The main kweb.io page shows an example in which Kweb is used to “attack a click listener to a hyperlink which increments a global click counter”.

An article by project creator Ian Clarke, “Introducing Kweb: A unique new approach to building rich web applications” shows example code for a to-do list. The full to-do list app is available on GitHub.

Discover how to create your first “kwebsite” and see more examples of it in action on the official site. The getting started guide will help you set it up and add a Kweb dependency via JitPack.

Kweb has some room to grow. One thing it currently lacks is proper documentation.

However, it already shows its strength and usage potentials via the code samples. This library not only looks great, but is backed by an even greater idea. As always, be sure to flag any issues you come across, and join the Gitter chat to discuss it with fellow users.

So, have you given Kweb a try? Kweate any kwebsites?

The post Kotlin library provides the keys for building interactive web apps appeared first on JAXenter.

Source : JAXenter