// chemistry_test.sy -- Test chemistry native functions

fn main() {
    println("=== CHEMISTRY NATIVES TEST ===")

    // Amino acid properties
    let his_pka = amino_acid("histidine", "pka_side")
    println("Histidine side chain pKa: " + his_pka)

    let cys_mw = amino_acid("cysteine", "mw")
    println("Cysteine MW: " + cys_mw + " g/mol")

    let ile_hydro = amino_acid("isoleucine", "hydro")
    println("Isoleucine hydrophobicity: " + ile_hydro + " (most hydrophobic)")

    let asp_charge = amino_acid("aspartate", "charge_ph7")
    println("Aspartate charge at pH 7: " + asp_charge)

    // Bond energies
    let peptide = bond_energy("peptide")
    let disulfide = bond_energy("s-s")
    let hbond = bond_energy("hydrogen_bond")
    println("Peptide bond: " + peptide + " kJ/mol")
    println("Disulfide bridge: " + disulfide + " kJ/mol")
    println("Hydrogen bond: " + hbond + " kJ/mol")

    // Electronegativity
    let o_en = electronegativity("O")
    let c_en = electronegativity("C")
    println("Oxygen electronegativity: " + o_en)
    println("Carbon electronegativity: " + c_en)
    println("O-C difference: " + (o_en - c_en) + " (polar bond)")

    // Osmolarity
    let osm = osmolarity(140.0, 100.0, 15.0)
    println("Serum osmolarity: " + osm + " mOsm/kg (normal: 275-295)")

    // Redox potentials
    let nadh = redox_potential("nad/nadh")
    let o2 = redox_potential("o2/h2o")
    println("NADH E0': " + nadh + " mV")
    println("O2/H2O E0': " + o2 + " mV")
    println("ETC span: " + (o2 - nadh) + " mV (drives ATP synthesis)")

    // Equilibrium constant from Gibbs
    let k_atp = equilibrium_constant(-30.5, 37.0)
    println("ATP hydrolysis K: " + k_atp + " (HUGE, reaction goes to completion)")

    // Water
    let kw = water_property("kw")
    let cp = water_property("specific_heat")
    println("Water Kw: " + kw)
    println("Water specific heat: " + cp + " J/(g*K)")

    // Functional groups
    let carboxyl = functional_group("carboxyl")
    let amino = functional_group("amino")
    println("Carboxyl: " + carboxyl)
    println("Amino: " + amino)

    println("")
    println("=== ALL CHEMISTRY NATIVES OPERATIONAL ===")
}
