xasm
A cross platform, compiled and dynamically typed programming / intermediate language
Xasm is meant to be an intermediate representation for compiled and dynamically typed programming languages. However, xasm is still itself suitable for scripting.
Features
- Dynamic typing
- Lua-like speeds
- An easy to use Rust foreign function interface
- First class support for Functional and Object Oriented programming
- Simple syntax
Documentation
You can find the virtual machine's documentation here, and the compiler backend documentation here. Both of these components are called xmachine and xassembler respectively, and you can find them on my GitHub account.
)
Examples
Here's how you implement basic control flow structures in xasm.
value = 1
if value else
while 1
Keep in mind that xasm is intended to be an intermediate representation!
Object Oriented Programming
To write object oriented code in xasm, first you write a class.
class Point
The new method is typically used to instantiate an object, but you can write other constructors if you'd like. The reason we use the new method is because the new function will call our class's new function to construct our object.
Here's how we would construct our Point.
p = new
Functional Programming
Because xasm supports closures, you can easily implement church encodings.
In addition, you can use more practical functional programming techniques.
multiply = fn
double = multiply
triple = multiply
println
println
Installation
Install Rust
# For *nix users
# If you're a windows user, go to https://rust-lang.org
|
Install / update xasm
Issues
If you run into a problem, post an issue!
License
xasm is distributed under the terms of the Apache License (Version 2.0).
See LICENSE for details.