~technomancy/fennel.clj

An example of how to call Fennel from Clojure
Actually test getting a value back from the Fennel code.
Initial commit.

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~technomancy/fennel.clj
read/write
git@git.sr.ht:~technomancy/fennel.clj

You can also use your local clone with git send-email.

#fennel.clj

A barebones example of how to load Fennel code from Clojure using Cobalt. Note that Cobalt is not a general-purpose Lua implementation; it's a purpose-built fork of LuaJ (which is itself abandonware with many serious bugs) but is designed specifically for use from within Minecraft. As such it lacks basic I/O functionality, and for some reason, a package system as well.

To fix the latter, we've included a userspace shim in resources/package.lua

See main.clj as an example. Actually doing something from the Fennel code will require using the Cobalt APIs to expose functionality from Clojure/Java which is left as an exercise for the reader.

#License

Copyright © 2024 Phil Hagelberg

This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://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.