-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: Add infrastructure for new CLI drivers
juliax
and juliac
Following the discussion in #50974, it became clear that there is significant objection to changes to the behavior of the julia CLI driver. Some commenters found changes to the behavior acceptable if they were unlikely to impact existing code (e.g. in the case of #50974 using `__main__` instead of `main`), while other were worried about the reputational risks of even changing behavior in the corner case. In subsequent discussion it became relatively clear that the only way forward that did not raise significant objection was to introduce a new CLI driver for the new behavior. This may seem a bit drastic just for the change in #50974, but I actually think there's a number of other quality-of-life improvements that this would enable us to do over time, for example: - Autoloading/caching of all packages in the manifest - auto-selection of julia versions (integrate juliaup?) In addition, it doesn't seem so bad to have some CLI design flexibility to make sure that the `juliac` driver is aligned with what we need. This PR is the minimal infrastructure to add the new drivers. In particular, it does the following: 1. Adds two new cli drivers, `juliax` and `juliac`. At the moment, `juliac` is a placeholder and just errors, while `juliax` behaves the same as `julia` (except to error on the deprecated `--math-mode=fast`, just as an example of a behavior difference). 2. Documents that the behavior of `julia` (but not `juliax` or `juliac`) is pat of the julia public API. 3. Switches the cli mode based on the argv[0] of the binary. I.e. all three binaries are identical, except for their name, the same way that, e.g. `clang` and `clang++` are the same binary just with different names. On Unix systems, these are symlinks. On windows, separate copies of the same (small) binary. There is a fallback cli option `--cli-mode` that can be used in case the argv[0] detection is not available (e.g. for some fringe embedded use cases). 4. There is currently no separate `-debug` version of the new drivres. My intention is to make this dependent on the ordinary debug flags, rather than having a separate driver. Once this is merged, I intend to resubmit #50974 (chaning `juliax` only), and then finish and hook up `juliac` shortly thereafter.
- Loading branch information
Showing
9 changed files
with
182 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.\" To get a preview of the man page as it will actually be displayed, run | ||
.\" | ||
.\" > nroff -man juliac.1 | less | ||
.\" | ||
.\" at the terminal. | ||
.\" | ||
|
||
.TH JULIAC 1 2023-09-01 JULIA | ||
|
||
.\" from the front page of https://julialang.org/ | ||
.SH NAME | ||
juliac - Compiler driver for the julia programming language | ||
|
||
.SH SYNOPSIS | ||
\fBjulia\fR [OPTIONS...] \fB--\fR PROGRAMMFILE | ||
|
||
The Julia source file \fIPROGRAMFILE\fP (optionally followed by | ||
arguments in \fIARGS\fP) will be compiled and a binary will be | ||
written out according to OPTIONS. | ||
|
||
.SH DESCRIPTION | ||
This is a placeholder for the upcoming compiler-driver for the julia | ||
programming language. It is currently non functional. See | ||
.BR julia (1) | ||
for the traditional cli driver. | ||
|
||
.SH "COMMAND-LINE OPTIONS" | ||
|
||
.SH FILES AND ENVIRONMENT | ||
See https://docs.julialang.org/en/v1/manual/environment-variables/ | ||
|
||
.SH BUGS | ||
Please report any bugs using the GitHub issue tracker: | ||
https://github.com/julialang/julia/issues?state=open | ||
|
||
.SH AUTHORS | ||
Contributors: https://github.com/JuliaLang/julia/graphs/contributors | ||
|
||
.SH INTERNET RESOURCES | ||
Website: https://julialang.org/ | ||
.br | ||
Documentation: https://docs.julialang.org/ | ||
.br | ||
Downloads: https://julialang.org/downloads/ | ||
|
||
.SH LICENSING | ||
Julia is an open-source project. It is made available under the MIT license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
.\" To get a preview of the man page as it will actually be displayed, run | ||
.\" | ||
.\" > nroff -man juliax.1 | less | ||
.\" | ||
.\" at the terminal. | ||
.\" | ||
|
||
.TH JULIAC 1 2023-09-01 JULIA | ||
|
||
.\" from the front page of https://julialang.org/ | ||
.SH NAME | ||
juliax - Experimental driver for the julia programming language | ||
|
||
.SH SYNOPSIS | ||
\fBjulia\fR [OPTIONS...] \fB--\fR PROGRAMMFILE | ||
|
||
If a Julia source file is given as a \fIPROGRAMFILE\fP (optionally followed by | ||
arguments in \fIARGS\fP) Julia will execute the program and exit. | ||
|
||
.SH DESCRIPTION | ||
This is the unstable, experimental driver for the Julia programming language. | ||
This interface is currently not stable across Julia versions. The behavior of | ||
this driver matches that of | ||
.BR julia (1) | ||
except for the differences noted below. | ||
|
||
.SH "COMMAND-LINE OPTIONS" | ||
|
||
.TP | ||
--math-mode=fast | ||
In juliax, this option is an error. In | ||
.BR julia (1) | ||
this options is silently ignored. | ||
|
||
.TP | ||
--cli-mode | ||
In juliax, this option is an error. In | ||
.BR julia (1) | ||
may be used to switch into juliax mode. | ||
|
||
.SH FILES AND ENVIRONMENT | ||
See https://docs.julialang.org/en/v1/manual/environment-variables/ | ||
|
||
.SH BUGS | ||
Please report any bugs using the GitHub issue tracker: | ||
https://github.com/julialang/julia/issues?state=open | ||
|
||
.SH AUTHORS | ||
Contributors: https://github.com/JuliaLang/julia/graphs/contributors | ||
|
||
.SH INTERNET RESOURCES | ||
Website: https://julialang.org/ | ||
.br | ||
Documentation: https://docs.julialang.org/ | ||
.br | ||
Downloads: https://julialang.org/downloads/ | ||
|
||
.SH LICENSING | ||
Julia is an open-source project. It is made available under the MIT license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters