stateful4k alternatives and similar libraries
Based on the "Misc" category.
Alternatively, view stateful4k alternatives based on common mentions on social networks and blogs.
-
jclasslib
jclasslib bytecode editor is a tool that visualizes all aspects of compiled Java class files and the contained bytecode. -
kotlin-logging
Lightweight Multiplatform logging framework for Kotlin. A convenient and performant logging facade. -
kotlin-telegram-bot
๐ค A wrapper for the Telegram Bot API written in Kotlin -
kotlinx.atomicfu
The idiomatic way to use atomic operations in Kotlin -
tinylog
tinylog is a lightweight logging framework for Java, Kotlin, Scala, and Android -
lingua
The most accurate natural language detection library for Java and the JVM, suitable for long and short text alike -
Kotlift
Kotlift is the first source-to-source language transpiler from Kotlin to Swift -
kotlinx.reflect.lite
Lightweight library allowing to introspect basic stuff about Kotlin symbols -
Humanizer.jvm
Humanizer.jvm meets all your jvm needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities. -
actions-on-google-kotlin
Unofficial Actions on Google SDK for Kotlin and Java -
klutter
A mix of random small libraries for Kotlin, the smallest reside here until big enough for their own repository. -
solr-undertow
Solr / SolrCloud running in high performance server - tiny, fast startup, simple to configure, easy deployment without an application server. -
kassava
This library provides some useful kotlin extension functions for implementing toString(), hashCode() and equals() without all of the boilerplate. -
SimpleDNN
SimpleDNN is a machine learning lightweight open-source library written in Kotlin designed to support relevant neural network architectures in natural language processing tasks -
units-of-measure
Type-safe dimensional analysis and unit conversion in Kotlin. -
kotlin-futures
A collections of extension functions to make the JVM Future, CompletableFuture, ListenableFuture API more functional and Kotlin like. -
TLSLibrary
Simple TlsLibrary written in Kotlin - Provides DSL for creating TLS connections -
scientist
A kotlin library for refactoring code. Port of GitHub's scientist. -
kasechange
๐ซ๐๐ข๐ ฟ Multiplatform Kotlin library to convert strings between various case formats including Camel Case, Snake Case, Pascal Case and Kebab Case -
kjob
A lightweight coroutine based persistent job/cron scheduler written in Kotlin -
PrimeCalendar
PrimeCalendar provides all of the java.util.Calendar functionalities for Persian, Hijri, and ... dates. It is also possible to convert dates to each other. -
kotlin-pluralizer
:sunny: Kotlin extension to pluralize and singularize strings -
kformula
Mathematical expression engine written in Kotlin, running on JVM. -
kase-format
Multiplatform kotlin string case conversion and detection library.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of stateful4k or a related project?
README
Stateful for Kotlin
State Machine Construction Kit for Kotlin
[Stateful](doc/stateful4k.png)
This is Stateful ported to JVM. I could have re-implemented this in Java but there would be no learning factor in it. So I decided to use Kotlin. ...And, oh man, I'm glad I did.
Requirements
I had some non standard requirements for the state machine:
- Events should be able to carry data - for example, hypothetical event
KeyPressed
should also carry information which key has been actually pressed; - States should be able hold data - for example, state collecting key presses (let's call it
EnteringText
) should be able to hold a list of keys pressed so far; - Guard statements should have access to both current state and event - for example,
KeyPressed
event may cause transition to different state depending which key has been pressed;
Dot Driven Development
One of the design decisions is "Dot Driven Development". The only class which you need to know upfront is StateMachine
, everything else can be discovered by pressing a dot (and relying on IntelliSense tab completion, whatever you call it).
Configurator and Executor
Rules of state machine are configured by object called Configurator
but executed with object called Executor
. Single Configurator
can be used to create multiple Executors
. For example, there is shared set of rules how your communication should work (single Configurator
) but you can have multiple ports open talking to different servers (many Executors
).
Context, State and Event
There are three types you need to provide to Configurator
- Context
, State
and Event
. While State
and Event
are quite obvious, Context
might need few words of explanation. Context
is the data shared by all states. As it is not necessary (this shared data could be passed from one state to another) it helps reduce state bloat. Using previous example, you could store remote server address in Context
. If you think you don't need it (or your religion prevents you from using shared mutable data) just use Any?
(or Nothing
) and pass null
to Executor
.
- Context - type of shared data
- State - base class for all states
- Event - base class for all events
For conciseness I used C
, S
and E
and template (generic?) parameter names for Context
, State
and Event
respectively.
Examples
See basic example [here](doc/basic-example.md) and advanced example [here](doc/advanced-example.md).
Java interoperability
As all Kotlin libs it should just work, but I never tried. Plese do try and let me know.