What's up with Koolapp?

I discovered Koolapp (https://github.com/koolapp/koolapp) on github while looking around for kotlin projects. It looks very cool (or should I say kool?).. both the kool-template and the kool-streams (which seems powerful even though I'm not totally sure what I could use it for in practice).  Since I don't know where else to discuss it I figured I'd ask about it here.

Props to James for all the great work he’s doing on Kotlin!  James, would you mind saying a bit about koolapp, like any tips on getting started?  If you’d like help writing documentation, tutorial, etc. I’d be glad to help out!

Also, one thing I noticed when I try to build this project is that IntelliJ seems to be able to resolve references (no red squigglies and you can ctrl-click to go to declarations), but when I “Make project”  I get a whole bunch of unresolved references/compilation errors.  Maybe this is a bug in the Kotlin plugin that is still being worked out?  Should I report it?  I also tried building with maven and got similar unresolved reference error.

Thanks for your kind words. Welcome and we love contributions! :).

So KoolApp is very early days but the basic idea is to provide a framework for building modern rich web applications in Kotlin so that the application logic and templates can be used on the client side in JavaScript in a browser, in a custom application (Android, iOS), or JavaFX native client - or the templates and logic can be reused on a JVM server side along with providing an optional REST back end using JAXRS. Still pretty early days though :slight_smile:

The Kool Streams stuff may seem a little bit wacky so far but they are basically an idea to make event handling code, or asynchronous requests easier; so we can make asynchronous requests on back end systems with caching, throttling, filtering duplicates and so forth all in simple, composable code. e.g. imagine the complexities of dealing with text entered into a auto-complete field; filtering out duplicate values, throttling changes (in case folks type crazy fast), making asynchronous requests, dealing with errors and discarding old asynchronous search results easily when new text is entered. That should become trivial with Kool Streams.

Kool Templates make DOM nodes; which may seem odd at first but it means its nice and efficient on a browser with low GC overhead. We’ve almost got full statically typed HTML5 support (generating code from the HTML5 specification).

The next step is to integrates Kool Streams into Kool Templates; so the created DOM nodes become live; binding to the underlying models or streams and updating themselves automatically so you can just create an eventful domain model or subscribe to remove events over websockets or whatever then create a template and you’re mostly done - you just focus on responding to events and doing the controller parts where needed.

Stepping back we should probably not spam the kotlin forums too much with separate projects though :slight_smile: I’ve setup a koolapp forum if you want to delve into details on koolapp - though its a handy demo right now of how to build kotlin applications using the maven plugins and generate API docs and so forth.

Incidentally I work on koolapp by just opening the root pom.xml and letting IDEA do its magic. Ensure you’ve a recent IDEA build (e.g. EAP build) and a recent kotlin plugin and it should work - let me know if it doesn’t. Its maybe worth trying to build it first from maven on the command line just in case; if the build works fine, then IDEA import should be fine too. FWIW I tend to live life on the edge with the most recent Kotlin plugin.

Finally its worth saying that there’s lots to do on Kotlin too and we welcome contributions here too, check out the Contributing section of the ReadMe. Looking forward to your contributions! :slight_smile:

Actually if you were previously having compile issues with WindowStream.kt, I've pushed a fix, try pulling the latest. A recent change in standard library had introduced a compile error

Thanks for the overview and additional explanation, James.  It certainly would be awesome/kool to be able to reuse the same logic/code/templates for web apps as well as Android and JavaFX!

The example you gave for Kool streams gives me a better idea (async requests like autocompletion).  I’m still reading through the examples (unit tests) mentioned in the ReadMe file to understand it better.  The stock ticker example looks like an interesting practical application, but when I ran it I didn’t actually understand what it’s doing (and what the purpose is) so I guess I still have to learn more about it!

By the way, I was able to build/compile most modules individually, except for html-modelgen and the website module.  I will post the details on the new koolapp forum, now that you’ve set that up :slight_smile: