Print

=title Terminal::Print

Synopsis

Terminal::Print implements an abstraction layer for printing characters to terminal screens with full Unicode support and -- crucially -- the ability to print from concurrent threads. The idea is to provide all the necessary mechanical details while leaving the actual so called 'TUI' abstractions to higher level libraries.

Obvious applications include snake clones, rogue engines and golfed art works :)

Oh, and Serious Monitoring Apps, of course.

Usage

Terminal::Print creates you an object for you when you import it, stored in $Terminal::Print::T. It also creates a constant T for you in the OUR:: scope.

Thus common usage would look like this:

    T.initialize-screen;
    T.print-string(20, 20, DateTime.now);
    T.shutdown-screen;

Miscellany

Where are we at now?

All the features you can observe while running perl6 t/basics.t work using the new react/supply based Terminal::Print::Grid. If you run that test file, you will notice that Terminal::Print is needing a better test harness. Part of that is getting a STDERR or some such pipe going, and printing state/ That will make debugging a lot easier.

Testing a thing that is primarily designed to print to a screen seems a bit difficult anyway. I almost think we should make it interactive. 'Did you see a screen of hearts?'

So: async (as mentioned above), testing, and debugging are current pain points. Contributions welcome.

Why not just use NativeCall and ncurses?

I tried that first and it wasn't any fun. ncurses unicode support is admirable considering the age and complexity of the library, but it still feels bolted on.

ncurses is not re-entrant, either, which would nix one of the main benefits we might be able to get from using Perl 6 -- easy async abstractions.

Terminal::Print v0.973

Asynchronous printing to your terminal -- as a simple grid

Authors

  • John Haltiwanger
  • japhb

License

Artistic-2.0

Dependencies

OO::MonitorsTerminal::ANSIColorTerm::termiosFile::Which

Test Dependencies

Provides

  • Terminal::Print
  • Terminal::Print::Animated
  • Terminal::Print::BoxDrawing
  • Terminal::Print::Commands
  • Terminal::Print::DecodedInput
  • Terminal::Print::Grid
  • Terminal::Print::ParticleEffect
  • Terminal::Print::Pixelated
  • Terminal::Print::RawInput
  • Terminal::Print::Util::Text
  • Terminal::Print::Util::Timing
  • Terminal::Print::Widget

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.