An example project for configuring Rust with Java 18's Panama/jextract

Overview

rust-panama

A template project for setting up both Rust and the Java 18 Panama Foreign Linker API (via jextract).

How to Setup

  • Clone the repo.
  • Modify the values in gradle.properties to your liking.
  • You're done!

Why Rust?

Rust has limited support in the Java ecosystem, and as such, deserves to have some attention (especially since it's a very nice and fast language). Due to the difficulty of interfacing with a native application like Cargo, the template uses a Gradle plugin called gradle-cargo-wrapper that runs Cargo via Gradle's Exec task type.

Read more about Rust:

What's Panama?

Project Panama (shortened to just Panama) is an upcoming collection of Java features designed to enhance performance safely.
Currently, Panama includes 3 major APIs:

These all work with low-level concepts, like memory, and are very efficient.
The main API we are looking at for this template is the Foreign Linker, as it allows for a high-speed alternative to JNI (Java Native Interface), which is what allows us to interface with functions in native languages, like C or Rust.

The Foreign Linker is quite complicated by itself, but thankfully a tool was created to automatically generate the required bindings for a C header file. This tool is called jextract and is used by this template.

Special Thanks

You might also like...
A Modern Kotlin-Ktor RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations.
A Modern Kotlin-Ktor RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations.

kotlin-ktor-rest-api A Modern Kotlin-Ktor RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations. F

FunFacts is an example of Modular architecture
FunFacts is an example of Modular architecture

FunFacts FunFacts is an example of Modular architecture This Project is built using Kotlin,we will use in this App : Modular architecture Dependency I

📌This repo contains the kotlin implementation of TensorflowLite Example Android Apps🚀
📌This repo contains the kotlin implementation of TensorflowLite Example Android Apps🚀

TensorflowLite Examples Kotlin This repo contains the kotlin implementation of TensorflowLite Example Apps here, which are mostly implemented in java

Spring for Kotlin Example
Spring for Kotlin Example

Spring for Kotlin Example This project is for studying the spring using by kotlin. Required docker-compose Running project docker-compose -f docker-co

grpc stream fullstack example(spring+kotlin / next.js + typescript)

grpc-stream-fullstack chat application build with grpc named qhat Prerequisites server sync .proto files on src/main/proto/grpc/qhat/ $ ./gradlew sync

R2DBC Sharding Example with Kotlin Coroutine

R2DBC Sharding Example with Kotlin Coroutine A minimal sharding example with R2DBC and coroutine, where user table is divided into 2 different shards.

An example of a SQS consumer using Micronaut

Micronaut 3.0.3 Documentation User Guide API Reference Configuration Reference Micronaut Guides Feature http-client documentation Micronaut HTTP Clien

MVP Android Example

androidmvp MVP Android Example used to explain how to use this pattern in our Android apps. This code was created to support an article explanation: A

Spring boot kotlin example

Spring Boot Kotlin Example Gradle 配置 代理配置 当内网环境需要代理时,在项目根目录添加文件 gradle.propertie

Owner
Aidan
Java/Kotlin/Rust programmer, makes weird and/or fun open-source projects.
Aidan
Example of Android project showing integration with Kotlin and Dagger 2

kotlin-dagger-example This project demonstrate how to setup an Android Project with Kotlin and Dagger 2. It's based on Dagger 2 example ##Known issues

Damian Petla 533 Nov 11, 2022
Example project for using the Selenium toolkit with Kotlin, Maven, TestNg and the config is managed via a property file.

Selenium-Java-Toolkit-TestNg-Playground This is the sample-Project and show you how to use the Selenium-Toolkit. The Selenium-Toolkit is a Java based

Selenium Consulting 0 Dec 15, 2021
Android Example project

Example project for the employers. I created this project for the employers because I often get demands about showing some of my code. Patterns: MVP C

null 0 Nov 21, 2021
This project uses Quarkus, the Supersonic Subatomic Java Framework.

foodhouse Project This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its websit

null 0 Nov 29, 2021
This project uses Quarkus, the Supersonic Subatomic Java Framework

api Project This project uses Quarkus, the Supersonic Subatomic Java Framework.

Leonardo Cavazzola 0 Feb 26, 2022
A sample project to debunk common misbeliefs regarding the impact the Log4j vulnerabilities on Java Applications

Introduction This project intends to debunk two common misbeliefs regarding the

Eliezio Oliveira 3 Jun 8, 2022
🎓 Learning Kotlin Coroutines for Android by example. 🚀 Sample implementations for real-world Android use cases. 🛠 Unit tests included!

Kotlin Coroutines - Use Cases on Android ?? Learning Kotlin Coroutines for Android by example. ?? Sample implementations for real-world Android use ca

Lukas Lechner 2.1k Jan 3, 2023
A clean architecture example. Using Kotlin Flow, Retrofit and Dagger Hilt, etc.

android-clean-architecture A clean architecture example. Using Kotlin Flow, Retrofit and Dagger Hilt, etc. Intro Architecture means the overall design

Prieyudha Akadita S. 69 Dec 21, 2022
Spring Boot Example with Kotlin and Domain Driven Design

Spring Boot Kotlin Domain Driven Design Example Just an example project where ddd is implemented with some other great patterns and architecture from

Fernando Guevara Sanchez 16 Jun 29, 2022
This is an example of a simple application with layered software base on clean-architecture as application architecture and mvvm as presentation architecture

This is an example of a simple application with layered software base on clean-architecture as application architecture and mvvm as presentation archi

null 3 Jul 2, 2021