You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -35,47 +35,58 @@ The following static methods are also available:
35
35
-`System.Diagnostics.Debugger.Break()`
36
36
-`System.Activator.CreateInstance<'T>()`
37
37
38
-
There is also support to convert between numeric types and to parse strings, check [the conversion tests](https://github.com/fable-compiler/Fable/blob/master/tests/Main/ConvertTests.fs).
38
+
There is also support to convert between numeric types and to parse
- All numeric types become JS `number` (64-bit floating type), except for `int64`, `uint64`, `bigint` and `decimal`. Check the [Numeric Types](numbers.md) section to learn more about the differences between .NET and JS.
43
-
- Numeric arrays are compiled to [Typed Arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) when possible.
44
+
- All numeric types become Python `int` (64-bit floating type), except for `decimal`. Check the [Numeric
45
+
Types](numbers.md) section to learn more about the differences between .NET and Python.
46
+
- Numeric arrays are compiled to [array](https://docs.python.org/3/library/array.html) when possible. Numeric arrays of
47
+
`uint8` are compiled to [bytearray](https://docs.python.org/3/library/array.html#bytearrays) in order to support
48
+
libraries that expect e.g `bytes` as input.
44
49
- No bound checks for numeric types (unless you do explicit conversions like `byte 500`) nor for array indices.
45
-
-`Regex` will always behave as if passed `RegexOptions.ECMAScript` flag (e.g., no negative look-behind or named groups).
46
50
47
51
## FSharp.Core
48
52
49
-
Most of FSharp.Core operators are supported, as well as formatting with `sprintf`, `printfn` or `failwithf` (`String.Format` is also available).
50
-
The following types and/or corresponding modules from FSharp.Core lib will likewise translate to JS:
53
+
Most of FSharp.Core operators are supported, as well as formatting with `sprintf`, `printfn` or `failwithf`
54
+
(`String.Format` is also available). The following types and/or corresponding modules from FSharp.Core lib will likewise
- Options are **erased** in Python (`Some 5` becomes just `5` in Python and `None` translates to `null`). This is needed for example, to represent Python [optional properties](https://docs.python.org/3/library/typing.html#typing.Optional). However in a few cases (like nested options) there is an actual representation of the option in the runtime.
78
+
- Options are **erased** in Python (`Some 5` becomes just `5` in Python and `None` translates to `None`). This is needed
79
+
for example, to represent Python [optional properties](https://docs.python.org/3/library/typing.html#typing.Optional).
80
+
However in a few cases (like nested options) there is an actual representation of the option in the runtime.
73
81
-`Async.RunSynchronously` is not supported.
74
-
-`MailboxProcessor` is single-threaded in Python and currently only `Start`, `Receive`, `Post` and `PostAndAsyncReply` are implemented (`cancellationToken` or `timeout` optional arguments are not supported).
82
+
-`MailboxProcessor` is single-threaded in Python and currently only `Start`, `Receive`, `Post` and `PostAndAsyncReply`
83
+
are implemented (`cancellationToken` or `timeout` optional arguments are not supported).
75
84
76
85
## Object Oriented Programming
77
86
78
-
Most of F# OOP features are compatible with Fable: interfaces and abstract classes, structs, inheritance, overloading, etc. However, please note that due to some limitations of [ES2015 classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) the generated code uses the [prototype chain](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) instead. Also note that instance members are not attached to the prototype, which means they won't be accessible from native JS code. The exception to this rule are the implementations of **interface and abstract members**.
87
+
Most of F# OOP features are compatible with Fable: interfaces and abstract classes, structs, inheritance, overloading,
88
+
etc. However, please note that instance members are not attached to the prototype, which means they won't be accessible
89
+
from native JS code. The exception to this rule are the implementations of **interface and abstract members**.
79
90
80
91
### Caveats III
81
92
@@ -85,7 +96,8 @@ Most of F# OOP features are compatible with Fable: interfaces and abstract class
85
96
86
97
There is some reflection support in Fable, you can check the [reflection tests](https://github.com/fable-compiler/Fable/blob/master/tests/Main/ReflectionTests.fs) to see what is currently possible.
87
98
88
-
Generics are erased by default in the generated Python code. However, it is still possible to access generic information (like `typeof<'T>`) at runtime by marking functions with `inline`:
99
+
Generics are erased by default in the generated Python code. However, it is still possible to access generic information
100
+
(like `typeof<'T>`) at runtime by marking functions with `inline`:
0 commit comments