Skip to content
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

should we move printf code out of Base? #23929

Closed
StefanKarpinski opened this issue Sep 29, 2017 · 4 comments · Fixed by #25056
Closed

should we move printf code out of Base? #23929

StefanKarpinski opened this issue Sep 29, 2017 · 4 comments · Fixed by #25056
Labels
excision Removal of code from Base or the repository stdlib Julia's standard library
Milestone

Comments

@StefanKarpinski
Copy link
Member

The real motivation is to replace it with something standard that's better in 1.x. The current code works, but it requires macros for invocation, which is suboptimal and has long been (low down) on my todo-list for a redesign. If we make a Printf standard library package then we can evolve this in the future, potentially in a backward incompatible way.

@StefanKarpinski StefanKarpinski added excision Removal of code from Base or the repository triage This should be discussed on a triage call labels Sep 29, 2017
@JeffBezanson
Copy link
Member

Yes, that's the spirit! Move out all the things!! :)

I actually don't have a strong opinion on this one though, since printf is such standard functionality.

@JeffBezanson JeffBezanson added the stdlib Julia's standard library label Sep 29, 2017
@StefanKarpinski
Copy link
Member Author

Perusing the code base, @printf is only used in a few utility functions and in parts of Base that should be moved into packages. The laziest future-proof approach to excision is to leave the definition in Base and add a Printf stub module to stdlib that just exports the functionality that's defined in Base. The same approach could be used for other excisions as well.

@JeffBezanson JeffBezanson removed the triage This should be discussed on a triage call label Oct 5, 2017
@JeffBezanson JeffBezanson added this to the 1.0 milestone Oct 5, 2017
@StefanKarpinski
Copy link
Member Author

The 1.0 to do here is:

  1. unexport @printf and co from Base
  2. create Printf in stdlib which exports the above.

Later we can more thoroughly extract this and replace the few uses of printf in Base (mostly to print a fixed number of floating-point digits) with simpler more targeted functionality.

@brenhinkeller

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
excision Removal of code from Base or the repository stdlib Julia's standard library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants