Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
F#
Discontinued Please file issues or pull requests here: https://github.com/dotnet/fsharp (by fsharp)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
class Rectangle { readonly height: number readonly width: number constructor(height: number, width: number) { this.height = height this.width = width } add(rec: Rectangle) { return new Rectangle(this.height+rec.height, this.width+rec.width) } } const tallRect = new Rectangle(1, 3) const wideRect = new Rectangle(3, 2) // Usage, chaining: const square = tallRect.add(wideRect).add(wideRect) console.log(square) rec3.height = 20 // TS correctly errors on this. However, the JS would still execute (when run in e.g. https://www.typescriptlang.org/play ) console.log(square)
Let's compare how 3 languages that compile to JavaScript - TypeScript, ReScript and F# with the Fable compiler - are able to chain immutable data.
That's because both ReScript and F# were derived from OCaml, so they also have the powerful Hindley-Milner (H-M) type inference. H-M type inference is also sound, which means you can rely on it (it prevents all type errors it claims to prevent, and doesn't give false negatives, so you can trust that all type checked programs will be correct). That's something you can't take for granted in TypeScript, even with the extra annotations.
Let's compare how 3 languages that compile to JavaScript - TypeScript, ReScript and F# with the Fable compiler - are able to chain immutable data.
Let's compare how 3 languages that compile to JavaScript - TypeScript, ReScript and F# with the Fable compiler - are able to chain immutable data.