# Cinderella **Repository Path**: chcwooo/Cinderella ## Basic Information - **Project Name**: Cinderella - **Description**: (Demo) Cinderella language and its compiler (*.hs) which can be compiled into WebAssembly binary format. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-02-28 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Cinderella Cinderella language and its compiler, built with LLVM. ## How to use on MacOS? #### 1、Build LLVM toolchain: ```commandline # Fetch LLVM from remote server; wget http://releases.llvm.org/6.0.0/llvm-6.0.0.src.tar.xz # Uncompress bundle; tar -xvJf llvm-6.0.0.src.tar.xz # Rename directory; mv llvm-6.0.0.src/ llvm/ # Configure CMake and build; cd llvm && mkdir build cd build && cmake .. && make ``` #### 2、Build source code with CMake: ```commandline # Config CMake; cd build && cmake -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly .. # Make; make && make install ``` #### 3、Run Compiler in Command Line: ```commandline # Command line mode; Cinderella # Compiling mode (try build/sources); Cinderella -o # Compile ".hs" source file into WebAssembly binary module (.wasm): Cinderella -t WASM -o ``` #### 4、Sample Code: ```hangScript def add(x, y) x + y; def average(x, y) (x + y) / 2; ``` #### 5、Capability and TODO: - [x] Define simple function with binary expression; - [x] Embed on WebAssembly (LLVM-IR to Wat/Wasm); - [ ] Add standard control flow support; - [ ] Add customized local variable support; - [ ] Optimize compiler structure;