[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Libtextstyle in Jitter and Poke: sub-package mode and CSS installati

From: Luca Saiu
Subject: Re: Libtextstyle in Jitter and Poke: sub-package mode and CSS installation
Date: Wed, 30 Oct 2019 19:28:45 +0100
User-agent: Gnus (Gnus v5.13), GNU Emacs 27.0.50, x86_64-pc-linux-gnu

On 2019-10-30 at 07:56 +0100, Luca Saiu wrote:

> Again, as long as we do not print structured literals with internal
> styling, this is trivial: the author of a VM does not even need to
> know the details of styling.

José, after rereading this I have changed my mind.

There will be support for advanced styling even within VM instruction
literals, including pretty-printing.  The required API change for user
printers will be reasonable, and simple printing with a default style
will remain easy and generate sensible output.  What you need to support
pretty-printing as well is just an initial column number.  I can give
you that.

Jitter and Poke are ambitious projects, not quick hacks.  And we are
experienced programmers.  If you want to go out and decorate every
character of your output, do it.  You have my blessing.

Now, some details.

A user printer styling the internal components of a literal will need a
libtextstyle output stream.  This stream will need to be opened with the
application's CSS file -- here Poke's, and not Jitter's.  The rest of
the printer (we are speaking here about a VM routine printer) will
instead user Jitter's style.  I can manually flush the output stream
when the two styles alternate, in a way that is hidden from the user.

Still, we need a way to tell the Jittery VM about the application
printing style.  There will be a new C function for that.

And then, inside the printer function, there will be style changes:
styled_ostream_begin_use_class and styled_ostream_end_use_class.

I want libtextstyle to remain an *optional* dependency, in the interest
of minimalism.  So all of this must be hidden behind an API which can
fall back to puts and stdout, requiring no preprocessor conditional in
the user code.  This I can give you, easily.
Would you like to use the same facilities in your non-Jittery styled
printing, from Poke?  I am quite sure that you have the same
requirement, and therefore you will need a similar wrapper.  If you used
Jitter functions for printing your styled Poke data structures, we would
save some effort.

What do you think?

Luca Saiu
* My personal web site:  http://ageinghacker.net
* GNU epsilon:           http://www.gnu.org/software/epsilon
* Jitter:                http://ageinghacker.net/projects/jitter

I support everyone's freedom of mocking any opinion or belief, no
matter how deeply held, with open disrespect and the same unrelented
enthusiasm of a toddler who has just learned the word "poo".

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]