Pyli/TODO

From Jonathan Gardner's Tech Wiki
Jump to: navigation, search

Debugger

Really, really need to get debugging working.

  1. Breakpoints, step through operations or function calls
  2. Nice tracebacks, if at all possible.
  3. Line numbers associated with each expression (for long files.)
  4. Breakpoints

Speed

Pyli is getting very slow. Need to start looking at optimizing it.

Confusing Code Base

Need to start cleaning up the code base, making sense out of stuff, filling in missing unit tests.

for needs `(...)

For is extremely complicated. It is a good case of using `(... ,...) style syntax. I need something like that now. Probably something besides & to substitution quoting, and reusing $, @ to do eval and inline...

compile

I am going to have to move, one day, to a register-based machine. (Can I piggy-back on Python?) I am going to need to compile stuff to that machine.

dynamic label, restart, return

The labels may need to live in the dynamic space. It doesn't make much sense in the lexical one. How to do this? After all, we might pass labels around as part of parameters to functions, so they may end up in the lexical space.

So far, I've gotten away with this because of *calling-env* and/or I've passed the label into the function. I get in trouble when I pass the name of the label around, not the label itself.

Explanation in Python

What does this mean?

Well, a lexical label would make code like this work the way you might expect it:

for i in range(10):
  def f(): break
  f()

A dynamic label would make code like this work the way you expect it:

def f(): break
for i in range(10:
  f()


Option A: Explicit, default lexical

Lexical naming: (Runs the risk of restarting the program to a point before a function was defined)

(label &foo
  ...
  (return foo))

Dynamic naming: (Wordy, the most common case by far.)

(label &(dynamic &foo)
  ...
  (return (dynamic &foo))

Option B: Explicit, default dynamic

Or we can default to dynamic, and allow (lexical &foo) to override that.

Option C: Lexically pass in to be dynamic

If you want a function that will do a break or continue in a loop, then you should pass it in.

Option D: Neither lexical nor dynamic

Labels can't be passed to functions.

Objects

Rework the OO system so that it is uniform.