Skip to content

Releases: biscuitlang/bl

0.13.0

04 Jul 20:52

Choose a tag to compare

Documentation link

CHANGELOG

[Compiler]

- Change build system.

	In order to get rid of CMake as dependency, a new custom build system was implemented
	using 'nob' as the base "library". In fact, it's just a bunch of helper functions
	implemented in C, thus whole new build system is implemented in the same language as
	the compiler itself. This way we don't need special DSL to handle compilation process.

	Use ./build.bat or ./build.sh now.

- Redesign module system.

	This version introduces a new module system completely changing the way the import and
	symbol visibility works.
	The original solution used one big shared global scope for all symbols in the program, thus
	no matter where the import was used, all its symbols were public and accessible even
	from other (completely unrelated) modules.
	With the new system, imported module symbols might be private or even explicitly
	namespaced based on the usage. In general, each module (even target assembly) has its
	own namespace (module namespace) divided into public and private part. The private part
	might be introduced by `#scope_module` directive. All symbols and other modules imported
	in the `#scope_module` block are visible only inside the parent module.
	By calling the #import directive, all "public" symbols of imported module are implicitly
	inserted into the parent scope of the `#import` directive.

	As result, one should have to import explicitly all used modules, so for example even
	a simple "hello world" application now have to import print module in order to get access
	to the print function. However, this way we can be 100% sure about what dependencies each
	module require and achieve better module isolation.

- Load directive now loads source units multiple times in case the #load directive appears
  in different scope context.

- Remove ModuleImportPolicy.

	The import policy (originally used to allow automatic bundling of used modules into the
	project local module directory) was removed. In general it was unnecessary complexity in
	the build system I've never used. Note that the same behavior can be still achieved by
	manual copying of required modules into the custom module directory.

- Remove named scopes (introduced by #scope directive).

	Named scopes were completely removed from the language with introduction of a new
	module system. This reduced amount of 'using' required for 'std' for example. Imported
	modules can be namespaced on "import" side like this:

	foo :: #import "std/string";

- Modules injected into the module scope are accessible recursively on use-side.

	Modules imported into "public" module scope are accessible from outside when the module
	gets imported. This allows creation of module merging bunch of other modules for example.

- Add windows flag --legacy-colors to enable old style of output coloring on Windows.

	Compiler by default outputs ANSI color codes for error messages in terminal even on
	Windows. To get back old style of coloring use --legacy-colors compiler flag. This option
	is available only on Windows.

- Add explicit module namespacing.
- Compiler will report all possible ambiguous symbol in case there is more of them.
- Fix module import and load to not use current working directory implicitly.
- Fix reports of ambiguous symbols coming from module imports in case we have symbols
  with the same name in current module.
- Module configuration use comma separators on all platforms.
- Add new examples into 'how-to' showing how to do static and dynamic linking of external
  libraries.
- Nob on linux tries to fallback to `llvm-config` in case `llvm-config-X` wasn't found.
- Add LLVM version check on linux.
- Add more search paths for compiler dependencies on linux.

- Add support for character escape code parsing in strings and character literals.

	Newly '\0OOO' (octal notation) and '\xHH' (hex notation) can be used to specify ASCII code.
    Thus we can now handle things like:

	print("\033[34mBlue Text\033[0m\n");

- Compile-time test run when '--run-tests' is used now outputs ANSI colored reports, this
  might by disabled by passing '--no-color' argument to the compiler.
- Fix 'blc -init' to produce compilable 'src/main.bl'.
- Generated documentation for structs now contains name of base struct.

- Compiler macOS setup now include search path for system frameworks and library path provided
  by brew by default.

	Generate new configuration by 'blc --configure'.

- Add --no-finished-report compiler flag to disable printing of final compilation time report.
- Doctor now outputs warnings in examples.

- #base directive now can take any arbitrary expression evaluating to 'type'. So we can do:

	get_type :: fn (T: type #comptime) type #comptime {
		return T;
	}

	Foo :: struct #base get_type(s32) {
	}

- Change string builtin to be a dynamic array.
- Fix vmdbg causing compilation fail in case it reported error (for example unknown command
  was used).
- Fix vmdbg crash in case it tries to print unused variables.
- `debugbreak` now detects if debugger is attached in runtime and does nothing in case it's not.
- Increased maximum error count to 100 by default. This can be still adjusted by `--error-limit`
  command line argument or in `BuilderOptions.error_limit`.
- Fix cyclic dependency detection for unresolved symbols.

- Add a new way to handle errors on a function call-side. The catch statement might be used to catch
  an error returned by a function. We might implement separate branch invoked only in case an error
  appears.

	open_file() catch {
		print_err($);
	};

- Fix defer issues caused by catch statement. Defer was not correctly called in all blocks in
  case catch was present. This situation is now covered by tests too.
- Unified lexer error reports with the rest of the compiler reported errors.
- Fixed u64 literal overflow detection.
- Add exponent parsing for f32 and f64. For example `15.2e+3` of `15.2e-3`.
- Add lexer support for octal literals (starting with 0).
- Add new module configuration entries to handle runtime vs compiletime dynamic library
  linking explicitly:

	`link_runtime: "<LIB1[,LIB2,...]>"` - Dynamic libraries used only in runtime.
	`link_comptime: "<LIB1[,LIB2,...]>"` - Dynamic libraries used only in complile time.

- Add `Windows/System32` into default library search path on windows. Run `blc --configure`.
- Fix issues with namespaced types used as enum base types. For example:

	Foo :: enum C.int {}

- Add support for LD script linking on linux + resolving of library symlinks.
- Add LLVM_CONFIG option on Linux and masOS to customize path to llvm-config executable. This way
  we might point to locally compiled LLVM or any other LLVM location not available by default in
  the system.
- Fallback to linking ncurses_g.a in case libtinfo.a was not found on linux.
- Fix various extra modules linking on linux to respect comptime vs runtime linking.
- Add check for unexpected statements after `then`, `else` and `catch` in case the related code
  block is implicit. Example:

	if true then a :: 10; // This is not possible, variable would be useless.

- Build option `copy_deps` now copy only non-system dependencies.
- rpath is now set for all libraries coming from module dependencies on Linux.
- Extra module dependencies are now dynamically linked on Linux to prevent linking issues and
  collisions. This might change in the future.
- Fix "assume macOS" linker warning on Mac (run `blc --configure`).
- Fix endless looping caused by deeper nesting of dependencies in LLVM IR generator.
- Require explicit block in else if branch in case block is used for true branch.
- Fix scope lookup/register race conditions appearing from time to time when private scope
  contains loading of other units.
- Add `add_bool_constant` which might be used in build pipeline to define immutable boolean variables
  in target assembly global scope. This way the build pipeline might pass configuration flags to the target.

    ```
    exe := add_executable("test");
	add_unit(exe, "build_test.bl");
	add_bool_constant(exe, "FOO", false);
    ```

[Modules]
- Add math module.

std/math:
- Add limits for f32 and f64

std/sync:
- Mutex now can be explicitly initialized as recursive or non-recursive.

std/fs:
- Fix invalid file descriptor reported by `copy` function on linux and mac.
- read_entire_file now returns slice `[]u8` instead of dynamic array.

std/test:
- test_run now output ANSI colored reports in case 'ansi_color' argument passed to the
  function is 'true'.

build.bl:
- Add link_static_library. This function just formats name of static library based on current
  platform and use append_linker_options to adjust linker arguments.
- Add link_framework. For linking of macOS frameworks.
- Add add_framework_path. For adding search path for macOS frameworks.
- Add `get_default_module_dir` function to resolve default location of modules shipped with
  the compiler.

std/string:
- Strings are no longer zero terminated. The string type is now only wrapper over dynamic
  array with special semantics. In case zero-termination is required `strtoc` function is
  supposed to be used to do the conversion.

os/posix/syscall:
- Removed support for arm64-apple-darwin target since `syscall` is deprecated on macos.

os/linux/sys/ptrace:
- Added.

extra/glfw3:
- Upgraded to version 3.4.

extra/sdl3:
- Add incomplete SDL3 binding module.

extra/glm:
- Add `mat4_remove_scale` function.
- Fix scale extraction from mat4.
- Add simple mat3 support.

[Documentation]
- Improved "Libraries" section in documentation.
- Improved documentation of library linking.
- Add more examples into web documentation. Web listed examples now points directly to the
  github.
- F...
Read more

0.12.0

04 Jan 20:56

Choose a tag to compare

Documentation link

CHANGELOG

Add symlink resolve for the current executable on macos.
Add new #scope_private and #scope_public to freely enter and exit private scope block.
Make #private directive deprecated.
Fix interp function callbacks without arguments.
Paralelize MIR generation.
Performance improvements.

0.11.2

13 Aug 09:34

Choose a tag to compare

Documentation link

CHANGELOG

Add demo program.
Fix conversion of builtin array.len to Any on function call.
Fix defer statements used with inline ifs.
Fix local scope struct type composition.

0.11.1

10 Aug 23:46

Choose a tag to compare

Documentation link

CHANGELOG

Add compiler option to set output name.
Changed reports of unreachable code.
Dirty mode compiler flag renamed to "do-cleanup".
Fix hash table bugs.
Fix if branching.
Provide LLD linker only on Windows.
Update to LLVM 18.

0.11.0

04 Aug 19:30

Choose a tag to compare

Documentation link

CHANGELOG

Add 'then' keyword and inline if statements.
Add --dirty-mode compiler flag.
Add SIMD implementation for some hot code paths (Windows only).
Add automatic static array element count using [_]s32 syntax for compound initializers.
Add builder configuration api for build pipelines.
Add dlib VM runtime support.
Add fmod and trunc math functions.
Add new documentation web generator.
Add support for x86_64-unknown-linux-gnu target architecture triple.
Add ternary if expression.
Add untyped compound expressions.
Fix group initialization of multiple variables at once in global scope.
Fix invalid position of vargs generated before call causing stack problem in VM execution.
Fix member access directly on call result.
Fix reports of unused symbols declared after usage in local scopes.
Fix rpmalloc missing terminations for threads causing deadlocks sometimes.
Fix unary not operator precedence.
Fix unroll on global variables.
Improved documentation generator (added more value expressions).
RPMalloc used for the compiler.
Reduced amount of types generated internally by the compiler (use cache).
Reworked thread pool.
Rewrite string handling inside the compiler.

0.10.0

11 Jun 18:49

Choose a tag to compare

INFO
New experimental release version of blc compiler, documentation can be found here.

CHANGELOG
Add lazy IR generation to reduce LLVM generated stuff.
Add thread local global storage support.
Add compilation time report.
Add polymorphic function.
Add temporary allocator.
Add missing operators and change deref operator to @.
Add evaluation of compile time known conditional breaks.
Add static assert.
Add static if.
Add experimental #comptime directive for the functions evaluated in compile time.
Add typeof builtin.
Add enumcount helper function.
Add hash table.
Add buffer allocator.
Add using statement for scopes and enums.
Add implicit conversion from string to slice []u8.
Add naming of compound members for structs.
Add release-with-debug-info target.
Add realloc_slice.
Add type alignment into the type info.
Add #obsolete directive.
Add silent-run compiler argument.
Add call-stack getter for Windows and improve assert and panic reports.
Add function name into code location.
Add glwindow and draw modules + some example projects.
Add #maybe_unused for function arguments.
Add mixed function signature.
Add Static Array and Bucket Array
Add target triple API to the build system pipeline settings.
Add semaphores into synchronization API.
Add API to get ID of current thread.
Add #enable_if function directive.
Fix crash on unnamed function argument RTTI generation.
Fix crash when invalid type of default argument value is provided by user.
Fix invalid conversion of enum variants to Any.
Fix DI locations using Code View.
Fix generation of unused LLVM IR code paths.
Fix missing usage check for symbols in named scope.
Fix DWARF generation for local anonymous functions.
Fix DI Generation of global variables using CodeView.
Fix evaluation of multi-return and struct comptime functions.
Fix conversion of constants into slice.
Fix 0 size reported from sizeof for incomplete types.
Fix implicit conversion of alignof to Any.
Fix array type decomposition.
Fix bug related to unresolved types waiting for self.
Fix invalid binary operation volatile type borrowing for explicitly not matching types.
Fix argparse issues in doctor.
Fix emitting of string literals produced by compile time functions.
Fix invalid resolving of named-scope nested symbols via explicit operator.
Fix resume of postponed stack based call interpretations in compile-time.
Fix missing completeness check for value types converted to generic vargs (vargs of Any).
Documentation format changed to markdown.
Test cases are no longer reported as unused during compilation.
Update dyncall to version 1.2 (due to experimental support of M1 Macs).
Redesign allocator structure.
Change array API.
Change enum naming conventions to uppercase.
Redesign libc importing into modules.
Redesign of bl-config + using YAML as main config format.
Move file read/write into io module.
Tags are now simple unsigned numbers.
Change constant string representation from 'string' to 'string_view' aka []u8.
Change syntax of compound initializers.
Redesign memory allocators.
Simplify error handling API.
Redesign hash table implementation.
Simplified memory allocation API.
Rename slice_init and slice_terminate to alloc_slice and free_slice.
Improve compile time execution restore after postpone.
Function arguments are now immutable.
Improved error handling in synchronization API.
Improved error messages reporting unknown symbols.
Allow bunch of binary operations for enum flags types.
Update to LLVM 16.

0.9.0

11 Apr 22:04

Choose a tag to compare

0.9.0 Pre-release
Pre-release

Use LLD as default linker on Windows and Linux (experimental on macOS).
Update command line arguments to match unix common naming standarts.
Improve build system api and remove some obsolete functions.
Change build pipeline to call compile/compile_all explicitly.
Fix switch related parser bugs.
Fix unit mixing when using multithreaded build pipeline.
Add support of shared library output.
Add cmake build target Utils.
Add hash into CodeLocation.
Add namespace support.
Add unnamed symbols. (underscore used as name is not inserted into scope)
Add support of inline function group members.
Use faster custom system library and SDK lookup on Windows.
Compiler now reports unused private or local symbols.
Cleanup modules.

0.8.0

08 Jan 17:27

Choose a tag to compare

0.8.0 Pre-release
Pre-release

Migration to LLVM 11.
Add multiple return values and group declarations.
Add automatic documentation generator (-docs flag).
Add debug allocator.
Add new FileSystem module.
Add #import directive for modules
Add BL Doctor for better unit testing.
Add first prototype of modules and #import hash directive.
Add support of shebang and silent execution.
Add -silent and -rs options.
Add -verify-llvm option to enable LLVM IR verification.
Add modules: thread, sync, fs
Add forward of command line arguments into bl executed by interpreter (-r, -rs).
Add multithread compilation.
Support custom allocators in containers.
Compiler now returns numerical maximum error code if compilation fail.
Less descriptive terminal output during compilation.
Fix segfault on error get line.
Fix invalid character when comment block is very last in source file.
Fix garbage in unknown symbol reports.
Fix attempt to generate type info for incomplete types referenced by aliases.
Fix invalid multi-line string literals parsing.
Fix usage of function call to initialize loop iterator.
Fix invalid generation of more complex PHI expressions.

0.7.1

13 Sep 22:49

Choose a tag to compare

0.7.1 Pre-release
Pre-release

Fix nested self-references to incomplete types.
Fix crash on incomplete struct RTTI generation.
Fix crash error report at the end of file.
Fix invalid report for duplicate arguments.
Fix invalid duplicate switch value checking.
Fix invalid IS_DEBUG builtin value in debug mode.

0.7.0

26 Jul 18:02

Choose a tag to compare

0.7.0 Pre-release
Pre-release

DI generation reimplemented.
Memory allocations provided via allocator API.
Unit testing reimplemented to support native code testing.
Speed up compilation with use of llvm.memset intrinsic for default values.
Add default variable initialization.
Add noinit hash directive for variables.
Add builtin dynamic array.
Add slice_init and slice_terminate builtins.
Add -no-vcvars to disable VS environment injection.
Add implicit cast from dynamic array to slice.
Add support of Tracy profiler.
Add function call default argument values.
Add #call_location hash directive.
Add default argument type inferring.
Add explicit function overload.
Fix invalid type ID generation for incomplete structure types.
Fix naming of array types in type info.
Fix number serialization in print.
Fix invalid insertion of empty vargs.
Fix invalid casting of volatile-typed expressions.