[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: RE: Declarative programming requires a differentmindset

  • From: Liam R E Quin <liam@w3.org>
  • To: Michael Sokolov <sokolov@ifactory.com>
  • Date: Mon, 12 Apr 2010 02:03:16 -0400

RE:  RE: Declarative programming requires a differentmindset
On Sun, 2010-04-11 at 08:27 -0400, Michael Sokolov wrote:
> Postscript is an interesting case - I am told that it is Turing-complete,
> but its uses are almost entirely declarative: for layout, akin to HTML.
> Perhaps someone more knowledgeable about PS on this list would care to
> comment on how that came to be?

PostScript is a procedural graphics language that uses a reverse polish
notation to manipulate a stack. Yes, it's Turing-complete, or as
complete as one can get with finite memory :-) PostScript is nothing
whatsoever like HTML -- here's a simple example:

%!PS
/Times-Italic findfont % search the font dictionary for Times-Italic
18 scalefont           % scale the font to 18pt
setfont                % make it the current font
72 72 moveto           % Move to 1 inch from the top left of the page
(Hello World)          % push a string "Hello World" onto the stack
show                   % render the string in 18pt Times Italic
showpage               % print the current page and clear the buffer

Hope this helps.

Liam


-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.