Skip to content

Commit 072a388

Browse files
committed
Merge branch 'master' into export_star
1 parent c36afd4 commit 072a388

291 files changed

Lines changed: 76747 additions & 53557 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
bin/* text eol=lf
22
dist/* binary
33
scripts/*.sh eol=lf
4+
lib/binaryen.js binary

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
=================
33

44
[![Build Status](https://travis-ci.org/AssemblyScript/assemblyscript.svg?branch=master)](https://travis-ci.org/AssemblyScript/assemblyscript)
5+
[![Backers on Open Collective](https://opencollective.com/assemblyscript/backers/badge.svg)](#backers)
6+
[![Sponsors on Open Collective](https://opencollective.com/assemblyscript/sponsors/badge.svg)](#sponsors)
57

68
**AssemblyScript** compiles strictly typed [TypeScript](http://www.typescriptlang.org) (basically JavaScript with types) to [WebAssembly](http://webassembly.org) using [Binaryen](https://github.com/WebAssembly/binaryen). It generates lean and mean WebAssembly modules while being just an `npm install` away.
79

@@ -105,3 +107,45 @@ Running everything in order (lint, clean, test, build, test):
105107
```
106108
$> npm run all
107109
```
110+
111+
Contributing
112+
------------
113+
114+
This project exists thanks to all the people who [contribute](CONTRIBUTING.md).
115+
116+
<a href="https://github.com/AssemblyScript/assemblyscript/graphs/contributors"><img src="https://opencollective.com/assemblyscript/contributors.svg?width=890&button=false" /></a>
117+
118+
Sponsoring
119+
----------
120+
121+
The core team members and most contributors do this open source work in their free time. If you use AssemblyScript for a serious task or plan to do so, and you'd like us to invest more time on it, [please donate](https://opencollective.com/assemblyscript).
122+
123+
This is how we use the donations:
124+
125+
* Allow the core team to work on AssemblyScript
126+
* Thank contributors if they invested a large amount of time in contributing
127+
* Support projects in the ecosystem that are of great value for us or users
128+
* Fees for money handling
129+
130+
### Sponsors
131+
132+
[Become a sponsor](https://opencollective.com/assemblyscript#sponsor) and get your logo on our README on Github with a link to your site.
133+
134+
<a href="https://opencollective.com/assemblyscript/sponsor/0/website" target="_blank"><img src="https://opencollective.com/assemblyscript/sponsor/0/avatar.svg"></a>
135+
<a href="https://opencollective.com/assemblyscript/sponsor/1/website" target="_blank"><img src="https://opencollective.com/assemblyscript/sponsor/1/avatar.svg"></a>
136+
<a href="https://opencollective.com/assemblyscript/sponsor/2/website" target="_blank"><img src="https://opencollective.com/assemblyscript/sponsor/2/avatar.svg"></a>
137+
<a href="https://opencollective.com/assemblyscript/sponsor/3/website" target="_blank"><img src="https://opencollective.com/assemblyscript/sponsor/3/avatar.svg"></a>
138+
<a href="https://opencollective.com/assemblyscript/sponsor/4/website" target="_blank"><img src="https://opencollective.com/assemblyscript/sponsor/4/avatar.svg"></a>
139+
<a href="https://opencollective.com/assemblyscript/sponsor/5/website" target="_blank"><img src="https://opencollective.com/assemblyscript/sponsor/5/avatar.svg"></a>
140+
<a href="https://opencollective.com/assemblyscript/sponsor/6/website" target="_blank"><img src="https://opencollective.com/assemblyscript/sponsor/6/avatar.svg"></a>
141+
<a href="https://opencollective.com/assemblyscript/sponsor/7/website" target="_blank"><img src="https://opencollective.com/assemblyscript/sponsor/7/avatar.svg"></a>
142+
<a href="https://opencollective.com/assemblyscript/sponsor/8/website" target="_blank"><img src="https://opencollective.com/assemblyscript/sponsor/8/avatar.svg"></a>
143+
<a href="https://opencollective.com/assemblyscript/sponsor/9/website" target="_blank"><img src="https://opencollective.com/assemblyscript/sponsor/9/avatar.svg"></a>
144+
145+
### Backers
146+
147+
[Become a backer](https://opencollective.com/assemblyscript#backer) and get your image on our README on Github with a link to your site.
148+
149+
<a href="https://opencollective.com/assemblyscript#backers" target="_blank"><img src="https://opencollective.com/assemblyscript/backers.svg?width=890"></a>
150+
151+
Thank you for your support!

dist/asc.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/asc.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
33 Bytes
Binary file not shown.

examples/game-of-life/build/optimized.wat

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
(type $F (func (result f64)))
44
(type $v (func))
55
(type $iiFv (func (param i32 i32 f64)))
6+
(import "env" "memory" (memory $0 0))
7+
(table 1 anyfunc)
8+
(elem (i32.const 0) $null)
69
(import "config" "BGR_ALIVE" (global $assembly/config/BGR_ALIVE i32))
710
(import "config" "BGR_DEAD" (global $assembly/config/BGR_DEAD i32))
811
(import "config" "BIT_ROT" (global $assembly/config/BIT_ROT i32))
9-
(import "JSMath" "random" (func $~lib/math/JSMath.random (result f64)))
10-
(import "env" "memory" (memory $0 0))
12+
(import "Math" "random" (func $~lib/bindings/Math/random (result f64)))
1113
(global $assembly/index/w (mut i32) (i32.const 0))
1214
(global $assembly/index/h (mut i32) (i32.const 0))
1315
(global $assembly/index/s (mut i32) (i32.const 0))
1416
(export "memory" (memory $0))
17+
(export "table" (table $0))
1518
(export "init" (func $assembly/index/init))
1619
(export "step" (func $assembly/index/step))
1720
(export "fill" (func $assembly/index/fill))
18-
(func $assembly/index/init (; 1 ;) (type $iiv) (param $0 i32) (param $1 i32)
21+
(func $assembly/index/init (; 1 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32)
1922
(local $2 i32)
2023
;;@ assembly/index.ts:29:2
2124
(set_global $assembly/index/w
@@ -49,7 +52,7 @@
4952
(get_global $assembly/index/h)
5053
)
5154
)
52-
;;@ assembly/index.ts:34:30
55+
;;@ assembly/index.ts:35:4
5356
(block $break|1
5457
;;@ assembly/index.ts:35:9
5558
(set_local $1
@@ -70,7 +73,7 @@
7073
(if (result i32)
7174
(f64.gt
7275
;;@ assembly/index.ts:36:21
73-
(call $~lib/math/JSMath.random)
76+
(call $~lib/bindings/Math/random)
7477
;;@ assembly/index.ts:36:32
7578
(f64.const 0.1)
7679
)
@@ -131,7 +134,7 @@
131134
)
132135
)
133136
)
134-
(func $assembly/index/step (; 2 ;) (type $v)
137+
(func $assembly/index/step (; 2 ;) (; has Stack IR ;) (type $v)
135138
(local $0 i32)
136139
(local $1 i32)
137140
(local $2 i32)
@@ -604,7 +607,7 @@
604607
)
605608
)
606609
)
607-
(func $assembly/index/fill (; 3 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64)
610+
(func $assembly/index/fill (; 3 ;) (; has Stack IR ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64)
608611
(local $3 i32)
609612
;;@ assembly/index.ts:81:2
610613
(block $break|0
@@ -617,12 +620,12 @@
617620
(get_global $assembly/index/w)
618621
)
619622
)
620-
;;@ assembly/index.ts:81:33
623+
;;@ assembly/index.ts:82:4
621624
(if
622625
;;@ assembly/index.ts:82:8
623626
(f64.lt
624627
;;@ assembly/index.ts:82:13
625-
(call $~lib/math/JSMath.random)
628+
(call $~lib/bindings/Math/random)
626629
(get_local $2)
627630
)
628631
(i32.store
@@ -673,12 +676,12 @@
673676
(get_global $assembly/index/h)
674677
)
675678
)
676-
;;@ assembly/index.ts:84:33
679+
;;@ assembly/index.ts:85:4
677680
(if
678681
;;@ assembly/index.ts:85:8
679682
(f64.lt
680683
;;@ assembly/index.ts:85:13
681-
(call $~lib/math/JSMath.random)
684+
(call $~lib/bindings/Math/random)
682685
(get_local $2)
683686
)
684687
;;@ assembly/index.ts:17:2
@@ -720,4 +723,7 @@
720723
)
721724
)
722725
)
726+
(func $null (; 4 ;) (; has Stack IR ;) (type $v)
727+
(nop)
728+
)
723729
)

examples/game-of-life/build/untouched.wat

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33
(type $F (func (result f64)))
44
(type $v (func))
55
(type $iiFv (func (param i32 i32 f64)))
6+
(import "env" "memory" (memory $0 0))
7+
(table 1 anyfunc)
8+
(elem (i32.const 0) $null)
69
(import "config" "BGR_ALIVE" (global $assembly/config/BGR_ALIVE i32))
710
(import "config" "BGR_DEAD" (global $assembly/config/BGR_DEAD i32))
811
(import "config" "BIT_ROT" (global $assembly/config/BIT_ROT i32))
9-
(import "JSMath" "random" (func $~lib/math/JSMath.random (result f64)))
10-
(import "env" "memory" (memory $0 0))
12+
(import "Math" "random" (func $~lib/bindings/Math/random (result f64)))
1113
(global $assembly/index/w (mut i32) (i32.const 0))
1214
(global $assembly/index/h (mut i32) (i32.const 0))
1315
(global $assembly/index/s (mut i32) (i32.const 0))
1416
(global $HEAP_BASE i32 (i32.const 8))
1517
(export "memory" (memory $0))
18+
(export "table" (table $0))
1619
(export "init" (func $assembly/index/init))
1720
(export "step" (func $assembly/index/step))
1821
(export "fill" (func $assembly/index/fill))
@@ -57,7 +60,7 @@
5760
)
5861
)
5962
)
60-
;;@ assembly/index.ts:34:30
63+
;;@ assembly/index.ts:35:4
6164
(block $break|1
6265
;;@ assembly/index.ts:35:9
6366
(set_local $3
@@ -75,14 +78,14 @@
7578
)
7679
)
7780
)
78-
;;@ assembly/index.ts:35:32
81+
;;@ assembly/index.ts:36:6
7982
(block $assembly/index/set|inlined.0
8083
(set_local $4
8184
;;@ assembly/index.ts:36:16
8285
(if (result i32)
8386
(f64.gt
8487
;;@ assembly/index.ts:36:21
85-
(call $~lib/math/JSMath.random)
88+
(call $~lib/bindings/Math/random)
8689
;;@ assembly/index.ts:36:32
8790
(f64.const 0.1)
8891
)
@@ -751,12 +754,12 @@
751754
)
752755
)
753756
)
754-
;;@ assembly/index.ts:81:33
757+
;;@ assembly/index.ts:82:4
755758
(if
756759
;;@ assembly/index.ts:82:8
757760
(f64.lt
758761
;;@ assembly/index.ts:82:13
759-
(call $~lib/math/JSMath.random)
762+
(call $~lib/bindings/Math/random)
760763
;;@ assembly/index.ts:82:24
761764
(get_local $2)
762765
)
@@ -817,12 +820,12 @@
817820
)
818821
)
819822
)
820-
;;@ assembly/index.ts:84:33
823+
;;@ assembly/index.ts:85:4
821824
(if
822825
;;@ assembly/index.ts:85:8
823826
(f64.lt
824827
;;@ assembly/index.ts:85:13
825-
(call $~lib/math/JSMath.random)
828+
(call $~lib/bindings/Math/random)
826829
;;@ assembly/index.ts:85:24
827830
(get_local $2)
828831
)
@@ -874,4 +877,6 @@
874877
)
875878
)
876879
)
880+
(func $null (; 4 ;) (type $v)
881+
)
877882
)

examples/game-of-life/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h1>
7070
BGR_DEAD : rgb2bgr(RGB_DEAD) & ~1, // little endian, LSB must not be set
7171
BIT_ROT
7272
},
73-
JSMath: Math
73+
Math
7474
}))
7575
.then(module => {
7676
var exports = module.instance.exports;

0 commit comments

Comments
 (0)