You could also write a meta-interpreter in CL for the limited subset defined in the original paper in about 5 minutes and just have people use the interpreter. From there, sure, everybody could recreate CLOS if they really wanted to, but it would take them a while.
BTW, why the requirement for things to be so secure? If it's just a contest for fun, can you not rely on people to adhere to the rules without having to jump through hoops to prevent cheating? Or maybe I'm misunderstanding the point of the exercise. I mean, if there's $1M hanging on this, or something, then yea, I suppose you need to take steps to prevent cheating. If it's only for your own personal self-worth, you'd have to have pretty low self-worth to cheat your way toward self-worth.
Archaic Code Contest in Common Lisp
-
- Posts: 447
- Joined: Sat Jun 28, 2008 7:49 am
- Location: Austin, TX
- Contact:
Re: Archaic Code Contest in Common Lisp
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
-
- Posts: 61
- Joined: Mon Jul 07, 2008 8:06 pm
- Location: Toowoomba, Queensland, Australia
- Contact:
Re: Archaic Code Contest in Common Lisp
As an idea for a secure interpreter, how about create a checking program/function/macro that checks to see if the submitted code contains any 'non-secure' function/macro calls? That might be easier than trying to saw off big chunks of lisp.
-
- Posts: 406
- Joined: Sat Mar 07, 2009 6:17 pm
- Location: Brazil
- Contact:
Re: Archaic Code Contest in Common Lisp
Not as simple, you will need to implement a code walker, or use Arnesi's. Well, ok, using Arnesi's code walker seems quite easy. But I believe it is much easier to create a package and only put allowed functions in the package.Kohath wrote:As an idea for a secure interpreter, how about create a checking program/function/macro that checks to see if the submitted code contains any 'non-secure' function/macro calls? That might be easier than trying to saw off big chunks of lisp.
Re: Archaic Code Contest in Common Lisp
How about that?Kohath wrote:As an idea for a secure interpreter, how about create a checking program/function/macro that checks to see if the submitted code contains any 'non-secure' function/macro calls? That might be easier than trying to saw off big chunks of lisp.
Code: Select all
(let ((x "SOME-UNAUTHORIZED-FUNCTION"))
(funcall (symbol-function (find-symbol x))))
-
- Posts: 406
- Joined: Sat Mar 07, 2009 6:17 pm
- Location: Brazil
- Contact:
Re: Archaic Code Contest in Common Lisp
You are assuming that symbol-function and find-symbol are gonna be allowed by the checking program.dmitry_vk wrote:How about that?Kohath wrote:As an idea for a secure interpreter, how about create a checking program/function/macro that checks to see if the submitted code contains any 'non-secure' function/macro calls? That might be easier than trying to saw off big chunks of lisp.Code: Select all
(let ((x "SOME-UNAUTHORIZED-FUNCTION")) (funcall (symbol-function (find-symbol x))))
Anyway, using packages, it is easy: only change the package to safe package before loading a file:
Code: Select all
(defpackage :safe-package-functions
(:use :whatever :cl)
(:export #:1+ #:1- #:zerop #:defun #:cons #:car #:cdr))
(defpackage :safe-package
(:use :safe-package-functions))