Skip to content

Add arguments to the compiler to make certain functions easier #1934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Lamparter opened this issue Mar 26, 2025 · 1 comment
Open

Add arguments to the compiler to make certain functions easier #1934

Lamparter opened this issue Mar 26, 2025 · 1 comment

Comments

@Lamparter
Copy link
Contributor

It would be nice to be able to compile some things automatically as input to the compiler rather than copying the same thing into each file.

Rather than putting

import clr
clr.AddReference("bla bla bla")
from whatever import foo

I might want to add these as arguments to the IronPython compiler so that they don't need to be in every file.

This will make it easier to support PackageReference via the IronPython SDK and other features.

@BCSharp
Copy link
Member

BCSharp commented Mar 29, 2025

I might want to add these as arguments to the IronPython compiler so that they don't need to be in every file.

I assume you mean adding a command-line argument specifying a Python file with those (or any other) commands, to be prepended to every compiled file. Sort of an equivalent of #include in C. Yes, this sounds like a good idea. I thought that this was already possible, but I don't see it anywhere in the compiler options.

OTOH, once the compiler can do it, why not the regular interpreter? After all, you may want to debug/test the project under the interpreter as well. And once it is supported by the interpreter, there is already an option to pass arguments to the compiler that are defined for the interpreter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants