typestar

The program shape in Dart

The smallest Dart program: main, print, and a template string.

// main is the entry point; print writes a line.
void main() {
  const hide = 'Reedbank Hide';
  print('Logbook open at $hide');
  print('Species so far: ${3 + 4}');
}

How it works

  1. void main() is the entry point of every Dart program.
  2. const binds a compile-time constant.
  3. $hide and ${3 + 4} splice values and expressions into strings.

Keywords and builtins used here

The run, in numbers

Lines
6
Characters to type
161
Tokens
35
Three-star pace
75 tpm

At the three-star pace of 75 tokens a minute, this run takes about 28 seconds.

Type this snippet

Step 1 of 3 in Values, step 1 of 27 in Language basics.

Next →

The program shape in other languages