Code Monkey home page Code Monkey logo

typecheck's Introduction

typecheck

This project is a language-agnostic typechecker. It is designed to be abstract from any particular language, but rather provide a framework that language-implementers can use to handle typechecking their statically-typed languages.

Motivation

This project was created out of my own need for a typechecker for my own compiler for pseudocode (soon to be open-sourced). I decide to separate the typechecker firstly so it could be easily tested as a different project, and secondly so I, and others, could use it for other projects in the future and benefit from any improvements made to this library over time. You can see other projects using the project on the THIRD_PARTY.md file in this repo.

Build Status

Build Status

Getting Started

To save this document from getting too long, this has been moved to a separate document, GettingStarted.md, found in this repo. This goes over the API at a high-level. For more examples, you can find tests in the test/ folder.

Code Style

Code style is checked by clang-tidy (ON by default). You can check it by running with:

cd ${PROJECT_ROOT}/build
cmake -DENABLE_CLANG_TIDY=ON ..

Build Options

The supported build tool is CMake. All of the CMake build options have been placed in a single file, which you can view here: CMake Build Options

Supported Platforms

Currently being tested using Travis CI on Windows, Mac, and Ubuntu, compiling with:

  • MSVC
  • gcc
  • clang

Typecheck requires C++17.

Dependencies

This library is designed to generally use versions of libraries pre-installed on your system, but if they are not available, build them from source automatically. Libraries this project depends on:

How to use?

This project was build for, and is used in my own project: Pseudocode (Soon to be opensourced, if not already.)

fetch_extern(typecheck https://github.com/mattpaletta/typecheck master)

I use FetchContent to along with a helper function to grab this library. You can see that function here: fetch_extern. Alternatively, you can add it as a git submodule include the directory:

add_subdirectory(typecheck)

You can then link it to your project:

add_library(my_library ...)
target_link_libraries(my_library PUBLIC ... typecheck ...)

Contribute

I welcome contributions of all sorts. I consider myself new to the open-source community, so if you're looking for things to contribute, here are some ideas to get started:

  • Spelling errors in comments & variable names
  • Improve test coverage + add edge cases (build with ENABLE_COVERAGE)
  • Improvements on performance, readability, etc.
  • Suggestions or ideas of larger improvements (leave an issue, and we can discuss)
  • Improvements to documentation or code comments to add or update where relevant

Credits

The algorithm used in this project are heavily influenced by the Hindley-Milner type system and the Swift type checker. Some of the excellent resources used are listed below:

Information

Questions, Comments, Concerns, Queries, Qwibbles?

If you have any questions, comments, or concerns please leave them in the GitHub Issues Tracker

Bug reports

If you discover any bugs, feel free to create an issue on GitHub. Please add as much information as possible to help us fixing the possible bug. We also encourage you to help even more by forking and sending us a pull request.

Maintainers

License

GPL-3.0 License. Copyright 2020 Matthew Paletta. http://mrated.ca

typecheck's People

Contributors

mattpaletta avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.