Using psyntax to expand to different language than r6rs scheme

Asked by Ramūnas Gutkovas

Is it possible to expand to different language than r6rs scheme using psyntax and to override library expansion with custom rewriting and code generation.

What I am trying to achieve is to implement scheme like language with syntax-case macros and use r6rs libraries, which expand to core language i.e. ActionScript. I also need to generate separate ActionScript packages from libraries.

Cheers
Ramūnas

Question information

Language:
English Edit question
Status:
Answered
For:
r6rs-libraries Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Abdulaziz Ghuloum (aghuloum) said :
#1

Greetings Ramūnas,

The current psyntax does not expand your code *to* R6RS Scheme. It expands *from* R6RS to whatever format you want, the standard one being some variant of R5RS. Look at the generated *.pp files for an of idea.

It would be easier for you, I believe, to post-process that file and compile it to whatever target you want instead of modifying psyntax's generators to do that. The custom rewrite rules and code builders are intended for people who want to embed psyntax into their implementations rather than people who want to use it as an external tool. It might also be easier even if you do want to embed it in your implementation since the generated output language is pretty straightforward.

I have recently added a program that gives you the expanded run-time (invoke) code for an R6RS script and all of its dependencies (someone needed this to expand R6RS libraries to Stalin which has no macro facilities of its own). Since all the information about the expanded libraries (e.g., dependencies, codes, etc.) are all there in the library objects that the library-manager holds, I would think it should be easy to use that information for whatever purpose you want.

Let me know if you have any specific questions about this. Your question above is pretty general.

Aziz,,,

Can you help with this problem?

Provide an answer of your own, or ask Ramūnas Gutkovas for more information if necessary.

To post a message you must log in.