Home /Modules/impl/README.md

README.md

impl/langin/README.md · 75 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">

impl/langin — JVM language family as SLeeLa input

langin makes SLeeLa accept the JVM "brother languages" as modern compiled input types. They all compile to JVM bytecode and share one runtime, so SLeeLa ingests them as one family and reconstructs a runnable sleela::Program from each — the same way impl/xclass ingests SecureJDK 28 .xclass files.

LanguageExtensionsRole in the family
Java.javathe foundation of the ecosystem
Kotlin.kt, .ktspragmatic, null-safe, 100% Java-interop
Scala.scala, .scobject-oriented + advanced functional
Groovy.groovy, .gvyflexible/dynamic; drives Gradle
Clojure.clj, .cljs, .cljca Lisp dialect; data-as-code

What it does

It is a structural transpile (skeleton only), native and dependency-free — no javac/kotlinc/scalac/groovyc/Clojure runtime required. It recovers the package/namespace, the class/interface/object/trait/namespace name, fields, and method signatures, maps their types onto SLeeLa's surface types, and can emit .sleela source and/or an .xclass descriptor. Method bodies are synthesized skeletons (a default return) — structure and type contracts are preserved, not executable logic. See LANGIN.model (LNG-0001) for the normative mapping.

Usage

# Reconstruct + run (default). Also works via `sleela run <file>` or `sleela <file>`.
sleela langin --run       impl/langin/samples/Greeter.kt

# Emit the reconstructed Sleela source
sleela langin --emit-sleela impl/langin/samples/Greeter.kt

# Emit an .xclass structural descriptor (compiler="langin")
sleela langin --emit-xclass impl/langin/samples/Greeter.java

# One-line summary per ingested unit
sleela langin --info      impl/langin/samples/*.scala

The SHA-256 execution gate (SLEELA_SHA256_MANIFEST) applies as on every other run path.

Samples

samples/ carries one Greeter per language (Greeter.java, Greeter.kt, Greeter.scala, Greeter.groovy, greeter.clj), each with a couple of fields and methods, for exercising the four modes above.

Build

Built by ../Makefile into the sleela binary on all three OSes (the Makefile auto-detects Linux/macOS/Windows and adjusts link flags); langin adds no new dependency.

Honesty about coverage

langin reports only what it can structurally recover from the source text; it is deliberately skeleton-only and omits (rather than guesses) anything it cannot recognize. Groovy fields declared without a modifier are an example of a recognized-methods / partially-recognized-fields case — the method surface is reconstructed regardless.