diff options
author | Camil Staps | 2017-10-25 22:52:48 +0200 |
---|---|---|
committer | Camil Staps | 2017-10-25 22:52:48 +0200 |
commit | 6963a82cd1264f2b1c8e4821a0744ffb30e3babc (patch) | |
tree | dcdf10b5675bd16cab33c460601c46166f86caac |
Introduction, history, architecture
-rw-r--r-- | .gitignore | 37 | ||||
-rw-r--r-- | beamercolorthemecloogle.sty | 33 | ||||
-rw-r--r-- | cloogle.tex | 161 |
3 files changed, 231 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8b3892a --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +*-blx.bib +*.acn +*.acr +*.alg +*.aux +*.bbl +*.bcf +*.blg +*.dvi +*.ent +*.fdb_latexmk +*.fls +*.fmt +*.glg +*.glo +*.gls +*.idx +*.ilg +*.ind +*.ist +*.lof +*.log +*.lot +*.maf +*.mtc +*.mtc1 +*.nav +*.out +*.pdf +*.run.xml +*.snm +*.swp +*.synctex.gz +*.toc +*.vrb +_minted-*/ +*-tags.tex diff --git a/beamercolorthemecloogle.sty b/beamercolorthemecloogle.sty new file mode 100644 index 0000000..1bdac31 --- /dev/null +++ b/beamercolorthemecloogle.sty @@ -0,0 +1,33 @@ +\mode<presentation> + +\definecolor{darkred}{rgb}{0.8,0,0} +\definecolor{clooglemain}{HTML}{87aade} +\definecolor{cloogledarkest}{HTML}{373e48} +\definecolor{cloogledark}{HTML}{535d6c} +\definecolor{clooglelight}{HTML}{d7e3f4} +%\definecolor{clooglelightest}{HTML}{dbdee3} +\colorlet{clooglelightest}{clooglelight!50!white} + +\setbeamercolor{normal text}{fg=cloogledarkest,bg=white} +\setbeamercolor{section in toc}{parent=normal text} +\setbeamercolor*{structure}{parent=normal text} + +\setbeamercolor*{palette secondary}{fg=cloogledark,bg=clooglelight} +\setbeamercolor*{palette tertiary}{bg=clooglemain,fg=gray!5!white} + +\setbeamercolor*{sidebar}{fg=darkred,bg=gray!15!white} + +\setbeamercolor*{palette sidebar primary}{fg=darkred!10!black} +\setbeamercolor*{palette sidebar secondary}{fg=white} +\setbeamercolor*{palette sidebar tertiary}{fg=darkred!50!black} +\setbeamercolor*{palette sidebar quaternary}{fg=gray!10!white} + +\setbeamercolor{titlelike}{parent=palette primary} +\setbeamercolor{frametitle}{bg=clooglelightest} +\setbeamercolor{frametitle right}{bg=gray!60!white} + +\setbeamercolor*{separation line}{} +\setbeamercolor*{fine separation line}{} + +\mode +<all> diff --git a/cloogle.tex b/cloogle.tex new file mode 100644 index 0000000..7d5023d --- /dev/null +++ b/cloogle.tex @@ -0,0 +1,161 @@ +\documentclass{beamer} + +\title{Cloogle} +\subtitle{A programming language search engine and its applications} +\author{Camil Staps} +\date{January 5\textsuperscript{th}, 2018} + +\usetheme{Szeged} +\usecolortheme{cloogle} + +\usepackage[british]{babel} +\usepackage{csquotes} + +\usepackage{tikz} +\usetikzlibrary{calc,positioning} +\newcommand{\module}[2]{#2\\[-4pt]\color{gray}{\tiny(#1)}} +\tikzstyle{block}=[rectangle,align=center] +\tikzset{ + doc/.pic={ + \coordinate (-east) at (0.309,0); + \coordinate (-south) at (0,-0.4); + \draw[pic actions] (-0.309,-0.4) -- ++(0,0.8) -- ++(0.518,0) -- ++(0,-0.1) -- ++(0.1,0) -- ++(0,-0.7) -- cycle; + \draw[pic actions] (0.209,0.4) -- ++(0.1,-0.1); + \draw[pic actions] (-0.209,-0.1) -- ++(0.418,0); + \draw[pic actions] (-0.209, 0) -- ++(0.418,0); + \draw[pic actions] (-0.209, 0.1) -- ++(0.418,0); + }, + db/.pic={ + % https://tex.stackexchange.com/a/397862/23992 + \coordinate (-west) at (-0.3,0); + \coordinate (-east) at ( 0.3,0); + \coordinate (-south) at (0,-0.42); + \foreach \y in {-0.33,-0.1,0.13} { + \draw[fill=white] (-0.3,\y) to [looseness=0.5,bend right=90] ++(0.6,0) + -- ++(0,0.2) to [looseness=0.5,bend left=90] ++(-0.6,0) + -- ++(0,-0.2); + \draw (-0.3,\y+0.2) edge[looseness=0.5,bend left=90] ++(0.6,0); + } + } +} + +\usepackage{minted} +\setminted{fontsize=\small} + +\begin{document} + +\maketitle + +\section{Background} +\begin{frame}[fragile]{Background} + What is wrong with this code? + + \begin{minted}[gobble=2]{clean} + incAll :: [Int] -> [Int] + incAll [] = [] + incAll [x:xs] = [x+1:incAll xs] + + sortByKey :: [(a,b)] -> [(a,b)] | < a + sortByKey [] = [] + sortByKey [(k,v):xs] = sortByKey ls ++ [(k,v):sortByKey hs] + where (ls,hs) = partition (\(k`,_) -> k > k`) xs + \end{minted} + + \pause + Better: + \begin{minted}[gobble=2]{clean} + incAll :== map ((+) 1) + sortByKey :== sortBy (on (<) fst) + \end{minted} +\end{frame} +\begin{frame}{Background} + Lack of abstraction due to... + + \begin{itemize} + \item Poor conceptualisation of the programmer? + \item Poor knowledge of the standard libraries? + \begin{itemize} + \item \enquote{There is this function \texttt{map}, but where is it defined?} + \end{itemize} + \end{itemize} + + Solution: build a search engine! +\end{frame} +\begin{frame}{History} + \begin{itemize} + \item February 2016: PHP regex search + \pause + \item April: function type search; moved to Clean + \pause + \item June: type definition search; included classes and generics + \pause + \item August: included macros + \pause + \item October: moved to Docker containers; caching + \pause + \item November: unify with type synonyms + \end{itemize} +\end{frame} +\begin{frame}{Architecture} + \centering + \footnotesize + \def\tikzsource{% + \pic (src) at (-5,3) {doc}; + } + \def\tikzbuilddb{% + \node (cocl) at (-2.5, 3.5 ) {\module{Clean}{Clean compiler}}; + \node (ppr) at (-2.5, 2.5 ) {\module{Clean}{Pretty printer}}; + \pic (db) at ( 0, 2.98) {db}; + \node[right=5pt of db-east,draw=none] {\module{\tiny JSON}{\scriptsize Database}}; + \draw[->] ($(src-east)+(0,0.18)$) -- (cocl.west); + \draw[->] ($(src-east)-(0,0.18)$) -- (ppr.west); + \draw[->] (cocl.east) -- ($(db-west)+(0,0.18)$); + \draw[->] (ppr.east) -- ($(db-west)-(0,0.18)$); + } + \def\tikzbackend{% + \node (web) at (0, 1) {\module{Clean, PHP, JS}{\textbf{cloogle.org}}}; + \node (uni) at (2, 2) {\module{Clean}{Type unifier}}; + \draw (uni) -- (web); + \draw[->] (db-south) -- (web); + } + \def\tikzfrontend{% + \node (hljs) at (-2, 0.5) {\module{JS}{clean.js}}; + \draw (hljs) -- (web); + } + \def\tikzfrontendsrc{% + \node (pygm) at (-2.25, 1.5) {\module{Python}{pygments}}; + \draw[->] (src-south) -- (pygm); + \draw (pygm) -- (web); + } + \def\tikzstats{% + \node (stats) at (3, 1) {\module{Bash, JS, PHP, SQL}{Log \& Statistics}}; + \draw (web) -- (stats); + } + \def\tikzclientA{% + \node (cli) at (-2,-2) {\module{Python}{CLI app}}; + \draw[->] (web) -- (cli); + } + \def\tikzclientB{% + \node (tgm) at (0,-2) {\module{Python}{Telegram bot}}; % TODO more frontends? + \draw[->] (web) -- (tgm); + } + \def\tikzclientC{% + \node (vim) at (2,-2) {\module{Vim}{vim-clean}}; + \draw[->] (web) -- (vim); + } + \begin{tikzpicture}[every node/.style={draw,block}] + \useasboundingbox (-5,-4) rectangle (5,4); + \only<1->\tikzsource + \only<1-4>{\node[below=5pt of src-south,draw=none] {\scriptsize Source code};} + \only<2->{\tikzbuilddb} + \only<3->{\tikzbackend} + \only<4->{\tikzfrontend} + \only<5->{\tikzfrontendsrc} + \only<6->{\tikzstats} + \only<7->{\tikzclientA} + \only<8->{\tikzclientB} + \only<9->{\tikzclientC} + \end{tikzpicture} +\end{frame} + +\end{document} |