PostScript

1 program Added 2025-10-23T07:15:23Z Model: x-ai/grok-4-fastTemp: 0.4 Evidence Report issue View issues
Aliases: ps
Provenance: commit f69d761a85 · authored 2025-10-23T09:15:23+02:00 · model x-ai/grok-4-fast

Sources mentioning this language

8 sources · pl_id: pl/postscript
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q218170

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm: concatenative (stack-based) · procedural
Typingdynamic, weak
Designed byAdobe Systems · John Warnock · Chuck Geschke · Doug Brotz · Ed Taft · Bill Paxton
First appeared1982
Influenced byMesa · Interpress · Lisp · FORTH

Extensions claimed by this language

7 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.pslinguistprimary754.8K files
.pspygmentsprimary754.8K files
.pswikidataprimary754.8K files
.epslinguistsecondary3.2M files
.epspygmentssecondary3.2M files
.epsilinguistsecondary6.1K files
.pfalinguistsecondary4.0K files

Related languages

PureScript (0.36)PogoScript (0.35)PascalScript (0.32)Parenscript (0.32)Praat (0.30)

LLM-contributed programs

Hello World

Provenance: commit f69d761a85 · authored 2025-10-23T09:15:23+02:00 · model x-ai/grok-4-fast · Temp 0.4
code.ps · added: 2025-10-23T07:15:23Z
%!PS
/Courier             % name the desired font
12 selectfont        % choose the size in points and establish
% the font as the current one
72 500 moveto        % position the current point at
% coordinates 72, 500 (the origin is at the
% lower-left corner of the page)
(Hello world!) show  % show the string
showpage             % print all on the page

Real programs from Software Heritage

1 sample mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
PSL_prologue.ps · 5556 B · ext .ps · seen 498× in SWH
via unique-primary
swh:1:cnt:9d1eea282437ace446edca9522c4e4101da870e5;origin=https://github.com/zguoch/ModernGMT;anchor=swh:1:rev:1f2395a55e54047f26806eae2f2a2b18b24614a6;path=/src/PSL_prologue.ps
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
%-----------------------------------------------------------------------------
%- NOTE: No longer user as replaced by static string in PSL_strings.h.
%- 	 We keep the file in the repository as it may be simpler to see
%-	 the logic in this file than in the static string.
%-----------------------------------------------------------------------------
% Begin pslib header
250 dict begin
/! {bind def} bind def
/# {load def}!
/A /setgray #
/B /setdash #
/C /setrgbcolor #
/D /rlineto #
/E {dup stringwidth pop}!
/F /fill #
/G /rmoveto #
/H /sethsbcolor #
/I /setpattern #
/K /setcmykcolor #
/L /lineto #
/M /moveto #
/N /newpath #
/P /closepath #
/R /rotate #
/S /stroke #
/T /translate #
/U /grestore #
/V /gsave #
/W /setlinewidth #
/Y {findfont exch scalefont setfont}!
/Z /show #
/FP {true charpath flattenpath}!
/MU {matrix setmatrix}!
/MS {/SMat matrix currentmatrix def}!
/MR {SMat setmatrix}!
/edef {exch def}!
% Path fill
/FS {/fc edef /fs {V fc F U} def}!
/FQ {/fs {} def}!
% Outline off or on
/O0 {/os {N} def}!
/O1 {/os {P S} def}!
% Set both fill and outline
/FO {fs os}!
% Star: radius xc yc
/Sa {M MS dup 0 exch G 0.726542528 mul -72 R dup 0 D 4 {72 R dup 0 D -144 R dup 0 D} repeat pop MR FO}!
% Box: height width xll yll
/Sb {M dup 0 D exch 0 exch D neg 0 D FO}!
% Rounded box: height width radius xll yll
/SB {MS T /BoxR edef /BoxW edef /BoxH edef BoxR 0 M
  BoxW 0 BoxW BoxH BoxR arct BoxW BoxH 0 BoxH BoxR arct 0 BoxH 0 0 BoxR arct 0 0 BoxW 0 BoxR arct MR FO}!
% Circle: radius xc yc
/Sc {N 3 -1 roll 0 360 arc FO}!
% Diamond: radius xc yc
/Sd {M 4 {dup} repeat 0 G neg dup dup D exch D D FO}!
% Ellipse: major minor angle xc yc
/Se {N MS T R scale 0 0 1 0 360 arc MR FO}!
% Octagon: radius xc yc
/Sg {M MS 22.5 R dup 0 exch G -22.5 R 0.765366865 mul dup 0 D 6 {-45 R dup 0 D} repeat pop MR FO}!
% Hexagon: radius xc yc
/Sh {M MS dup 0 G -120 R dup 0 D 4 {-60 R dup 0 D} repeat pop MR FO}!
% Inverted triangle: radius xc yc
/Si {M MS dup neg 0 exch G 60 R 1.732050808 mul dup 0 D 120 R 0 D MR FO}!
% Rotated rectangle: height width angle xc yc
/Sj {M MS R dup -2 div 2 index -2 div G dup 0 D exch 0 exch D neg 0 D MR FO}!
% Pentagon: radius xc yc
/Sn {M MS dup 0 exch G -36 R 1.175570505 mul dup 0 D 3 {-72 R dup 0 D} repeat pop MR FO}!
% Dot: radius xc yc [hardwired as circle with no outline]
/Sp {N 3 -1 roll 0 360 arc fs N}!
% Patch fill: x1 y1 ... xn yn n
/SP {M {D} repeat FO}!
% Rectangle: height width xc yc
/Sr {M dup -2 div 2 index -2 div G dup 0 D exch 0 exch D neg 0 D FO}!
% Rounded rectangle: height width radius xc yc
/SR {MS T /BoxR edef /BoxW edef /BoxH edef BoxR BoxW -2 div BoxH -2 div T BoxR 0 M
  BoxW 0 BoxW BoxH BoxR arct BoxW BoxH 0 BoxH BoxR arct 0 BoxH 0 0 BoxR arct 0 0 BoxW 0 BoxR arct MR FO}!
% Square: radius xc yc
/Ss {M 1.414213562 mul dup dup dup -2 div dup G 0 D 0 exch D neg 0 D FO}!
% Triangle: radius xc yc
/St {M MS dup 0 exch G -60 R 1.732050808 mul dup 0 D -120 R 0 D MR FO}!
% Single-headed vector
/SV {0 exch M 0 D D D D D 0 D FO}!
% Double-headed vector
/Sv {0 0 M D D 0 D D D D D 0 D D FO}!
% Pie Wedge: radius angle1 angle2 xc yc
/Sw {2 copy M 5 2 roll arc FO}!
% Cross: radius xc yc
/Sx {M 1.414213562 mul 5 {dup} repeat -2 div dup G D neg 0 G neg D S}!
% Y-dash: radius xc yc
/Sy {M dup 0 exch G dup -2 mul dup 0 exch D S}!
% Plus: radius xc yc
/S+ {M dup 0 G dup -2 mul dup 0 D exch dup G 0 exch D S}!
% X-dash: radius xc yc
/S- {M dup 0 G dup -2 mul dup 0 D S}!
% String width, height, depth and total height (height-depth)
/sw {stringwidth pop}!
/sh {V MU 0 0 M FP pathbbox N 4 1 roll pop pop pop U}!
/sd {V MU 0 0 M FP pathbbox N pop pop exch pop U}!
/sH {V MU 0 0 M FP pathbbox N exch pop exch sub exch pop U}!
/sb {E exch sh}!
% To align text {bottom,middle,top}{left,center,right}
/bl {}!
/bc {E -2 div 0 G}!
/br {E neg 0 G}!
/ml {dup 0 exch sh -2 div G}!
/mc {dup E -2 div exch sh -2 div G}!
/mr {dup E neg exch sh -2 div G}!
/tl {dup 0 exch sh neg G}!
/tc {dup E -2 div exch sh neg G}!
/tr {dup E neg exch sh neg G}!
% Maximum of two numbers
/mx {2 copy lt {exch} if pop}!
% Translate and memorize advance
/PSL_xorig 0 def /PSL_yorig 0 def
/TM {2 copy T PSL_yorig add /PSL_yorig edef PSL_xorig add /PSL_xorig edef}!
% To reencode one font with the provided encoding vector
/PSL_reencode {findfont dup length dict begin
  {1 index /FID ne {def}{pop pop} ifelse} forall
  exch /Encoding edef currentdict end definefont pop
}!
/PSL_eps_begin {					% Marks begin of EPSF inclusion
  /PSL_eps_state save def				% Save state for cleanup
  /PSL_dict_count countdictstack def			% Count objects on dict stack
  /PSL_op_count count 1 sub def				% Count objects on operand stack
  userdict begin					% Push userdict stack
  /showpage {} def					% Deactivate showpage command
  0 setgray 0 setlinecap 1 setlinewidth			% Prepare clean graphics state
  0 setlinejoin 10 setmiterlimit [] 0 setdash newpath
  /languagelevel where	% If level != 1, set strokeadjust and overprint to their defaults
  {pop languagelevel 1 ne {false setstrokeadjust false setoverprint} if} if
}!
/PSL_eps_end {						% Marks end of EPSF inclusion
  count PSL_op_count sub {pop} repeat			% Clean up operand stack
  countdictstack PSL_dict_count sub {end} repeat	% Clean up dict stack
  PSL_eps_state restore					% Restore saved state
}!
/PSL_transp {						% Set transparency
  /.setopacityalpha where {pop .setblendmode .setopacityalpha}{		% Using ghostscript
  /pdfmark where {pop [ /BM exch /CA exch dup /ca exch /SetTransparency pdfmark}	% Or Adobe
  {pop pop} ifelse} ifelse				% Or skip if neither are supported
}!

Contribute — propose a file extension

Tell us where to find evidence about PostScript (mapped to pl/postscript). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/PostScript/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Postrado PostScriptum →