It's not
rocket science.
Use some of the syntax features of Ruby (but worse) and create programs that will maybe perform better.
$ brew install flipez/homebrew-tap/rocket-lang
🚀 > puts("hello from rocket-lang!")
"hello from rocket-lang!"
=> nil
🚀 > langs = ["ruby", "go", "crystal", "python", "php"]
=> ["ruby", "go", "crystal", "python", "php"]
🚀 > langs.yeet()
=> "php"
🚀 > langs.yoink("rocket-lang")
=> nil
🚀 > langs
=> ["ruby", "go", "crystal", "python", "rocket-lang"]
- JSON
- HTTP
- Closures
🚀 > JSON.parse('{"test": 123}')
=> {"test": 123.0}
🚀 > a = {"test": 1234}
=> {"test": 1234}
🚀 > a.to_json()
=> '{"test":1234}'
def test()
puts(request["body"])
return("test")
end
HTTP.handle("/", test)
HTTP.listen(3000)
newGreeter = def (greeting)
return def (name)
puts(greeting + " " + name)
end
end
hello = newGreeter("Hello");
hello("dear, future Reader!");
Strong and stable builtins
RocketLang ships some neat builtins such as handling HTTP requests and responses, marshaling and unmashaling of JSON objects.
It also comes with support of closures and modules and context sensitive variables in order to create complex programs.
Everything is an object
Inspired by Ruby, in RocketLang everything is an object.
This allows to thread unknown input in the same way and figuring out what kind of information your function passes on the go. Every object supports the same minimum default subset of methods to achive this.
🚀 > "test".type()
=> "STRING"
🚀 > true.wat()
=> BOOLEAN supports the following methods:
plz_s()
🚀 > 1.methods()
=> ["plz_s", "plz_i", "plz_f"]