Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #63073
| References | <f51999a3-3302-4a7f-bfdb-756983e72fe3@googlegroups.com> |
|---|---|
| From | Devin Jeanpierre <jeanpierreda@gmail.com> |
| Date | 2014-01-03 09:10 -0800 |
| Subject | Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4862.1388769050.18130.python-list@python.org> (permalink) |
On Thu, Jan 2, 2014 at 10:46 PM, Chris Seberino <cseberino@gmail.com> wrote: > I've heard it said, by no less a guru than Peter Norvig, that Python is a lot like Lisp without the parentheses.... at least for the basics of Python. There are plenty of non-superficial differences. Python has lexical scope, lisps usually have dynamic scope. Python has statements and expressions, lisps have expressions and maybe only a few tiny extra restrictions. Python has dynamic dispatch everywhere, lisps have it usually almost nowhere. And the unifying thing that makes a lisp a lisp is macros, which Python lacks. > For pedagogical reasons, I'm wondering if it would be easy to implement a big subset of Python in Scheme. A lecturer of mine back in university did this (implemented a subset of Python in Racket). My understanding is that this is primarily interesting to show that Racket is not as crazily different as it looks from the syntax. When I TA'd for him, he had a really neat lecture where he gave the following three snippets of code: // C++ Foo x = y; x.bar = 3; // Java Foo x = y; x.bar = 3; // Scheme (define x y) (foo-bar x 3) The syntax of the first two is identical, so the uneducated would assume they do the same thing. But actually, the latter two are the ones with the identical behaviour. It is definitely true that the syntax differences hide how similar Scheme and Python are. These two languages are close enough together that any > The basics of Scheme or Lisp are amazingly easy to implement. Would implementing a subset of Python in a Scheme subset be a clever way to easily implement a lot of Python? If it's easy to implement in terms of Scheme, which is itself easy to implement, then it would be easy to implement directly, so this doesn't seem like a useful question to ask. Anyway, most of the useful bits of Python aren't present or have different semantics than how they work in lisps. -- Devin
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? Chris Seberino <cseberino@gmail.com> - 2014-01-02 22:46 -0800
Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? Rustom Mody <rustompmody@gmail.com> - 2014-01-03 15:30 +0530
Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? Chris Seberino <cseberino@gmail.com> - 2014-01-03 08:50 -0800
Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? Rustom Mody <rustompmody@gmail.com> - 2014-01-03 23:03 +0530
Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-01-03 09:10 -0800
Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? Chris Seberino <cseberino@gmail.com> - 2014-01-03 09:26 -0800
Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-01-03 10:32 -0800
Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? Chris Seberino <cseberino@gmail.com> - 2014-01-03 22:48 -0800
Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? Roy Smith <roy@panix.com> - 2014-01-03 12:26 -0500
Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-01-04 07:38 +1100
csiph-web