Skip to content

Conversation

@fonsp
Copy link
Owner

@fonsp fonsp commented Feb 26, 2022

For backwards-compatibility with software written in the 70s πŸ˜΅β€πŸ’« code that still needs to make the switch to Julia's awesome Logging system!

I tried to use visual design to address the reasons that we originally had for not supporting stdout in Pluto:

  • In the Julia REPL and Jupyter, It can be hard/impossible to understand the difference between something being returned and something being displayed as text. In a descriptive dataflow system, this difference is important!
  • Motivate users to return values (much nicer display system), and to split large code into smaller cells.
  • Motivate users to use Logging for logging, not πŸ–¨ printing unstructured text to magic buffer.
  • Stdin/stdout is often presented as a "basic feature" of a language, but I disagree! I see it as a niche feature for inter-process communication and super-optimized IO, not something we should teach to beginners. πŸ€•

Anyway, it turned out to be more confusing/frustrating to silently hide stdout, so here we go! A boring old terminal

Schermafbeelding 2022-02-26 om 00 33 50

Some common functions that didn't work before!


Schermafbeelding 2022-02-25 om 23 58 24

You like ASCII art? Then you will love real art!


Schermafbeelding 2022-02-25 om 23 57 09

Oooh is this hacking!?


Schermopname.2022-02-25.om.23.56.18.mov

Help what is this green stuff!

xoxo
~ @fonsp

@github-actions
Copy link
Contributor

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="stdout-to-crt")
julia> using Pluto

@fonsp fonsp linked an issue Feb 26, 2022 that may be closed by this pull request
@icweaver
Copy link

"But can you make it so the printy thing shows up in the notebook?"

Fons:
94c_5_15

But seriously though, this is magnificent

@fonsp
Copy link
Owner Author

fonsp commented Mar 1, 2022

Tests were failing because of race conditions in main, I addressed these in main: 8f088f7...a13644e

fonsp added 5 commits March 1, 2022 20:55
This reverts commit 25425f9.
Because we already mess with the seed inbetween cell executions :) Making that consistent is a job for another time
@fonsp fonsp merged commit bfd7ecc into main Mar 1, 2022
@fonsp fonsp deleted the stdout-to-crt branch March 1, 2022 21:00
@diegozea
Copy link
Contributor

diegozea commented Mar 2, 2022

Hi! Small question: Will it be a way to hide stdout/stderr without hiding the returned value? In Jupyter is sometimes annoying (and slow) to run processes that fill stdout with a massive amount of text; would that be also a problem with Pluto in the future? Cheers,

@fonsp
Copy link
Owner Author

fonsp commented Mar 2, 2022

Yes, in the ... button next to cell, you have the option to hide logs (this PR turns stdout into a special log). But please try it out and let us know if this helps! Maybe we should also set a maximum size on captured stdout

@fonsp fonsp added the logging About `@info`, `@warn`, etc label Mar 2, 2022
@gdalle
Copy link
Contributor

gdalle commented Mar 13, 2022

This is brilliant! Thanks a lot

@fonsp
Copy link
Owner Author

fonsp commented Apr 22, 2022

Fix #890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logging About `@info`, `@warn`, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

print() and @show for intermediate results

5 participants