-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
369 lines (341 loc) · 15.2 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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<!doctype html>
<html>
<head>
<title>HashLink - Haxe Virtual Machine</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro" />
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.css" />
<link rel="stylesheet" href="https://haxe.org/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://haxe.org/css/haxe-nav.css" />
<link rel="stylesheet" href="styles.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="HashLink is a virtual machine for Haxe, created and supported by Haxe Foundation." />
<!-- Twitter Card data -->
<meta name="twitter:creator" content="@haxe_org"/>
<meta name="twitter:image" content="https://hashlink.haxe.org/share.png">
<meta name="twitter:card" content="summary_large_image">
<!-- Open Graph data -->
<meta property="og:title" content="HashLink - Haxe Virtual Machine" />
<meta property="og:description" content="HashLink is a virtual machine for Haxe, created and supported by Haxe Foundation." />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://hashlink.haxe.org/" />
<meta property="og:image" content="https://hashlink.haxe.org/share.png" />
<meta property="article:publisher" content="haxe.org" />
<meta property="article:section" content="technology" />
<link rel="icon" type="image/png" href="favicon.png" />
</head>
<body>
<nav class="nav dark">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<button class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse" type="button"><span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></button> <a class="brand haxe-logo" href="https://haxe.org/"><img alt="Haxe" height="21" onerror="this.src='https://haxe.org/img/haxe-logo-horizontal-on-dark.png'" src="https://haxe.org/img/haxe-logo-horizontal-on-dark.svg" width="107" /></a>
<a class="brand sub ide" href="./">HL</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">About <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="#compile">Compile & Run</a>
</li>
<li>
<a href="#dual-compilation">Dual compilation</a>
</li>
<li>
<a href="#features">Features</a>
</li>
<li>
<a href="#libraries">Libraries</a>
</li>
<li>
<a href="#performance">Performance</a>
</li>
</ul>
</li>
<li>
<a href="#download">Download</a>
</li>
<li>
<a href="#documentation">Documentation</a>
</li>
<li>
<a href="#case-study">Case study</a>
</li>
<!-- required submenu on every subsite -->
<li class="divider"></li>
<!-- required submenu on every subsite, put class="active" on -->
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="https://haxe.org/documentation/">Learn Haxe <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="https://haxe.org/documentation/introduction/" rel="external">Introduction</a>
</li>
<li>
<a href="https://haxe.org/manual/" rel="external">Manual</a>
</li>
<li>
<a href="https://code.haxe.org" rel="external">Code Cookbook</a>
</li>
<li>
<a href="https://api.haxe.org" rel="external">API Documentation</a>
</li>
<li class="divider"></li>
<li>
<a href="https://haxe.org/videos/" rel="external">Videos</a>
</li>
<li class="divider"></li>
<li>
<a href="https://try.haxe.org" rel="external">Try Haxe online</a>
</li>
<li>
<a href="https://lib.haxe.org" rel="external">Haxelib</a>
</li>
</ul>
</li>
<li class=" dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Connect <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/HaxeFoundation" rel="external"><i class="fa fa-github"></i> Github</a></li>
<li><a href="https://github.com/HaxeFoundation/haxe/issues" rel="external"><i class="fa fa-github"></i> Bug reports</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/haxe" rel="external"><i class="fa fa-stack-overflow"></i> Stack Overflow</a></li>
<li><a href="http://community.haxe.org/" rel="external"><i class="fa fa-envelope-o"></i> Forums</a></li>
<li><a href="https://discordapp.com/invite/0uEuWH3spjck73Lo" rel="external nofollow"><i class="fa fa-comments-o"></i> Discord</a></li>
<li><a href="https://gitter.im/HaxeFoundation/haxe" rel="external nofollow"><i class="fa fa-comments-o"></i> Gitter</a></li>
<li><a href="https://haxe.org/blog"><i class="fa fa-rss"></i> Blog</a></li>
<li class="divider"></li>
<li><a href="https://www.facebook.com/haxe.org/" rel="external"><i class="fa fa-facebook"></i> Facebook</a></li>
<li><a href="https://twitter.com/search?q=%23haxe" rel="external"><i class="fa fa-twitter"></i> #haxe</a></li>
<li><a href="https://twitter.com/haxelang" rel="external"><i class="fa fa-twitter"></i> @haxelang</a></li>
<li><a href="https://twitter.com/haxe_org" rel="external"><i class="fa fa-twitter"></i> @haxe_org</a></li>
<li class="divider"></li>
<li><a href="https://haxe.org/foundation/contact.html" rel="external">Contact</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</nav>
<div class="section intro">
<div class="container">
<div class="flex-row">
<div class="flex-col-1">
<img src="hashlink.svg" width="100%" style="filter: drop-shadow(0 0 150px rgba(150, 255, 255, .75));"/>
</div>
<div class="flex-col-2">
<h1>HashLink</h1>
<p class="lead">HashLink is a virtual machine for <a href="https://haxe.org">Haxe</a></p>
</div>
</div>
</div>
</div>
<a name="compile"></a>
<div class="section dark">
<div class="container">
<div class="row">
<div class="span6">
<h2>Compile</h2>
<p>
HashLink bytecode can be produced by using Haxe compiler <small>(requires <a href="https://haxe.org/download">Haxe 3.4+</a>)</small>
</p>
<p class="code">
haxe -hl output.hl -main MyApp
</p>
</div>
<div class="span6">
<h2>Run</h2>
<p>
HashLink bytecode can be run using HL/JIT virtual machine.<br/><br/>
</p>
<p class="code">
hl output.hl
</p>
</div>
</div>
</div>
</div>
<a name="dual-compilation"></a>
<div class="section">
<div class="container">
<h2>Dual compilation</h2>
<p>HashLink bytecode can be either run through HL/JIT virtual machine or converted to C with HL/C:</p>
<p class="code">
haxe -hl out/main.c -main MyApp<br/>
gcc -O3 -o myapp -std=c11 -I out out/main.c -lhl [-L/path/to/required/hdll]
</p>
<ul>
<li>Use HL/JIT for daily development (fast compilation time)</li>
<li>Use HL/C for final release (best performance)</li>
<li>HL/C and HL/JIT share same runtime and semantics</li>
</ul>
</div>
</div>
<a name="features"></a>
<div class="section light">
<div class="container">
<h2>Features</h2>
<p>HashLink runtime includes the following features:</p>
<ul>
<li>Fully compatible with Haxe specification</li>
<li>Support file I/O, regular expressions, network, etc.</li>
<li>Unicode strings by default</li>
<li>Mark-and-not-sweep Garbage Collector</li>
<li>x86 and x86-64 HL/C compilation</li>
<li>x86 and x86-64 HL/JIT compilation</li>
</ul>
</div>
</div>
<a name="libraries"></a>
<div class="section">
<div class="container">
<h2><i class="fa fa-big fa-battery-full"></i> Libraries</h2>
<p class="block">
While the standard <abbr title="HashLink">HL</abbr> runtime provides support for <a href="https://haxe.org/documentation/introduction/stdlib-introduction.html">Haxe standard library</a>, HashLink also provides several libraries that can optionally be used to build HL-specific applications.
</p>
<div class="row">
<div class="span4">
<h3>FMT Library</h3>
<p>Provide binary format support:</p>
<ul>
<li>Inflate/deflate ZLIB compression</li>
<li>JPG decoding</li>
<li>Image scaling/resampling</li>
<li>... more to come</li>
</ul>
</div>
<div class="span4">
<h3>UI Library</h3>
<p>Provide OS UI operations:</p>
<ul>
<li>Message/alert box</li>
<li>Scrollable text log with custom buttons</li>
<li>Async timer</li>
<li>(only supported on Windows for now)</li>
</ul>
</div>
<div class="span4">
<h3>SDL Library</h3>
<p>Support for the popular <a href="https://www.libsdl.org/">SDL</a> framework:</p>
<ul>
<li>Window creation</li>
<li>Mouse and keyboard events</li>
<li>Full OpenGL 3.2+ API</li>
<li>Game controllers</li>
<li>Native cursors</li>
</ul>
</div>
</div>
</div>
</div>
<a name="performance"></a>
<div class="section light">
<div class="container">
<h2><i class="fa fa-big fa-rocket"></i> Performance</h2>
<p>HashLink uses advanced optimizations to increase Haxe performance:</p>
<ul>
<li>HL bytecode is strictly typed</li>
<li>Fast anonymous objects access using typed "virtuals"</li>
<li>Static dispatch of object methods when no override exists</li>
<li>Compact memory representation for all values</li>
<li>Inference to reduce null field access checks to the minimum (soon)</li>
<li>Low level access for pointers, single float, 8 and 16 bits integers</li>
</ul>
<p class="block">
Initial benchmark shows that HL/JIT outperforms Adobe AIR and Node/V8 in many cases.
Many room for performance improvement exists in HL/JIT to bring it as much near as HL/C as possible.
</p>
</div>
</div>
<a name="download"></a>
<div class="section">
<div class="container">
<h2><i class="fa fa-big fa-download"></i> Download</h2>
<p>HashLink can be obtained using one of the following:</p>
<ul class="downloads row">
<li class="span4"><a href="https://github.com/HaxeFoundation/hashlink/releases" class="icon-link"><i class="fa fa-arrow-circle-o-down"></i></a>Download <a href="https://github.com/HaxeFoundation/hashlink/releases">latest binary release</a><br>(Windows / Linux)</li>
<li class="span4"><a href="https://github.com/HaxeFoundation/hashlink/" class="icon-link"><i class="fa fa-github"></i></a> <a href="https://github.com/HaxeFoundation/hashlink/">GitHub repository</a><br>for HL runtime and JIT VM</li>
<li class="span4"><a href="https://haxe.org/download" class="icon-link"><span class="logo"><img alt="Haxe logo" src="https://haxe.org/img/haxe-logo.svg" height="40" width="40" /></span></a>Compiling to HL requires <a href="https://haxe.org/download">Haxe 3.4+</a></li>
</ul>
</div>
</div>
<a name="documentation"></a>
<div class="section light">
<div class="container">
<h2>Documentation</h2>
<p> HashLink documentation can be accessed using:</p>
<ul>
<li><a href="https://haxe.org/manual/target-hl-getting-started.html">Getting started with Haxe/HashLink</a></li>
<li><a href="https://haxe.org/manual/target-hl-c-compilation.html">HashLink/C Compilation</a></li>
<li><a href="https://api.haxe.org/hl/">API Documentation</a></li>
<li><a href="https://github.com/HaxeFoundation/hashlink/wiki">HashLink Wiki</a></li>
<li>HashLink In Depth article series on Haxe blog:<br/>
<ul>
<li><a href="https://haxe.org/blog/hashlink-indepth/">Part 1</a></li>
<li><a href="https://haxe.org/blog/hashlink-in-depth-p2/">Part 2</a></li>
</ul>
</li>
</ul>
</div>
</div>
<a name="case-study"></a>
<div class="section">
<div class="container">
<h2>Case Study: Northgard</h2>
<p>
<a href="http://northgard.net">Northgard</a> is a 3D game created by <a href="https://shirogames.com/">ShiroGames</a>.
</p>
<div class="row">
<div class="span6">
<img alt="Northgard screenshot" src="northgard.jpg" class="screen"/>
</div>
<div class="span6">
<p>
Initially developed in Haxe with Adobe AIR, it now runs with HL and HLSDL library with the same performance.
</p>
<ul>
<li>The code consists in ~1200 classes containing ~11000 methods.</li>
<li>Timing has been measured on a low end Intel Q6600 @2.4 Ghz</li>
<li>Whole project recompilation takes 18.2 seconds</li>
<li>Recompilation with no change takes 2.4 seconds (using <a href="https://haxe.org/manual/cr-completion-server.html">compilation server</a>)</li>
<li>Recompilation with partial changes takes 5.8 seconds</li>
<li>Memory usage has been reduced from 900MB to 700MB</li>
<li>Northgard is built using the open-source <a href="https://heaps.io/">Heaps.io</a> game engine</li>
<li>Northgard is available on Steam for <a href="https://store.steampowered.com/app/1223060/Northgard__Himminbrjotir_Clan_of_the_Ox/" "Northgard for desktop">PC, Mac OS X and Linux</a> but also on consoles <a href="https://www.amazon.fr/Merge-Games-Northgard/dp/B07SZ6SYMY" title="Northgard for consoles">Nintendo Switch, PS4 and Xbox One</a></li>
</ul>
</div>
</div>
</div>
</div>
<div style="background:#f5f5f5; padding: 1.33em">
<center><i class="fa fa-edit"></i> <a href="https://github.com/HaxeFoundation/hashlink.haxe.org/">Edit this page</<a>
</div>
<footer class="section dark">
<div class="container">
<h2><i class="fa fa-big fa-globe"></i> Open Source <span class="github-button-container"><a class="github-button" href="https://github.com/HaxeFoundation/hashlink" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star HaxeFoundation/hashlink on GitHub">Star</a></span></h2>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<img src="hashlink.svg" width="180" style="float:left; filter: grayscale(100%) brightness(65%) drop-shadow(0 0 100px darkgray); opacity: 0.75;"/>
<p>HashLink is open source, available under the <a href="https://github.com/HaxeFoundation/hashlink/blob/master/LICENSE">MIT License</a>.<br/>It is created and supported by <a href="https://haxe.org/foundation">Haxe Foundation</a></p>
<p><small><i>Thanks to the following libraries: LibTurboJPEG, LibPCRE, SDL, ZLIB.</i></small></p>
<hr/>
Spread the word:
<!-- Twitter button code -->
<a href="https://twitter.com/share?ref_src=twsrc%5Etfw" class="twitter-share-button" data-show-count="true">Tweet</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root" style="display:inline-block"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- FB like button code -->
<div class="fb-like" data-href="https://hashlink.haxe.org/" style="display:inline-block;position:relative; top:-6px" data-layout="button_count" data-action="like" data-show-faces="true"></div>
</div>
</footer>
<script src="https://haxe.org/js/jquery.min.js"></script>
<script src="https://haxe.org/js/bootstrap.min.js"></script>
</body>
</html>