Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8091279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:00:47+00:00 2026-06-05T20:00:47+00:00

Context: In Lua, it’s trivial and very cheap (4kb of memory) to create a

  • 0

Context:

In Lua, it’s trivial and very cheap (4kb of memory) to create a new Lua VM. Thus, it’s trivial to create cheap lua “jails”. Then, if the untrusted code misbehaves, I just kill the Lua VM.

I’m aware of https://github.com/Licenser/clj-sandbox but it appears to just wrap around Java … which would make untrusted code thread be native Java threads, which I would then be powerless to kill.

Question:

Is there anyway to create cheap / light weight Clojure jails?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:00:49+00:00Added an answer on June 5, 2026 at 8:00 pm

    I’m the (co)author of a little library called clojail that was kind of a rethinking of clj-sandbox. It also makes use of the Java sandbox, but also provides features for sandboxing Clojure-specific things. tryclj and 4clojure make use of it.

    I don’t understand what you mean by the rest of that. The JVM sandbox is great in that it can prevent I/O. Clojail goes the rest of the way by allowing timeouts to prevent long running code. If what you’re saying is that “people could create threads and I wouldn’t be able to kill them”, clojail kills threads created inside of the sandbox and generally does its best to prevent stray threads from running away. The JVM sandbox (and clojail specific stuff) still prevents dangerous code from running on threads as well.

    In summary, check out clojail. It might be what you need. It is sufficient for most purposes, and is the only game in town (save for clj-sandbox which isn’t maintained) for jails. It isn’t always the best solution but it is usually the easiest.

    The next step up if clojail doesn’t do what you need is to roll your own jailing mechanism that involves using the JVM sandbox and spinning off JVMs. This has massive overhead, so I’d avoid it if anyway possible. Definitely not in 4KB Luatown anymore. 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context I have this piece of Java Code btn.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent
Context Sometimes, I like reading code on paper rather than on screen (so I
Context Clojure Agents are NOT sent new values. They are sent a function which
How to register a C function in Lua, but not in a global context,
Context.startService Intent intent = new Intent(context, MyService.class); context.startService(intent); PendingIntent.getService Intent intent = new Intent(context,
Context Suppose I have protocols ICursor, IFoo, IBar then I can have a function
Context: Windows7, VBScript, ADODB and ADOX. I have written some VBScript code which creates
Context PHP 5.3.x Overview After doing a code-review with an associate who uses both
Context: OS: Linux (Ubuntu), language: C (actually Lua, but this should not matter). I
Context: I downloaded a file (Audirvana 0.7.1.zip) from code.google to my Macbook Pro (Mac

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.