forked from pypyjs/pypyjs.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
103 lines (89 loc) · 4.48 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PyPy.js</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700,400italic' rel='stylesheet' type='text/css'>
<link href='https://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css' rel='stylesheet' type='text/css'>
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css' rel='stylesheet' type='text/css'>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
<link href='css/ansi.css' rel='stylesheet' type='text/css'>
<link href='css/console.css' rel='stylesheet' type='text/css'>
<link href='css/pypyjs.css' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="/" class="navbar-brand">PyPy.js</a>
</div>
<div class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="index.html">Overview</a></li>
<li><a href="editor.html">Editor</a></li>
<li><a href="https://github.com/pypyjs/pypyjs/releases/">Download</a></li>
<li><a href="https://github.com/pypyjs/pypyjs">Source</a></li>
<li><a href="http://github.com/pypyjs/pypyjs/issues">Bugs</a></li>
<li><a href="http://arewepythonyet.com/">Benchmarks</a></li>
</ul>
</div>
</div>
</div>
<div class='container'>
<p>PyPy.js is an experiment in building a fast and compliant python environment for the web.</p>
<p>It uses the <a href="http://pypy.org/">PyPy</a> python interpreter, compiled for the web via <a href="http://emscripten.org">emscripten</a>, with a custom JIT backend that emits <a href="http://asmjs.org">asm.js</a> code at runtime.</p>
<p>Try it out below, or see the links above for benchmarks and download information.</p>
<p> </p>
<noscript><h3>Please enable JavaScript for using PyPy.js</h3></noscript>
<div id="console"></div>
<p> </p>
</div>
<script src="pypyjs-release/lib/Promise.min.js" type="text/javascript" charset="utf-8"></script>
<script src="pypyjs-release/lib/FunctionPromise.js" type="text/javascript" charset="utf-8"></script>
<script src="pypyjs-release/lib/pypyjs.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery-migrate-1.2.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jqconsole.min.js" type="text/javascript" charset="utf-8"></script>
<script>
$(function () {
// Global var, for easy debugging in console.
window.jqconsole = $('#console').jqconsole('', '>>> ');
// Send all VM output to the console.
pypyjs.stdout = pypyjs.stderr = function(data) {
jqconsole.Write(data, 'jqconsole-output');
}
// Display a helpful message and twiddle thumbs as it loads.
pypyjs.stdout("Loading PyPy.js.\n\n");
pypyjs.stdout('It\'s big, so this might take a while...');
var pseudo_status = setInterval(function(){ pypyjs.stdout("."); }, 500);
pypyjs.ready().then(function() {
clearInterval(pseudo_status);
jqconsole.Reset();
pypyjs.stdout('Welcome to PyPy.js!\n')
// REPL forever via jqconsole prompt.
return pypyjs.repl(function(ps1) {
jqconsole.SetPromptLabel(ps1);
return new Promise(function(resolve, reject) {
jqconsole.Prompt(true, function (input) {
resolve(input);
});
});
});
}).then(null, function(err) {
//jqconsole.Reset();
jqconsole.Write('ERROR: ' + err);
});
});
</script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js'></script>
</body>
</html>