https://vapour.run/ Skip to main content Vapour is currently in very early alpha, download it anyway! Vapour LogoVapour Logo VapourInstallEditorCLIREPLDocsBlog GitHub [ ] [vapour] Typed superset of R Get Started Early alpha Vapour is extremely young, the syntax might change, things will break, expect bugs. But please help the language mature Vapour aims at making R developers more confident in their programs. Why Vapour? Syntax A language that transpiles to R means we can leverage the existing R body of work but improve things in some places by having the syntax change faster than the underlying language, akin to the various ECMAScript for JavaScript. 1 let x: int = 1 2 3 # increment in place 4 x += 41 Robustness Disassociating the code written by the developer from the code that ultimately is being run allows checking the written code for errors so they can be fixed before they are encountered. Vapour can check for flagrant problems in the code at the time your write it, letting you fix them before they reach your users or even your unit tests. 1 # warn that x might be missing 2 func foo(x: int): int { 3 return x + 1 4 } 5 6 # flag that y does not exist 7 print(y) Types With the rise of dynamically typed programming languages, developers have found out that, it turns out, types were not just to help the compiler, they actually help the developer just as much. In R, we get caught out by NA, or NULLvalues too often, not with Vapour. 1 let x: char = "hello, world" 2 3 # will fail, wrong type 4 x = NULL * Vapour * R 1 type person: object { 2 age: int, 3 name: char 4 } 5 6 func create(name: char): person { 7 return person(name = name) 8 } 9 10 @generic 11 func (p: any) set_age(age: int, ...: any): any 12 13 @default 14 func(p: any) set_age(age: int): null { 15 stop("not implemented") 16 } 17 18 func(p: person) set_age(age: int): person { 19 p$age = age 20 return p 21 } 22 23 let john: person = create("John") |> 24 set_age(36) 1 create <- function(name: char) { 2 return(structure( 3 list( 4 name = name 5 ), 6 class = c("person", "list") 7 ) 8 }) 9 10 set_age <- function(p, ...) { 11 UseMethod("set_age") 12 } 13 14 set_age.default <- function(p, age) { 15 stop("not implemented") 16 } 17 18 set_age.person <- function(p, age) { 19 attr(p, "age") <- age 20 return(p) 21 } 22 23 john <- create("John") |> 24 set_age(36) Contribute Language Help improve the language! Contribute Editor integration Help integrate the syntax highlighting and LSP of Vapour in various editor. Feedback Share your feedback in the form of Github. Give feedback Roadmap 1) R type inference Infer types from base R so type checking can be executed. 2) Autocompletion LSP The LSP currently only provides diagnostics, it should also provide autocompletion (and maybe more). 3) Vapour type inference Infer types in Vapour to reduce verbosity a tad. 4) Vapour package development tools Vapour could probably provide functionalities similar to those provided by devtools. 5) Improve transpiler The transpiler currently outputs valid but extremely ugly R code. 6) Formatter Include a formatter. 7) Extensions Allow extending Vapour, e.g.: with @decorators Docs * Get Started * Docs Community * Stack Overflow * Twitter More * GitHub Vapour 2024.