Hacker News new | past | comments | ask | show | jobs | submit login

Started yesterday: Lark, a toy Arc-like language implemented on top of Python instead of Scheme. (http://www.github.com/swolchok/lark) I've never implemented a Lisp or used it for anything serious, and I've been trying to figure out for myself whether there really is anything to macros or if they're just fancy compiler hacks, so I decided to write Lark as a way of learning what precisely pg is so excited about. It's a direct, lazy translation of ac.scm, except that I've written an evaluator instead of compiling to Python ASTs or bytecode. I'll probably compile to Python ASTs after I have a baseline.

I did cheat a bit and steal pieces from PyScheme and Lython as well as someone else's S-expression parser, but it's capable of evaling ((fn (a) a) 1) as well as Arc's "if" currently. I'm not certain whether it's Turing complete right now, but I suspect that it is because I can create and call functions, branch, and bind values to names. (IIRC, just being able to create and call lambdas is enough because you can count, branch, etc. Is that right? I haven't taken PL.)

Big problems right now are:

1) Proper lexical scoping. The current model is broken (it might be dynamic scoping), and Python 2.x's closures are broken so I can't just use Python functions to punt the problem to Python.

2) The shortcuts for quote, quasiquote, complement, compose, etc. The S-expression parser I stole doesn't have them. I don't want to use a parser generator because that seems to defeat the point of Lisp's lack of syntax (i.e., being easy to parse).

This is a toy that has nothing to do with my research interests (security), so it's not going to be actively maintained or developed. pg will probably make some breaking changes to Arc and kill the project.




just being able to create and call lambdas is enough because you can count, branch, etc. Is that right?

♫ All you need is Lambdas ♫ :)


what about http://www.picolisp.org ?

fuck compilation.

fuck lexical scoping.

do something for real in lisp, like

* entity relationships over a graph db

* webframework

* flightsimulator




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: