Skip to content
SCIENTIFIC COMPUTING

From dimensions to domain packages.

Work through complete examples with clear expected results. Each tutorial identifies which features belong to the language and which require an SS package.
TUTORIAL 1

Physical quantities and custom units

Dimensioned literals, derived quantities, and a user-defined multiplicative unit.

units
dimensions
quantities
engineering
SS source
let force = 20 kN
let area = 200 mm^2
let stress = force / area

unit furlong = 201.168 m
let distance = 3 furlong

printLine(force)
printLine(stress)
printLine(distance)

Expected result: 20 kN; 100000000.00000001 m^-1*kg*s^-2; 3 furlong

Example source: Docs/SPECIFICATION.md, Language V1.
TUTORIAL 2

Descriptive statistics

Summarize a measured sample using the verified SS.Statistics package example.

packages
statistics
records
arrays
SS source
module Main
import Statistics

let result = Statistics.summarize([12.0, 15.0, 13.0, 10.0, 15.0])
printLine("count", result.count, "mean", result.mean, "sample variance", result.sampleVariance)

Expected result: count 5, mean 13, sample variance 4.5

Example source: Examples/ProfessionalFreePackages/SS.Statistics/Beginner/main.ss.
TUTORIAL 3

Constant-acceleration motion

Compute position and velocity with the verified SS.Mechanics beginner example.

packages
mechanics
kinematics
records
SS source
module Main
import Mechanics

let motion = Mechanics.constantAcceleration(0.0, 0.0, 9.81, 2.0)
printLine("position_m", motion.position, "velocity_m_per_s", motion.velocity)

Expected result: position_m 19.62, velocity_m_per_s 19.62

Example source: Examples/ProfessionalFreePackages/SS.Mechanics/Beginner/main.ss.
Evidence boundary

Package examples need the matching package. SS Lab uses the real SS compiler to resolve dependencies, report errors, and run the program.