GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ErwanDL/compojure: Compiler for a C-like language, written in Clojure

BranchesTags
Open more actions menu

Latest commit

 

History

61 Commits
61 Commits

Folders and files

NameName
Last commit message
Last commit date
resources
resources
 
 
src/compojure
src/compojure
 
 
test/compojure
test/compojure
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
project.clj
project.clj
 
 

Repository files navigation

Compojure

This is an in-progress compiler for a subset of the C language (called the "E" language in this project, which will hopefully resemble C closely once finished), written in Clojure.

This is an application project for CentraleSupélec's compilation course : the compiler was initially meant to be written in OCaml (based on this skeleton), but I was looking for a cool project to perfect my Clojure skills, so I figured I would just re-write it in Clojure.

Progress

  • Lexer and parser (using Instaparse)

  • Translation from AST to E-lang high level representation, and interpreter for this representation (e_interpreter.clj). This interpreter is called by default from the main function :

    $ lein run "main(a) { return a + 1; }" 4
    >> 5
    
  • Translation to CFG (Control Flow Graph) IR, and interpreter for this IR (cfg_interpreter.clj)

  • Dead code detection and elimination

  • Translation to RTL (Register Transfer Language)

  • Translation to RISC-V assembly

Language features

More features will be added once a first working compiler for the initial set of features is achieved.

  • Integer literals and variables
  • Integer arithmetic
  • Variable assignment
  • Print statement
  • Return statement
  • While loops
  • If/else conditionals
  • Subroutines (allow calling other functions from main)
  • String type
  • Arrays
  • Global variables
  • Pointers

About

Compiler for a C-like language, written in Clojure

Resources

Readme
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.