Skip to content
Snippets Groups Projects
Commit f7e0aa03 authored by Hendrik Rassmann's avatar Hendrik Rassmann
Browse files

bad writing and bad code

parent 6fa4cd18
No related branches found
No related tags found
No related merge requests found
File added
......@@ -3,34 +3,88 @@
%Document_Element:
%DefinedFunctions
%buildins
72 600 moveto
%-----------------------------
%State between Pages: Int (Pagenumber) Future: Current bullet point 3.3.a
%----------------------------
%Idea: #Section
% ##Paragraph
% intern: #scales the font :D
/LEFT_MARGIN 20 def
/TOP_MARGIN 700 def
/RIGHT_MARGIN 500 def
/BOTTOM_MARGIN 55 def
/LINE_SPACING 25 def
/NEW_LINE. {currentpoint exch pop BOTTOM_MARGIN lt {NEW_PAGE.} if currentpoint exch pop LINE_SPACING sub LEFT_MARGIN exch moveto} %# DS -> DS
def
/NEW_PAGE. {showpage RIGHT_MARGIN 10 add BOTTOM_MARGIN LINE_SPACING sub moveto 1 add dup 0 gt {dup 100 string cvs show} if LEFT_MARGIN TOP_MARGIN moveto} %# 1->1
def
/HEADER_FONT /Times-Bold findfont 32 scalefont def
/HEADER_MODE. {HEADER_FONT setfont} def
/SECTION_FONT /Times-Bold findfont 18 scalefont def
/SECTION_MODE. {SECTION_FONT setfont} def
/TEXT_FONT /Times findfont 18 scalefont def
/TEXT_MODE.{TEXT_FONT setfont} def
/PP { {pop pop currentpoint exch 500 gt
{20 exch 50 sub moveto} %# Int -> 1
{pop} %# X -> 1
ifelse} %#
/PP { {pop pop %Future: only New_Line on a WhiteSpace
currentpoint pop RIGHT_MARGIN gt {NEW_LINE.} %# Int->1
if} %#Int ->
exch kshow
} %# String -> 1
def
/Fin {exch exec} def
/Title: {HEADER_MODE. {PP}} def
/Paragraph: {Fin TEXT_MODE. {PP}} def
/Skip. {}
def
/Page: {NEW_PAGE.}
def
/Fin {exch exec} %# {String->1} String -> 1
def
/TAB. {( ) show}
def
/VOID: { {pop} {} } def
/Title: {HEADER_MODE. NEW_LINE. {PP NEW_LINE.}} def
/Paragraph: {Fin TEXT_MODE. NEW_LINE. TAB. {PP}} def
/Section: {Fin SECTION_MODE. NEW_LINE. NEW_LINE. TAB. {PP}} def
/Force_New_Page. {Fin NEW_PAGE. VOID:} def
TEXT_FONT setfont
%%---------- Wishfull Thinking
Skip. -0 Page: %starting page number, <1 will be skipped later
Title: (Algebraic Typechecking for Stack Languages)
Paragraph: (Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Donec egestas risus ipsum, et condimentum tellus varius id.
In pellentesque, mi et rutrum ultrices, neque nisl hendrerit ligula, et bibendum nulla risus a diam.)
Section: (Introduction)
% Paragraph: (Vestibulum volutpat maximus magna, ac imperdiet lorem efficitur in. Curabitur tortor felis, euismod vitae ipsum id, euismod condimentum libero. Aenean blandit lorem eu diam mattis tempor. Duis efficitur arcu id laoreet sollicitudin. Nam maximus id turpis sed sagittis. Proin nec sem eros. Proin at nisi ac dolor tincidunt suscipit. Proin eu aliquet tellus. Aenean tincidunt leo vel consectetur luctus. Morbi ac massa aliquet, lobortis metus non, venenatis mauris. Curabitur facilisis ultricies felis eu interdum.)
Paragraph:
(The work aims to explore a known, but underexplored way to think about typing stack languages.
Stack based Languages have seen a wide adoption as intermediate languages. Software written directly in them is relatively scarce.
Instead of thinking about typed programs in term of proofs, we will think about types as algebraic expressions.
Of course this algebra will be equivalent to some substructural logic, if you want to.)
Fin
Section: (1. Fundamentals)
Section: (1.1 What is a Stack Machine)
Paragraph: (When a function is evaluated, inputs and outputs aren't read from and written to registers.
Instead a function pops input values from a global stack and pushes a result back onto the same stack.
Allthough this simple architecture suffices to be Turing complete, many Stack oriented languages also allow one to define variables.
Another convinience are distinct stacks for distinct types of data. For example, FORTH uses a second stack to store floating point numbers, and PostScript uses a dictionary stack.
)
Force_New_Page.
%Example: 2 3 5 7 | 4 1 roll pop mul mul => 42
%2 3 5 7 on_stack execute 4 then 1 then /roll then /pop then /mul then /mull :End_Diagram
% 3 1 roll NEW_PAGE.
Paragraph: (Applicative vs Concatinative
)
Paragraph: (
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
)
Section: (1.2 Dioid Algebra)
Fin showpage %this isn't nice, find a distinction between Fin and Fin-spam
%-------------------------------------------------
%Notes:
% /club glyphshow works, so just find a modern font which has all the glyphs I need :D
......@@ -42,16 +96,11 @@ Fin
% widthshow : Float Float Char String -> 1 (adjust spacing of Char in String by xy)
% awidthshow : Float Float Char Float Float String -> 1 ashow and widthshow
% cshow : proc string -> 1 puts spacing and charactercode on stack, then executes proc for each char in string ;) combine this with glyphsho
% kshow : proc string -> 1 : shows first char, then pushes char-code,and next char-code, onto stack, execs proc :D this solves everything
% kshow, xshow, yshow, xyshow,awidthshow, and glyphshow.
% search
{pop pop currentpoint exch 500 gt
{10 exch 50 sub moveto} {pop} ifelse }
(Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aliquam mollis elit ut rutrum mollis.
In id dapibus dolor.
Praesent nunc mi, semper ut ante vel,
laoreet ultrices felis.
Nunc accumsan leo vel condimentum consequat.
Suspendisse eu nisi id nisi varius vulputate.)
kshow
% kshow : proc string -> 1 | shows first char, then pushes char-code,and next char-code, onto stack, execs proc :D this solves everything
% xshow : numarray string -> 1 | offset each char by value in numarray (xy show, y show simmilar)
% yshow, xyshow
% glyphshow.
% string 2bfound be4 match after PS error handling
% search : string string -> string string string true?
% token | parse postscript token?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment