Tiny Project List

Posted: 2023-03-10
Last Modified: 2023-05-25
Word Count: 1336
Tags: c-programming go javascript julia lua programming python ruby rust typescript

Table of Contents

Purpose

Tiny C Projects presents a good idea for any language: write small applications in a language to practice techniques for bigger ones. Below is a list of “tiny” projects I may pursue to brush up skills in languages I know well (e.g. C, Python, Ruby), get up to speed in languages I don’t know as well (e.g. JavaScript, modern C++), or learn languages I don’t know at all (e.g. Go, Julia, Rust).

BTW, a “tiny” project should be as simple as the Lua scripts I added to some blog posts or the code in the duplicate-files.* scripts.

Project Table

A checkmark (✓) indicates a project that’s complete. An “x” or “?” indicates a project that is (or may be) unnecessary.

Name Blurb c cpp go jl lua js py rb rs ts other
duplicate-files find duplicate files
eltn read an ELTN text
fountain parse a Fountain text
hyperspace calculate hyperspace travel times
json read a JSON stream ? ? ? ? ? ? ? ? ? java
mintest minimal testing framework x ? x x x x x x x
orrery simulate solar system(s)
starmap 3D map of fictional or real stars
termui UI elements in a terminal window
timelog simple time usage log sh
utf8 encode/decode UTF-8
warp calculate warp speeds

Testing

Note that every project should include test code proving it works. Known testing libraries/frameworks include:

Language Test Frameworks
C minctest1, criterion
C++ Boost testing framework, minctest1
Go builtin testing framework
Java JUnit
JavaScript minctest-node1, mocha, jest
Lua minctest-lua1
Python unittest
Ruby minitest, RSpec, Test::Unit
Rust test modules
TypeScript JS testing frameworks, Alsatian, fast-check, Oscar, Testy.Ts, tsUnit

Third party test frameworks must be FOSS and ideally have no dependencies on build systems, IDEs, or external libraries.

File-related projects could get hard to test.

Descriptions

ELTN

Parse ELTN into nested associative arrays (Lua tables, Python dictionaries, Ruby Hashes, etc.).

Extra Credit:

Fountain

Parse the Fountain format for screenplays. The end result should be an HTML file using a pre-defined stylesheet.

Extra Credit:

Hyperspace

Calculate the travel time in a fictional hyperspace between two stars. Hyperspace distance is a yet-to-be-determined function of the following:

Once we have a mathematical model, the end product will be one table or equation expressing hyperspace “velocity” as a function of gravitational density, and a second calculating the error in travel times (faster and slower) out to two sigmas.

Extra Credit:

JSON

Parse JSON into a tree of Objects (Lua tables, Python dictionaries, Ruby Hashes, etc.) and Arrays (Lua tables again, Python lists, Ruby Arrays). null may need special handling in most languages to distinguish it from an empty Object entry.

Extra Credit:

Orrery

Simulate the orbital mechanics of our Solar System, and fictional ones.

Extra Credit:

Mintest

For languages without a standard unit-testing framework, write one. Something that creates command-line programs that print messages is fine.

Star Map

Generate and store a fictional stellar map, with stars specified by randomly generated names and x, y, and z coordinates.

Extra Credit:

Term-UI

Implement the following UI elements using ASCII characters:

Extra Credit:

TimeLog

Implement a command-line program that lets the user log their activities. For example, the following command

timelog.sh add timelog entry to +tinyproj @blog

adds the following line to $LOGDIR/timelog.txt:

2023-04-13_10:27:21-05:00:00 START add timelog entry to +tinyproj @blog

(Quotes optional but recommended for special characters.)

By convention a word prefixed with a ‘+’ is the name of a project and @ indicates a “context”. Both may correlate to a TODO list. See the todo.txt file format, the todo.txt CLI, and http://todotxt.org.

With no arguments the script will log something like the following:

2023-04-13_11:02:52-05:00:00 STOP

Extra Credit:

UTF-8

Read in bytes as characters encoded in UTF-8, and write characters out as UTF-8 bytes. Detect invalid sequences.

Extra Credit:

Warp

Calculate speeds and travel times based on a fictional “Warp Factor” defined as:

W = 1 + (log(v[c]) / X)

or conversely

v[c] = exp(X * (W-1))

where v[c] is the velocity relative to the speed of light c, log is the natural log (ln(y)), exp is its inverse (e^y), X is a fictional “Xin Constant” (set to the golden ratio 1.618), and w is the Warp Factor.

Warp 0 is about 0.20c, Warp 1 is c, and Warp N is about 5^(N-1).

Extra Credit:


  1. Provided by Lewis Van Winkle↩︎ ↩︎ ↩︎ ↩︎

  2. I’ve got hundreds of six-sided dice. Literal hundreds. ↩︎