Home /Modules/inputs/README.md

README.md

inputs/README.md · 102 line(s) · markdown

<img align="right" src="https://github.com/mearvk/SLeeLa/blob/master/images/debian/debian-logo.png" width="75" height="75" alt="SLeeLa">

<img src="https://github.com/mearvk/SLeeLa/blob/master/images/sleela/sleela-logo-004.jpg" alt="SLeeLa">

inputs/ — server programs in Sleela, Java, and C

This directory holds small server programs written in each of the three Sleela toolchain targets — Sleela (.sleela), Java (.java), and C (.c) — one triplet per protocol:

ProtocolSleelaJavaC
HTTPhttp/HttpServer.sleelahttp/HttpServer.javahttp/http_server.c
FTPftp/FtpServer.sleelaftp/FtpServer.javaftp/ftp_server.c
SSHssh/SshServer.sleelassh/SshServer.javassh/ssh_server.c

They are intended as toolchain inputs — Sleela source files are Wrapper™ program units, and the Java/C files show what the corresponding transpiler target would look like for the same protocol logic.

What they model (and what they don't)

Each triplet implements the same protocol shape so the three files line up line-for-line in behavior:

Scope note. These are protocol-shaped models/demos, not production network daemons:

Building and running

Sleela (.sleela)

Build the Sleela toolchain once, then run each Wrapper™:

cd ../impl && make
./build/sleela run ../inputs/http/HttpServer.sleela
./build/sleela run ../inputs/ftp/FtpServer.sleela
./build/sleela run ../inputs/ssh/SshServer.sleela

Java (JDK 17+; verified on JDK 25)

The files declare package inputs.<proto>;, so compile from this directory:

javac http/HttpServer.java ftp/FtpServer.java ssh/SshServer.java -d out
java -cp out inputs.ssh.SshServer                 # prints the handshake
java -cp out inputs.http.HttpServer 8080          # real server; curl -i localhost:8080/health
java -cp out inputs.ftp.FtpServer  2121           # real server; nc localhost 2121

C (C11; POSIX sockets)

cc -std=c11 -O2 -Wall -Wextra ssh/ssh_server.c  -o ssh_server  && ./ssh_server
cc -std=c11 -O2 -Wall -Wextra http/http_server.c -o http_server && ./http_server 8080
cc -std=c11 -O2 -Wall -Wextra ftp/ftp_server.c  -o ftp_server  && ./ftp_server 2121

Verification status

All nine files were compiled and exercised when added:


SLeeLa

<p align="center"><img src="images/sleela/sleela-wordmark.svg" alt="SLeeLa — The Now. The Ingredient." width="560"></p> <p align="center"><img src="https://github.com/mearvk/SLeeLa/blob/master/images/sleela-programming-language-002.jpg" alt="SLeeLa Marketing Logo" width="560"></p>