October 30, 2007
Sexprs in Leopard

Depression-era farm girl in Nebraska

Bill St. Clair noticed that Mac OS X Leopard's new “sandbox” facility uses Lisp syntax (supposedly it's actually TinyScheme).

/usr/share/sandbox/bsd.sb:

;;
;; common rules for various BSD daemons
;; Copyright (c) 2007 Apple Inc.  All Rights reserved.
;;
;; WARNING: The sandbox rules in this file currently constitute
;; Apple System Private Interface and are subject to change at any time and
;; without notice. The contents of this file are also auto-generated and not
;; user editable; it may be overwritten at any time.
;;
(version 1)

(debug deny)

(define (bsd.traverse-symlinks)
  (allow file-read-metadata))

(define (bsd.dylibs-and-frameworks)
  (allow file-read-data file-write-data
    (regex
      ; Allow files accessed by system dylibs and frameworks
      #"^/dev/null$"
      #"^(/private)?/var/run/syslog$"
      #"^/dev/u?random$"
      #"^/dev/dtracehelper$"
      #"/\.CFUserTextEncoding$"
      #"^(/private)?/etc/localtime$"
      #"^/usr/share/nls/"
      #"^/usr/share/zoneinfo/"))

  (allow file-read-data file-read-metadata
    (regex
      ; Allow reading system dylibs and frameworks
      #"^/usr/lib/.*\.dylib$"
      #"^/System/"))

  (allow ipc-posix-shm) ; Libnotify
)

(bsd.traverse-symlinks)
(bsd.dylibs-and-frameworks)

Update: My pal est of e7 fame has some code in TinyScheme (code he wrote in 1988) and so is now an official part of Mac OS X.

Posted by jjwiseman at October 30, 2007 08:22 AM
Comments

cool! much better than XML for sure! :)

Posted by: namekuseijin on October 31, 2007 09:00 AM

Does this mean Apple fan boys will give LISP a try and stop complaining about parentheses as syntax? God, I hope so.

Posted by: Andrew on December 12, 2007 08:19 AM

Uhm. Most Mac fanboys are big Lisp fans. Myself included. As to parentheses, here's a clue: Lisp begat Smalltalk begat Obj-C. Which has a syntax you might feel somewhat comfy in.

Posted by: feijai on December 12, 2007 08:26 AM

For Mac OS X, there's also the Nu programming language, which is basically Obj-C with Lisp-like syntax, and some Lisp-like functionality. http://programming.nu/

Posted by: Denis Defreyne on December 12, 2007 10:00 AM

man, I just love the Lisp syntax. Looks so clean.

Posted by: on December 12, 2007 07:13 PM

@feijai: I'm a fan of Lisp too, but I must disagree with your "most Mac fanboys are big Lisp fans." Of my programmer friends that are Mac fanboys, not a single one uses Lisp, likes Lisp or thinks s-expressions are "pretty," or even a sane way to write code. So, you can school me with your language relationships all you want, but please don't insult me. Most importantly wake up, most Mac fanboys these days are using Ruby or Python because they heard they were almost a Lisp, and read that Lisp was powerful on reddit.

Posted by: Andrew on December 12, 2007 09:52 PM

feijai, lisp did no begat smalltalk, smalltalk is a seperate language branch all together. it's unfortunate that popular OO languages don't match smalltalk's living objects paradigm (except ruby does to a large degree, perhaps python too but i don't know enough about python to speak on it). alan kay says that when he thinks of OO he doesn't think of C++ or Java.
andrew, i have a mac, and I use lisp, specifically i use scheme, which is a lisp-1. i can see where "mac fanboys" is an over generalization, certainly "mac fanboys" are probably not programmers. as far as syntax and "prettyness", if you're hung up on it you're missing the point to a large degree. part of lisp's attractiveness is it's utter lack of syntax. it's essentially an open language canvas where you can build your own languages, syntax like parens is simply there to denote tokenization to the lexer and really has very little impact on how code is written like it does in other languages like Java, C++, Ruby or Python where syntactic sugar is very important to those languages, it's not important in lisp.

Posted by: gml on December 13, 2007 09:49 AM

@gml: Maybe you misunderstood my statement, "I'm a fan of Lisp," and the rest of my comment as, "I don't like the syntax, but admire the language," however, I DO love the syntax, understand it's benefits and completely wish other people would realize this and use it without complaining.

Posted by: Andrew on December 13, 2007 11:45 AM

andew, oh yeah i clearly missed that. i wish others people would realize it too.

Posted by: gml on December 13, 2007 03:46 PM
Post a comment
Name:


Email Address:


URL:




Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)

Comments:


Remember info?