Welcome!
Say hello to Vyse, a fast, compact and embedabble scripting language. Let's start by answering the first question on your mind, "What does it look like?" For starters, here is the mergesort algorithm written in Vyse:
fn merge(left, right, sorted) {
let lptr = 0, rptr = 0
while lptr < #left and rptr < #right {
if left[lptr] < right[rptr] {
sorted:append(left[lptr])
lptr += 1
} else {
sorted:append(right[rptr])
rptr += 1
}
}
while lptr < #left {
sorted:append(left[lptr])
lptr += 1
}
while rptr < #right {
sorted:append(right[rptr])
rptr += 1
}
}
fn merge_sort(arr) {
if #arr == 1 return
const mid = len // 2,
left = arr:slice(0, mid),
right = arr:slice(mid)
merge_sort(left)
merge_sort(right)
merge(left, right, arr)
}
More examples can be found on the docs or
the github repo.
What else?
The key selling points of Vyse are:
- Readily embedabble. Vyse integrates seamlessly with C++, and has a modern API. It's very simple to call C++ functions from Vyse and vice versa.
- Familiar, Powerful. One of the leading design choices for Vyse was to take the good parts from javascript and lua, and combine them into a lovely little language. Vyse takes from Lua's minimalism, Javascript's friendly syntax and borrows some ideas from the object models of both the languages.
- Lightweight. Vyse is very lightweight with minimal libc++ footprint. The standard library is entirely optional, allowing it to be ported to new environments rather quickly.
- Prototypical inheritance. Vyse allows OOP via prototypes. The idea is a mix of what JS and Lua provide. There is still syntactic sugar for classes and useful constructs like operator overloading, metaclasses and iterators.
Why make yet another language?
Honestly speaking, Vyse is primarily a hobby project being developed for the pure joy of making a language tailored entirely to my taste. Now that we have that established, I want to also state that while it is primarily a hobby project, it does not fall short of a full featured and useable language by any means.
Vyse has been built for embedding in real applications. Web servers and game engines are the first things to come to mind, but vyse can run on any platform that has C++ and a small subset of it's standard library.
Lastly, as you will realize when reading the docs, Vyse feels very familiar if you have prior experience writing Javascript or Lua. In the docs, you can read more about the quirks and eccentricities of aforementioned languages that Vyse got rid of, and the ideas that it built upon further.