Skip to content
Igor Parfenov edited this page Jan 5, 2025 · 3 revisions

Can I use the calias?

As a system programming language in intermediate state of development, the calias requires certain qualification with system programming. However, the declared functionality has non-empty test coverage, which makes the compiler applicable to some extent.

What are the dependencies of the project?

Generally, the only dependency is the system C compiler. However, right now the build system is simplified.

  • Actually, strictly gcc is used
  • The nasm is required for calias
  • Strictly ld is used both by build system and calias

If nasm is not installed, then the calias will build, but will be able to build assembly code only.

What are the dependencies of the calias?

The calias doesn't depend on libc and is fully statically linked. It also doesn't use system headers. For simplicity, the build system doesn't ask for freestanding version of system C compiler. However, the code doesn't depend on anything outside of the project directory.

There is however one exception: the http server code, as it uses Berkeley socket library.

What about variadic functions?

The variadic function will not be supported. The goal of the project is to have simple implementation, hence we try to avoid builtin functionality. Though on some platforms it is possible to implement variadic functions without builtin (e.g. x86), on other platforms is not possible (e.g. x86_64).

Look at Application Binary Interface.

Is it possible to link the Alias code with C code?

With special syntax the calias doesn't mangle names, which provides linking. However, calias can't parse C header files and can't generate C header files (probably, it will change).

What about memory allocations?

Currently, the simple slab allocator is implemented and used. However, in future the manipulation with allocators will be more Zig-like.

What is stdlib?

The stdlib implements the subset of libc functions with the same functionality. The compiler and tests use these implementations.

What is altlib?

The altlib implements the subset of libc functions with the same functionality. The tests use these implementations.

What does underscores mean in function names?

Initially, the stdlib functions were prepended with an underscore to make sure, that these implementations are used instead of system C compiler's.

When work with altlib had been started, its functions were appended with underscore, since initially the altlib linked with stdlib (now it is not the case).

I see arrays in compiler source code, but they are not documented. Can I use them?

The arrays work now, but in weird manner. They are stored in bss section, instead of stack, which means recursive calls of the function own the same array.

Correct implementation of arrays is limited by current time system. It will be changed in future.

I see string literals in compiler source code, but they are not documented. Can I use them?

Yes, but carefully. String literals are stored in rodata section, which means if you will try to write on them, the program will get segmentation fault.

Currently there are no constants in language. It will be changed in future.