Strukt alternatives and similar libraries
Based on the "Misc" category.
Alternatively, view Strukt alternatives based on common mentions on social networks and blogs.
-
jclasslib
jclasslib bytecode viewer is a tool that visualizes all aspects of compiled Java class files and the contained bytecode. -
kotlin-logging
Lightweight logging framework for Kotlin. Used as a wrapper for slf4j with Kotlin extensions. -
klock
Consistent and portable date and time utilities for multiplatform kotlin (JVM, JS and Common). -
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
Port of official Node.js SDK to Kotlin. Complete with all features and tests and nearly identical API. -
klutter
A mix of random small libraries for Kotlin, the smallest reside here until big enough for their own repository. -
SimpleDNN
SimpleDNN is a machine learning lightweight open-source library part of KotlinNLP and has been designed to support relevant neural network architectures in natural language processing tasks. -
kassava
This library provides some useful kotlin extension functions for implementing toString() and equals() without all of the boilerplate. -
kotlin-futures
A collections of extension functions to make the JVM Future, CompletableFuture, ListenableFuture API more functional and Kotlin like. -
kasechange
Multiplatform Kotlin library to convert strings between various case formats including Camel Case, Snake Case, Pascal Case and Kebab Case -
PrimeCalendar
Provides all of the java.util.Calendar functionalities for Civil, Persian, Hijri, Japanese, etc, as well as their conversion to each other.
Get performance insights in less than 4 minutes
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of Strukt or a related project?
README
Strukt
C-style structs on the JVM!
ZERO garbage, ZERO reflection, ZERO maps. EASY to use, and with INCREDIBLE performance.
WARNING: This library is more of a proof-of-concept, and is extremely experimental and untested. DO NOT USE IN PRODUCTION!
New! Now fully supported across all JVM languages!
Gradle
compile group: 'org.jire.strukt', name: 'strukt', version: '1.2.0'
Maven
<dependency>
<groupId>org.jire.strukt</groupId>
<artifactId>strukt</artifactId>
<version>1.2.0</version>
</dependency>
Declaring a Strukt
The declaration syntax is very similar to regular classes, except:
- You should declare as an
object
, rather thanclass
- Members should be delegated by a subclass of
StruktMember
- You must extend
Strukt
For example, a Strukt for representing a coordinate might look like:
object Point : Strukt() {
var x by 0
var y by 0
}
There are member delegates built in for all primitives besides char.
You can also specify a default value for your member, like so:
var x by 3 // 3 is the default value
var y by 5 // 5 is the default value, shown with named arguments
Allocating a reference
The syntax for allocation is a bit different than regular object construction. Instead, you use the invoke operator to set values.
For the above Point example, this might look like:
val example = Point { x = 3; y = 5 }
If you wanted to make use of default arguments, you can omit the sets.
val example = Point {}
Allocating a reference automatically sets the reference pointer. (More on this in the following section.)
Accessing members
Accessing members is the farthest deviation from regular object syntax.
It is important to understand under the hood, Strukt uses something called a reference pointer to keep track of what reference is currently being worked on.
Switching to a reference pointer is done through the get operator on the Strukt's type.
This might look like this:
Point[example]
In full effect, the Point example might be used like this:
Point[example].y = 20
println("x: ${Point[example].x}, y: ${Point[example].y}") // prints "x: 3, y: 20"
Since the switch (get) operator switches the reference pointer, you can write a shorthand version by referring to the type (Point in our example) directly.
This might look like:
Point[example].x = 123 // `Point[example]` sets the reference pointer...
println("x: ${Point.x}, y: ${Point.y}") // so `Point.x` and `Point.y` can be referred to directly
*Note that all licence references and agreements mentioned in the Strukt README section above
are relevant to that project's source code only.