Skip to content

A simple custom-made programming language with LLVM and C++.

License

Notifications You must be signed in to change notification settings

GDhex12/DestructiveC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository is a mirror of the original private project.

The DestructiveC (~~C) language

Custom made language with LLVM 13 which destructs any variable (removes from memory) after a single use in code if prepended with ~. Based on C++.

Limitations

The following are unimplemented:

  • One-liner else if
  • do... while

Only one "destructive" (DC) variable must remain in memory, multiple DC variables at the same time are not supported.

Compilation instructions

Linux

TO-DO: linker errors out with the .rodata ELF section (-fPIE / -no-pie does not make a difference).


Windows (MinGW)

Download precompiled binaries for LLVM and Clang 13.0.1-3 from the following link: https://repo.msys2.org/mingw/mingw64/

pacman -S cmake make git
git clone https://github.com/GDhex12/DestructiveC.git
pacman -U mingw-w64-x86_64-clang-13.0.1-3-any.pkg.tar.zst
pacman -U mingw-w64-x86_64-llvm-13.0.1-3-any.pkg.tar.zst
cd DestructiveC && mkdir build && cd build
cmake -DCMAKE_C_COMPILER=/mingw64/bin/clang.exe -DCMAKE_CXX_COMPILER=/mingw64/bin/clang++.exe ..

Copy over the stdlib.h and math.h headers from /mingw64/include to /mingw64/x86_64-w64-mingw32/include to bypass a CMake bug.

make -j<THREAD_COUNT>
DC "path/to/langfile.dc"
clang++ bin/start.cpp "path/to/langfile.o" -o path/to/outexec

About

A simple custom-made programming language with LLVM and C++.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages