ausimian

ausimian

Schooner - An embeddable r7rs scheme

Schooner is a sandboxed Scheme interpreter you embed in an Elixir app (like Lua/Luerl but with more parentheses). It targets r7rs-small minus its mutable operations — no set!, set-car!, vector-set!, etc. — which keeps the value model immutable and friendly to BEAM idioms. The host hands a script source to Schooner.eval/2, gets back a tagged Elixir term, and resource-bounds the work with the standard process tools (:max_heap_size, Task.shutdown/2).

alias Schooner.Host

env =
  Schooner.Environment.new(
    libraries: [
      Host.library(
        primitives: [
          {"shout", 1, fn [msg] ->
             text = msg |> Host.to_string!(op: "shout") |> String.upcase()
             Host.string(text <> "!")
           end}
        ]
      )
    ]
  )

Schooner.eval(~s|(import (scheme base)) (shout (string-append "hello, " "world"))|, env)
# => {:ok, "HELLO, WORLD!"}

It implements most of r7rs-small, the deviations are listed in the documentation.

https://github.com/ausimian/schooner

Most Liked

kip

kip

ex_cldr Core Team

As someone who grew up with Maclisp and John McCarthy I find this unreasonably exciting. And much more of a mental model that works for me than Lua. Thanks for making this happen - I’ll be sure to give it a spin on something. In fact I’ll just have to invent something so I can use it :slight_smile:

I still think the Moonual is one of the best technical manuals ever written. It was my reference during many late night session on the System-M Multics system. Multics, Maclisp and Emacs were probably why I got hooked on computing.

Where Next?

Popular in Announcing Top

ityonemo
Currently just starting out on a new mini-project - getting zig NIFs to run in elixir. https://github.com/ityonemo/zigler The idea here...
New
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
mikehostetler
I’m excited to announce Jido, a framework providing foundational primitives for building autonomous agent systems in Elixir. While develo...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
alisinabh
Hey everyone i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice vers...
New
Crowdhailer
Raxx is an alternative to Plug and is inspired by projects such as Rack(Ruby) and Ring(Clojure). 1.0-rc.1 is now available. To use it re...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New

Other popular topics Top

Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52341 488
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement