Coder Social home page Coder Social logo

Optional typing in Clojure, as a library.

Usage Overview

tldr; see the minimal example project for Typed Clojure[Script] setup.

Typed Clojure is separated into modules. You'll want the full type checker at development time, and the runtime dependencies in production.

In Clojure CLI's deps.edn, this will look something like this:

{:deps {org.typedclojure/typed.clj.runtime {:mvn/version "1.2.1"}}
 :aliases {:dev {:extra-deps {org.typedclojure/typed.clj.checker {:mvn/version "1.2.1"}}}}}

You can then start a dev repl with clj -A:dev.

In Leiningen's project.clj, it will look something like this:

(defproject com.my-domain/a-project "1.0.0-SNAPSHOT"
  :dependencies [[org.typedclojure/typed.clj.runtime "1.2.1"]]
  :profiles {:dev {:dependencies [[org.typedclojure/typed.clj.checker "1.2.1"]]}})

Then, lein repl will automatically activate the :dev profile. Verify the type checker is not included in uberjars with lein with-profile uberjar deps :tree.

For ClojureScript support, use org.typedclojure/typed.cljs.runtime and org.typedclojure/typed.cljs.checker.

Example projects

  • minimal demonstrates how to statically type check Clojure[Script] namespaces
  • minimal-clj demonstrates how to statically type check (just) Clojure namespaces
  • malli-type-providers demonstrates how to statically type check using malli schemas
  • spec1-type-providers demonstrates how to statically type check using spec1 specs
  • zero-deps demonstrates how to type check a library without introducing any runtime dependency on Typed Clojure (only dev-time).
  • symbolic-guide shows how to reason about symbolic execution in Typed Clojure.

Releases and Dependency Information

Latest stable release is 1.2.1.

See modules for specific version coordinates:

Clojure implementation

ClojureScript implementation

Implementation-agnostic

Library Annotations

Compatibility

Typed Clojure supports Clojure 1.12.0-alpha9 and JDK 1.8+.

Mailing List and Chat

Use the core.typed mailing list for Typed Clojure discussion.

#core-typed on Clojurians Slack

Archive for #core-typed Slack

Documentation

See wiki.

API Reference

Ambrose's blog

Leiningen Plugin

lein-typed

Vim Plugin

vim-typedclojure

Emacs Mode

typed-clojure-mode

Examples

core.async Rock-paper-scissors

Developer Information

Contributors

Thanks to the following people for contributing to core.typed:

  • Stephen Compall (S11001001)
  • Andrew Brehaut (brehaut)
  • Christopher Spencer (cspencer)
  • Reid McKenzie (arrdem)
  • Di Xu (xudifsd)
  • Nicola Mometto (Bronsa)
  • Chas Emerick (cemerick)
  • Jake Goulding (shepmaster)
  • Andy Fingerhut
  • Aravind K N (arav93)
  • Allen Rohner (arohner)
  • Minori Yamashita (ympbyc)
  • Kyle Kingsbury (aphyr)
  • Nathan Sorenson
  • Tobias Kortkamp (t6)
  • Alejandro Gomez (dialelo)
  • Piotr Jarzemski (kazuhiro)

YourKit

YourKit is kindly supporting core.typed and other open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products:

License

Copyright © Ambrose Bonnaire-Sergeant, Rich Hickey & contributors.

Licensed under the EPL (see the file epl-v10.html).

tools.analyzer

Copyright © Nicola Mometto, Rich Hickey & contributors.

Licensed under the EPL (see the file epl-v10.html).

tools.analyzer.jvm

Copyright © Nicola Mometto, Rich Hickey & contributors.

Licensed under the EPL (see the file epl-v10.html).

tools.analyzer.js

Copyright © Nicola Mometto, Rich Hickey & contributors.

Licensed under the EPL (see the file epl-v10.html).

Typed Clojure's Projects

esop16 icon esop16

Code to accompany ESOP 2016 paper

examples icon examples

Runnable examples for Typed Clojure paper

mranderson icon mranderson

Leiningen plugin to download and use some dependencies as source.

typed-repl icon typed-repl

Demo of core.typed integration into Clojure's compilation pipeline

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.