An open API service indexing awesome lists of open source software.

https://github.com/macielti/echo-graalvm

A simple Telegram echo bot to experiment with GraalVM native-image and Clojure
https://github.com/macielti/echo-graalvm

clojure graalvm telegram-bot

Last synced: 3 months ago
JSON representation

A simple Telegram echo bot to experiment with GraalVM native-image and Clojure

Awesome Lists containing this project

README

        

![Compatible with GraalVM](https://img.shields.io/badge/compatible_with-GraalVM-green)

# Echo GraalVM

A simple Telegram bot that echoes messages back to the user.
The objective is to experiment with GraalVM while generating native-images from a Clojure application.

**Echoes only text messages**

## Usage

Local deployment:

1. Clone the repository
2. Rename the file `resources/config.edn.example` to `resources/config.edn`.
3. Fill the `resources/config.edn` file with your Telegram bot token.
4. Run the docker container: `docker compose up -d`

## Experiment Results

A simple Clojure application (a Telegram echo bot) deployed to a Docker container consuming less than 10 MiB of RAM.

To ensure a fairer comparison, I implemented 3 versions of Docker images:

- **echo-graalvm-distroless**: The version that uses `gcr.io/distroless/base:latest` as the base image.
- **echo-jvm**: The JVM-based version using `amazoncorretto:23` as the base image.
- **echo-graalvm**: The GraalVM-based version, also using `amazoncorretto:23` as the base image.

`docker stats` output:

![Docker Stats](doc/docker-stats.png)

## License

Copyright © 2025 Bruno do Nascimento Maciel

This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.

This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License, v. 2.0 are satisfied: GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or (at your
option) any later version, with the GNU Classpath Exception which is available
at https://www.gnu.org/software/classpath/license.html.