Anonymous user
Untrusted environment: Difference between revisions
→{{header|Racket}}
Line 50:
print FILE "Modifying an arbitrary file\n";
close FILE;</lang>
=={{header|Racket}}==
The <tt>racket/sandbox</tt> library provides a way to construct limited evaluators which are prohibited from using too much time, memory, read/write/execute files, using the network, etc.
<lang racket>
#lang racket
(require racket/sandbox)
(define e (make-evaluator 'racket))
(e '(...unsafe code...))
</lang>
The idea is that a default sandbox is suitable for running arbitrary code without any of the usual risks. The library can also be used with many different configurations, to lift some of the restriction, which is more fitting in different cases.
=={{header|Ruby}}==
|