Stream: compiler development

Topic: zig compiler - REPL exploration


view this post on Zulip Luke Boswell (Feb 03 2025 at 02:06):

Brendan Hansknecht said:

I should be able to return from the repl to the platform at any point. Then the platform should be able to do something with the object I return (whatever type it may be).

I am confused a little by this.

For example, how can I have a REPL and a host both using the terminal stdio. Particularly if the platform doesn't even know, because it's just a shimmed out app.o.

@Brendan Hansknecht can you describe the way we build a REPL environment?

view this post on Zulip Brendan Hansknecht (Feb 03 2025 at 02:10):

This was not talking about the shim. This was talking about embedded libroc and it running the interpreter as a repl.

view this post on Zulip Luke Boswell (Feb 03 2025 at 02:10):

Ahk... I think the platform part threw me.

the platform should be able to do something with the object I return

view this post on Zulip Luke Boswell (Feb 03 2025 at 02:11):

Here you were thinking the "REPL" is the platform that is driving things.. so we're not really talking platform/application in a normal sense

view this post on Zulip Brendan Hansknecht (Feb 03 2025 at 02:11):

That said, I do think the shim will eventually support a debugging mode. That will probably have to work like pdb (python debugger). For that you launch a separate debugger process and give it the PID of the application using the shim. It can then use interrupts, I believe, to pass info to the interpreter for single stepping and such. (Not 100% sure how it works, but I'm sure we can look at how python does it)

view this post on Zulip Brendan Hansknecht (Feb 03 2025 at 02:12):

Luke Boswell said:

Here you were thinking the "REPL" is the platform that is driving things.. so we're not really talking platform/application in a normal sense

Yeah

view this post on Zulip Luke Boswell (Feb 03 2025 at 02:14):

(deleted) -- I'm just going to hack on some ideas


Last updated: Jul 06 2025 at 12:14 UTC