/Lang

Compiler in C for a small programming language targetting x64 asm

Primary LanguageC

Lang

Compiler in C for a simple programming language that compiles to x64 assembly (NASM syntax).

Features

  • Functions
  • Scopes
  • Pointers
  • Arrays
  • Structs
  • Type inference

Hello World Example

extern puts(str: char *);
extern strlen(str: char *) -> int;

func main() -> int {
	str := "Hello world!";	
	puts(str);

	return strlen(str);
}

Dependencies

  • NASM (https://www.nasm.us/): used as assembler and should be added to the system Path variable.
  • Microsoft Linker (included with Visual Studio) is used for linking.