Jiyu is an LLVM-powered, low-level language being developed for fun, with the following subgoals: -Implement an appealing syntax that reduces friction and enables ease of refactoring. -Have the ability to just drop the compiler and its dependencies into existing toolchains for cross-compiling. -Be able to manipulate memory unencumbered.

Jiyu supports a full compile-time execution model along with a built-in API to harness the compiler as a library, and one may build a robust build-system in Jiyu for their project. However, for those that need to integrate Jiyu code into a pre-existing code-base with an already established build system, Jiyu also supports common command-line switches for generating just a .o/.obj file, setting the target triple for cross-compiling, or just specifying the name of the output executable. This makes Jiyu simple to integrate into an IDE, such as Xcode, a CMake system, or a script.

The language currently features: -Syntax inspired by Swift and Jai -Swift-style polymorphic/template functions -Compile-time execution -Cross-compilation -Scope-relative static-if -Type-aliases and structs -Struct-member functions -Calling into C-code -Self-contained modules -Multiline strings -Importing C declarations and headers

Runtime-type-infomation, template structs, and strict-type-aliases are planned features.


#clang_import
"""
#include <stdio.h>
""";

func @metaprogram main(argc: int32, argv: **uint8) {
    printf("Hello, Sailor!\n");

    var file = fopen("myfile.txt", "wb");
    fwrite("Hello, Pilot!\n".data, 1, 14, file);
    fclose(file);
}

#clang_import """ #include <stdio.h> """;

func @metaprogram main(argc: int32, argv: **uint8) { printf("Hello, Sailor!\n");

var file = fopen("myfile.txt", "wb");
fwrite("Hello, Pilot!\n".data, 1, 14, file);
fclose(file);

} [/code]