This language is NOT production ready yet, and as a result, most features will not work. Wait for version 1.0 of Genesis to be released
Genesis is a general-purpose programming language designed for simplicity, stricter-typing, expressiveness, and easy integration with existing JavaScript ecosystems. It transpiles to JavaScript, so you can use it anywhere JS runs (in browsers, Node.js, etc.) without needing a separate runtime.
- Easy to Learn: Genesis has familiar syntax for those who know JavaScript or C-style languages, More specifically C++.
- Transpilation: All Genesis code compiles down to readable JavaScript, so it runs anywhere JS does.
- Extensible Standard Library: Genesis comes with a library of utilities (like
print,range, etc.) that can grow with community contributions. - No Separate Runtime: Leverages the existing JavaScript environment, removing the need for an extra VM or heavy runtime.
int x = 10;
if (x > 5) {
print("x is large!");
}The generated JavaScript code would be:
let x = 10;
if (x > 5) {
console.log("x is large!");
}To install genesis, use the following command:
npm install genesis -g- Use
npm install genesis -gto get the Cli globally - Create a
.genfile with your code. - Run the command
genesis <fileName>.gento produce the corresponding JavaScript - Execute the generated JS code via
nodeor in any JS enviornment.
Rather than running the genesis <fileName>.gen command to generate a corresponding JS file. You can simply run genesis build <fileName>.gen. This will transpile your genesis code and immeditely run the transpiled code.
Genesis comes with a Transpiler API built-in if you want to integrate Genesis into a build step or IDE.
import { transpiler } from "genesis";
const genesisCode = `
int main() {
print("Hello from Genesis!");
}
`
const jsOutput = transpiler(genesisCode);
console.log(jsOutput); // -> 'console.log("Hello from Genesis!")'