Python Lambda Experiment (2017 – 2018)
  • Python 59.4%
  • Common Lisp 40.2%
  • Makefile 0.4%
Find a file
2020-09-13 16:45:59 +02:00
_morgue eliminated the name of you-know-what from the morgue 2018-09-15 10:23:10 +02:00
.gitignore ignore __pycache__ 2019-03-22 17:42:22 +01:00
basedefs.l current state of broken things 2017-10-12 11:12:12 +02:00
builtin.py builtins: replace regular expressions with simpler operations 2020-09-13 16:38:50 +02:00
data.l read from string (and a read builtin at all) 2017-10-03 18:28:27 +02:00
dbg.py got rid of more regexps 2020-09-13 16:45:59 +02:00
dep.py fixed errset in multiple ways; function error-message 2017-10-07 13:49:30 +02:00
eval.py got rid of more regexps 2020-09-13 16:45:59 +02:00
exceptions.py print file name with syntax error 2017-10-02 14:05:31 +02:00
info.py don't pretend to implement a particular programming language 2017-09-19 15:25:24 +02:00
LICENSE LICENSE and README update 2018-09-09 17:25:22 +02:00
macro.py removed a meaningless (ah!) blank line 2017-10-14 13:36:43 +02:00
Makefile Makefile: it's ./pyle.py, not just ./pyle 2020-09-13 16:38:01 +02:00
object.py object: no need for regular expressions when there is no need 2020-09-13 16:39:35 +02:00
pyle.py switched to jpylib 2020-08-03 07:08:38 +02:00
reader.py got rid of more regexps 2020-09-13 16:45:59 +02:00
README.md README fix 2018-09-26 08:26:09 +02:00
some.l explain a slightly confusing form 2018-07-19 11:28:06 +02:00
stdsyms.py several changes at once and overlapping in part 2017-10-01 19:32:36 +02:00
tests.l be clearer about an okay test result 2018-09-15 12:21:34 +02:00
TODO.md replaced symbol-function builtin by a high-level function 2017-10-07 13:17:04 +02:00
utils.py text2bool: can make this more consistent and without REs 2020-09-13 16:40:12 +02:00

Python Lambda Experiment

This is "pyle", an interpreter for s-expressions and lambda functions written in Python.

Copyright (C) 2017, 2018 Juergen Nickelsen ni@w21.org. See LICENSE for the conditions under which this code is licensed to you.

Pyle is meant to be a rather (although not strictly) minimal interpreter, with few features in the builtin core. More functionality shall, if possible, be implemented in the language itself. In order to do that, it has macros.

The supported data types are symbols, strings, numbers, pairs, and errors. Variable numbers of arguments to functions are implemented using improper argument lists like in Scheme. This, together with the traditional defun syntax, means, consequently, that a function of zero or more arguments will not have a parameter list, but rather a parameter symbol, like this:

  (defun adder args
    (apply '+ args))

I admit this is more elegant in Scheme with (define (adder . args) ...)

Update 2018-09: Like similar interpreters before, I wrote Pyle to learn more about its implementation language. I started it short after starting to learn Python at all, and working on Pyle helped me with that.

In between, as I have gained more experience with Python in other projects, I would certainly do quite a few things in Pyle differently now, e.g. register the builtin functions using a decorator, and make the Object hierarchy somewhat less messy. I don't know if I'll ever get around to doing that, but there are certainly quite a few places where I could do things more elegant and more pythonic.