|
psbotsA PostScript engine developped in TypeScript
|
Nothing but...
π€ They start with P...
π΄ They were both created in the last century.
In 1992, Adobe created PDF
on top of concepts introduced by...
PostScript which was invented in 1976.
A PDF document is a structured algorithm in which pages are rendered using a program.
%PDF-1.4
% ...skipping document attributes ...
3 0 obj<</Type/Pages/Kids[4 0 R]/Count 1/MediaBox[0 0 595.32 841.92]>>
endobj
4 0 obj<</Type/Page/Parent 3 0 R/Resources<</Font<</F0 6 0 R>>>>/Contents 5 0 R>>
endobj
5 0 obj<</Length 59>>stream
BT
/F0 12 Tf % Font selection
1 0 0 1 100 702.7366667 Tm % Position
(Hello World!)Tj % Write Hello World!
ET
endstream
endobj
% ...skipping objects (including font descriptor)...
% ...skipping object reference table...
Hello World.pdfPostScript is a dynamically typed,
stack-based programming language.
It is most commonly used in the publishing world,
but as a Turing complete programming language,
it can be used for many other purposes.
A long time ago, I learned PostScript to be able to process* printing streams.
I have been fascinated by the power and the simplicity of this language.
The language relies on simple concepts :
To make an addition, push the operands first and then call the operator : 1 2 add.
The following array declaration [ 1 ] consists of :
[ : array begin β pushes mark on the operand stack1 : pushes the integer 1 on the operand stack] : array close β checks where is the first mark, collects values, clears the operand stack and pushes an array containing collected valuesNot complete...
...And with deviations
finally...1 2 add[ 1 ]/factorial
{
%% check stack
count 1 lt { stackunderflow } if
dup type /integer neq { typecheck } if
1 exch
%% result n
{
dup 2 lt { pop stop } if
dup 3 1 roll mul
exch
1 sub
} loop
} bind def
I have been invited to a gaming challenge where people could code the PONG's paddle using JavaScript.
It was fun but...