vamchale/polyglot

polyglot

bash
compleat
man
src
test
.atsfmt.toml
.ctags
.ignore
.travis.yml
.yamllint
CONTRIBUTING.md
Justfile
LICENSE
README.md
TODO.md
atspkg.dhall
screenshot.png
README.md

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

polyglot

Build Status

poly is a command-line tool that determines project contents. The goal is to able to point it to any directory and get an accurate, complete, and informative summary of its contents.

Screenshot of sample output

It also has the secondary goal of advancing the state-of-the art for ATS, by writing practical, distributable software and supporting tooling.

Pitch

Reasons to use polyglot:

  • Accurate: won't confuse Coq and Verilog
  • Fast: polyglot is faster than all other tools
  • Pretty: magenta output

Reasons not to use polyglot:

  • It's written in ATS
  • No regex-based exclusions
  • Only supported on Linux

Benchmarks

On the Rust repo:

Tool Language Time
polyglot ATS 133.7 ms
loc Rust 180.6 ms
tokei Rust 384.6 ms
cloc Perl 14.86 s
linguist Ruby 15.17 s

Heuristics

Polyglot distinguishes itself from tokei and loc by being able to disambiguate file names. Thus, poly will not confuse Happy for Yacc (for instance).

Installation

From a Script

The easiest way to install is to use the installation script, like so:

curl -sSl https://raw.githubusercontent.com/vmchale/polyglot/master/bash/install.sh | bash -s

You may need to add $HOME/.local/bin to your PATH and $HOME/.local/share/man/man1 to your MANPATH.

You can optionally install compleat for shell completions as well.

From Source

You can install ats-pkg with

curl -sSl https://raw.githubusercontent.com/vmchale/atspkg/master/bash/install.sh | bash -s

And install poly with

atspkg remote https://github.com/vmchale/polyglot/archive/master.zip

Documentation

You can view manpages for poly with

man poly

Contents

-------------------------------------------------------------------------------
 Language             Files       Lines         Code     Comments       Blanks
-------------------------------------------------------------------------------
 ATS                     10        2249         2126           37           86
 Bash                     1          38           32            0            6
 Dhall                    1          70           62            0            8
 Justfile                 1          30           25            0            5
 Markdown                 4         397          333            0           64
 TOML                     1           3            3            0            0
 YAML                     2          69           61            0            8
-------------------------------------------------------------------------------
 Total                   20        2856         2642           37          177
-------------------------------------------------------------------------------