
@greg thanks for the explanation. Makes sense although I would love to have a debugger that I can use to step through code. I will take a look at debug
package and racket/trace
.

@raedon.neil has joined the channel

@leif can nanopass consume and produce syntax objects?

@lexi.lambda Not really. (Technically yes, but then it won’t do all of the template generation for you.)

(At which point there’s not much point.)

pun not intended. :wink:

okay. that is what I suspected, but it’s good to know for sure.

Can I ask what you are doing?

Because if what you want is things like source locations then that should still be fine.

I am interested in adding an optimizer to Hackett. I would like to expand Hackett to a core language, then run the optimizer on the core language before expanding to #%kernel
.

Okay. in that case (depending on how you want to do it), nanopass might still be good.

I presume you want to do whole module compilation, yes?

yes, the optimizer would essentially run after module expansion.

that is, in #%module-begin
.

Okay

In that case nanopass would probably be the way to go.

(Depending on how large your compiler is going to be.)

(If its a small one, or if you want to use a single IR, then there are obviously other ways to get the boilerplate reduction.)

What I would do is when you have your ‘parse’ pass, store the binding information yourself.

I’m not sure yet. Right now I mostly want to do simple things. If I’m going to do laziness, I need to be able to do strictness analysis. Eventually I’ll need to be able to do type-directed specialization.

Either by storing the literal identifier (rather than the symbol), or with some binding
structure.

Ah, fair.

Well if you do choose nanopass, feel free to let me know and I will do what I can to help. :slightly_smiling_face:

Okay, that’s helpful. I might experiment with a few different things. :)

Okay cool. Well good luck, and I hope it goes well. ^.^

The main obstacle is finding the time, but I’ve been toying with the idea for a while with my spare cycles, so I think I just need to sit down and start writing some code.

Does anyone know if there is a good mapping from editor or display coordinates from a snips on-event
method, to the dc coordinates in its draw
method?

Like, it looks like I can use the dx and dy variables to re-position the origin, but then I’m worried about the dc coordinates using a different scale than the editor (or display) ones.

Like iirc, on os x its 2 to 1 or something like that.