Python syntax in Lisp and Scheme

Daniel P. M. Silva dsilva at ccs.neu.edu
Sat Oct 11 20:34:25 EDT 2003


Andrew Dalke wrote:
>> Furthermore, it has been suggested more than once that a valid
>> working model is that a good Lisp programmer can provide a
>> domain-specific language for the non-professional programmer. It's very
>> likely that a DSL matches better the needs of the user than some
>> restricted general-purpose language.
> 
> Another *shrug*  And a good C programmer can provide a
> domain-specific language for the non-professional programmer.
> 

The last thing we need in this world is more non-professional programmers 
writing C programs to make software even more unstable.  The ATM near where
I work crashes enough as it is.

You can restrict a DSL in lisp/scheme to the point of not allowing it to
call eval, for example.  Can you restrict a C programmer's ability to
dereference NULL?  Can you hide 'exec' from the Python newbie?

> Any good Python programmer could make an implementation
> of a Lisp (slow, and not all of GC Lisp, but a Lisp) in Python, like
> 
> import lisp
> def spam(distance):
>     """(time_to_fall 9.8 distance)"""
> spam = lisp.convert(spam)
> 
> def time_to_fall(g, distance):
>   print "The spam takes", (2.0*distance/g)**(0.5), "seconds to fall"
> 
> print spam(10)
>

Please let me know if you hear of anyone implementing lisp/scheme in
Python :)
 
>> If it's only a syntactical issue, then it's a safe bet that you can add
>> that to the language. Syntax is boring.
> 
> Umm... Sure.  C++ can be expressed as a parse tree, and that
> parse tree converted to an s-exp, which can be claimed to be
> a Lisp; perhaps with the right set of macros.
> 
> Still doesn't answer my question on how nicely Lisp handles
> the 'unexpected' need of allocating objects from different
> memory arenas.

Just like Python does: native modules.

- DS




More information about the Python-list mailing list