This project is for comparing async and concurrency tools in different
languages by implementing a simple
wc -l-style utility.
wc utility should do the following:
- Display the number of lines for each regular file in the directory.
- Display the cumulative number of lines of all files in the directory.
- Optionally take a single command-line argument specifying a different directory.
- Sort the files in terms of number of lines, in descending order.
- Print the running time, rounded to the nearest integer, in milliseconds
$ ./bin/wc-go tmp 11 tmp/big.txt 1 tmp/small.txt 12 [TOTAL] Took 1ms
The suggested implementation involves "fanning out" asynchronous tasks to read through each file in the directory and count the lines concurrently. The tasks will need to be synchronized at the end in order to compile the results and sort them for display.
As of commit c89a50e, the go implementation is the reference implementation.
adding a language implementation
wc implementations should be put in sub-directories of the
top-level directory named
wc-$LANGNAME; the go implementation is located in
wc-go. The resulting executables should be placed in
go executable is located at
Each language implementation has its own dependencies.
wc-haskellrequires the stack build tool
wc-ocamlrequires OCaml as well as the
make from the project root. Or if you want to build a particular language implementation, run e.g.
make go or
Thanks to the following folks!