Simple imperative programming language created for fun.

About Biscuit Programming Language (BL)


The Biscuit Language (BL) is simple imperative programming language using LLVM backend implemented in C. Language syntax and all it's features are still in development and not ready for real use yet. Biscuit is designed to be simple, fast and explicit. Language syntax is inspired by JAI.

Motivation: I'm enjoying programming in C, but I miss some features there, on the other side C++ seems to be too much complicated for me and language itself require sometimes more attention than solved problem. So I decided to create my own language with all features I need and which I considered useful.

Goals:

  • manual memory management
  • pointers
  • no exceptions
  • fast compilation
  • full compile-time execution (integrated interpreter)
  • no OOP
  • types as values in compile-time
  • use of the LLVM backend
  • multiplatform

Example program:

#load "std/file.bl"

main :: fn () s32 {
    file := file_open(#file);
    defer file_close(file);

    content := file_read_all(file);
    defer mem_free(auto content.ptr);
    print("%\n", content);

    return 0;
};

main :: fn () s32 { file := file_open(#file); defer file_close(file);

content := file_read_all(file);
defer mem_free(auto content.ptr);
print("%\n", content);

return 0;

}; [/code]

Compile time execution:

$blc -r test.bl
Compiler version: 0.5.1 (pre-alpha)
Target: x86_64-apple-darwin17.7.0
Compile assembly: test

Executing 'main' in compile time...
#load "std/file.bl"

main :: fn () s32 {
    file := file_open(#file);
    defer file_close(file);

    content := file_read_all(file);
    defer mem_free(auto content.ptr);
    print("%\n", content);

    return 0;
};

Execution finished with state: 0

Running native linker...
Compiled 1355 lines in 0.258531 seconds.

Finished at 05-10-2019 22:37:40

Executing 'main' in compile time... #load "std/file.bl"

main :: fn () s32 { file := file_open(#file); defer file_close(file);

content := file_read_all(file);
defer mem_free(auto content.ptr);
print("%\n", content);

return 0;

};

Execution finished with state: 0

Running native linker... Compiled 1355 lines in 0.258531 seconds.

Finished at 05-10-2019 22:37:40 [/code]

What is done:

  • Language basic features
  • Some documentation
  • DWARF debug symbol generation
  • Compile time execution
  • Static RTTI generation
  • Experimental wrappers for SDL2, SDL2_Image and Vulkan API
  • Two demo projects included in repository

What is planned to do:

  • Explicit compile time executed calls
  • Better error messages
  • Full documentation
  • Lot of bug-fixes
  • Use multiple cores for lexing and parsing
  • Better handling of invalid syntax in parser
  • Speed optimizations of the compiler
  • Support of multithreading in interpreter
  • Create bigger "real" project using this language to validate functionality and feature set
Read more