forked from Ejhfast/ejhfast.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
88 lines (85 loc) · 2.67 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
layout: default
title: Home
---
<div id='top_nav'>
<div class='title'>
<a href="http://github.com/Proxino/TypedJS"><div id='cloud'>
<button>Get the Code</button>
</div></a>
<h1>
Sanity Check your JavaScript.
</h1>
<span>
Harness the power of type annotations and program specifications to make your code robust. It's easy to get started.
</span>
</div>
</div>
<div id='content'>
<div class='sec'>
<h1>
<span class='num'>1.</span>
Annotate your functions with type signatures.
</h1>
<div class='half'>
<img src='/resources/ex1.png'/>
</div>
<div class='half'>
<img src='/resources/ex2.png'/>
</div>
<div class='clear'></div>
<div class='half'>
<h1>add_all :: [Number] -> Number</h1>
<p>
The function
<em>add_all</em>
sums a list of numbers. It takes one argument (a list of type Number) and
returns a single Number.
</p>
</div>
<div class='half'>
<h1>my_prop :: {name:String, valid:Boolean} -> Boolean</h1>
<p>
The function
<em>my_prop</em>
takes an object with two fields, name (a String) and valid (a Boolean),
and it returns a Boolean which depends on the state of valid.
</p>
</div>
<div class='clear'></div>
</div>
<div class='sec'>
<h1>
<span class='num'>2.</span>
<span='prox'>TYPED<span class="red">JS</span></span>
tests the annotated functions automatically.
</h1>
<div class='full'>
<img src='/resources/ex_out.png'/>
</div>
<div class='clear'></div>
<div class='full'>
<h1>Why not give it a try in this window?</h1>
<p> Open your console and type: <strong>TypedJS.run_tests()</strong></p>
</div>
<div class='clear'></div>
</div>
<div class='sec'>
<h1>
<span class='num'>3.</span>
Find some bugs (but probably not all of them)
</h1>
<div class='full'>
<h1>Type signatures specify program correctness</h1>
<p>
<span='prox'>TYPED<span class="red">JS</span></span>
uses a function's type signature to generate input parameters, and evaluates the function upon these inputs to form a test case. This test case fails if an exception occurs, or the output violates function constraints. While type signatures provide
<em>a limited form</em>
of program specification,
<span='prox'>TYPED<span class="red">JS</span></span>
adds a quick and rigorous sanity check to your deployment pipeline. The code lives on <a href="http://github.com/Proxino/TypedJS">github</a>.
</p>
</div>
<div class='clear'></div>
</div>
</div>