Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - dido

#1
newLISP newS / dynamic binding in newLISP
August 11, 2006, 09:59:54 AM
I've been exploring newLISP lately and one of the things I've noticed is that unlike most modern LISP dialects such as Scheme and ANSI Common LISP, newLISP uses dynamic binding to obtain the values of free variables. The following code:



(let ((x 1))
  (let ((f (lambda (y)
   (+ x y)))
(g (lambda (f y)
    (let ((x 3))
      (f y)))))
    (g f 2)))


which is also valid Scheme, evaluates to 5 in newLISP, indicating that f gets its value for the free variable x from the binding in g, rather than from the outermost binding in its definition, which is 1. In Scheme (Guile and mzscheme), the same code evaluates to 3, indicating that when f is evaluated inside of g the previous binding of x to 1 is used (static binding). The trend in functional languages these days is going towards static binding, because referential transparency is considered a valuable property, and languages that do dynamic binding make referential transparency all but impossible (e.g. the function f in my example would evaluate to different values in a context that had a different binding for the free variable x). I would be of a mind to question the wisdom of this behavior, seeing as every new functional language since the mid-1980's has made use of static binding. I suppose it must be easier to implement, as Richard Stallman has often said (of Emacs LISP, which also uses it), but are there other more pressing reasons for this design decision?
#2
I just ran into newLISP today while looking for new Lisp dialects (seeing as Common Lisp and Scheme in many ways make most of my workaday tasks more difficult than they should be, although they are also neat), and so far it seems that this has got a lot of potential. The distributed programming facility based on net-eval seems incredibly interesting, comparable to Ruby's DRb in power and perhaps even more flexible, but what has me worried is that newLISP doesn't seem to have any support whatsoever for SSL or any other type of encryption/authentication mechanism. This is an absolute necessity for any kind of distributed system that is to operate over a wide-area network. Running a newLISP server over a public network is, if I'm understanding things correctly, basically opening a hole that allows anyone with a telnet client to execute arbitrary code on your system. Kinda scary, to say the least. I hope there is some work to including OpenSSL or gnutls support into newLISP so that this major security flaw can be addressed. Also, would there be a way to restrict what can be evaluated by net-eval?



By the way, is there a mailing list for newLISP discussion? Call me old-fashioned but I'm more used to having a mailing list for these kinds of discussions.