Rescript is a programming language created in 2020.
#1136on PLDB | 4Years Old | 2kRepos |
Try now: Web
ReScript is a robustly typed language that compiles to efficient and human-readable JavaScript. It comes with a lightning fast compiler toolchain that scales to any codebase size.
module Button = {
@react.component
let make = (~count: int) => {
let times = switch count {
| 1 => "once"
| 2 => "twice"
| n => Belt.Int.toString(n) ++ " times"
}
let msg = "Click me " ++ times
<button> {msg->React.string} </button>
}
}
Js.log("Hello World")
Feature | Supported | Token | Example |
---|---|---|---|
Strings | ✓ | " | "Hello world" |
Print() Debugging | ✓ | Js.log | |
Comments | ✓ | // A comment |
|
Line Comments | ✓ | // | // A comment |
Semantic Indentation | X |