-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.pug
180 lines (173 loc) · 6.6 KB
/
index.pug
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
//output:index.html
doctype html
html
head
meta(charset='utf8')
link(rel='shortcut icon' href='favicon.png' type='image/png')
link(rel='apple-touch-icon' href='favicon.png')
meta(http-equiv='X-UA-Compatible' content='IE=edge')
meta(name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no")
meta(name='description' content="Easy, functional, lazy.")
meta(name='keywords' content='wonder programming, wonder programming language, wonder, programming, language, wonderlang, programming language')
link(rel='canonical' href='https://wonderlang.github.io')
meta(property='og:site_name' content='The Wonder Programming Language')
meta(property='og:title' content='The Wonder Programming Language')
meta(property='og:description' content="Easy, functional, lazy.")
meta(property='og:image' content='favicon.png')
meta(property='og:url' content="http://smhacks.com")
meta(name="google-site-verification" content="0Mo5H2Zw64z_lvWDZ8ycBtJBoyr8jxIsbuVkGFGYtkQ")
title The Wonder Programming Language
link(rel='stylesheet' href='bootstrap.css')
link(rel='stylesheet' href='prism.css')
link(rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css')
script(src='https://code.jquery.com/jquery-3.1.1.min.js')
script(src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js')
script(src='prism.js')
script(src='highlighter.js')
style.
html,body{
font-size:105%;
}
#head{
text-align:center;
display:table;
position:fixed;
height:100%;
width:100%;
top:0;
left:0;
}
#head .container{
display:table-cell;
vertical-align:middle;
}
#logo{
max-width:50%;
height:auto;
}
#tail{
background-color:#fff;
display:table;
position:absolute;
width:100%;
top:100%;
left:0;
}
.c{
height:100%;
border:none;
border-radius:0;
}
script.
$('html').css('display','none')
$(function(){
scrollTo(0,0)
Prism.highlightAll()
$('html').delay(200).fadeIn(500)
$('a[href^="#"]').click(function(e){
e.preventDefault()
$(this).blur()
$('html,body').animate({
scrollTop:$($(this).attr('href')).offset().top
},500)
})
$(window).scroll(function(){
pc=1-($('html').scrollTop()||$('body').scrollTop())/$(window).height()
pc<0||($('#head').css({
transform:'scale('+pc+','+pc+') translateY('+-($('html').scrollTop()||$('body').scrollTop())+'px)',
opacity:pc
}),$('#tail').css({
opacity:1-pc+.3
}))
})
})
body
#head: .container
.row: .col-sm-12
img#logo(src='wonder.png')
h2 Easy - Functional - Lazy
br
h3: code npm install -g wonderlang
br
a.fa.fa-angle-down.fa-5x.text-danger#headc(href='#tail')
#tail
.container
.row
.col-md-6
pre.c: code.language-wr.line-numbers.
#. SUPER-SIMPLE CHATBOT
#. Output then input
loop \ x\\(
oN ++ "< " #x;
rl ()
);
#. Get name and greet
name \ loop "What is your name?";
reply \ loop join "" [
"Hello, "
rstr [`\n`g ""] #name
". I'll copy you from now on."
];
#. Keep copying input
while [1 loop] reply
.col-md-6
h1.text-success: u Easy
p.
Everything is simple, from installation to programming to package management.
This is by design!
<b>Wonder</b> is for those who want a no-frills coding process.
hr
br
.row
.col-md-6
h1.text-warning: u Functional
p.
<b>Wonder</b> is a functional programming language; most notably, it implements <a href='https://en.wikipedia.org/wiki/De_Bruijn_index' target='_blank'>de Bruijn indices</a> directly in the syntax.
Add in other sugary features such as currying, prefix notation, and dynamic typing and you've got yourself one helluva language.
Not to mention, the syntax is super-flexible, too — readability freak or code-golf maniac, <b>Wonder</b> can adapt to your style.
.col-md-6
pre.c: code.language-wr.line-numbers.
#. The following snippets are several ways
#. of outputting the ASCII characters.
#. (one snippet per line)
fc rng 0 127 #. average joe
join "" map #fc tk 127 gen I #. total overkill
(fc (rng 0 127)) #. lisp junkie
#. Fibonacci sequence with memoization
f\ 0\\0;
f\ 1\\1;
f\\\ x\\(
f\#x\\#y;
#y
) y\ (+ f - #x 1) f - #x 2;
oN map #f rng 1 50
hr
br
.row
.col-md-6
pre.c: code.language-wr.line-numbers.
#. Lambda bodies do not evaluate unless applied.
@+1 1; #. does not become @2 yet
#. Conditionals evaluate one expression
#. or the other, but not both.
(
rl()
? "there is input"
? "no input"
)
#. Infinite list operations!
(map *2) rng 0 oo;
.col-md-6
h1.text-info: u Lazy
p.
<b>Wonder</b> only evaluates when absolutely necessary; this allows us to have infinite lists and other nice goodies.
But <b>Wonder</b> is also built for lazy programmers. Shorter function names, less need for parentheses/punctuation, and the ability to leave out trailing quotes and brackets?
<b>Wonder</b> has it all.
hr
br
.text-center
h1.text-danger What are you waiting for?
h3: b <a href="https://github.com/wonderlang" target="_blank">Github</a> - <a href="https://github.com/wonderlang/wonder/wiki" target="_blank">Docs</a> - <a href="https://npmjs.org/package/wonderlang" target="_blank">NPM</a> - <a href="https://github.com/wonderlang/wonder/projects" target="_blank">Todo's</a>
br
br
br