Skip to content

Commit 4163536

Browse files
committed
Proper README.
1 parent 6b101f6 commit 4163536

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed

README.md

+26-31
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
1-
Successful Tests
2-
----------------
1+
GopherJS - A transpiler from Go to JavaScript
2+
=============================================
33

4-
- append.go
5-
- char_lit.go
6-
- complit.go
7-
- const.go
8-
- defer.go
9-
- empty.go
10-
- for.go
11-
- func.go
12-
- func6.go
13-
- func7.go
14-
- func8.go
15-
- initcomma.go
16-
- interface/bigdata.go
17-
- interface/convert.go
18-
- interface/embed.go
19-
- interface/fail.go
20-
- interface/noeq.go (with non-nil values)
21-
- interface/receiver.go
22-
- interface/struct.go
23-
- map.go (without float/nan tests)
24-
- recover.go
25-
- recover1.go
26-
- rename.go
27-
- simassign.go
28-
- solitaire.go
29-
- switch.go (without cases that only differ in type)
30-
- turing.go
31-
- typeswitch.go
32-
- varinit.go
4+
What is supported?
5+
------------------
6+
GopherJS is able to turn itself (and all packages it uses) into pure JavaScript code that runs in all major browsers. This suggests a quite good coverage of Go's specification. However, there are some known exceptions listed below and some unknown exceptions that I would love to hear about when you find some.
7+
8+
Not yet supported
9+
-----------------
10+
Those features are not implemented yet, but on the roadmap:
11+
12+
- implicit panics (division by zero, etc.)
13+
- exact runtime type assertions for compound types without a name
14+
- reflection
15+
- goroutines, channels, select
16+
- goto
17+
18+
Derivations from Go specification
19+
---------------------------------
20+
Some tradeoffs have to be made in order to avoid huge performance impacts. Please get in contact if those are deal breakers for you.
21+
22+
- int32, uint32, int64 and uint64 have emulated overflow, all other integer types do not
23+
- calls on nil cause a panic except for slice types
24+
25+
Interface to external JavaScript
26+
--------------------------------
27+
A function's body can be written in JavaScript by putting the code in a string constant with the name `js_[function name]` for package functions and `js_[type name]_[method name]` for methods. In that case, GopherJS disregards the Go function body and instead generates `function(...) { [constant's value] }`. This allows functions to have a Go signature that the type checker can use while being able to call external JavaScript functions.

0 commit comments

Comments
 (0)