"STRING
THEORY"
"@phenomnomnominal 2024"
'
'
"Hi i'm Craig"
'
'
'
'
'
'
"SLIDES"
"PHYSICS!"
"SET UP"
"String"
"hello"
""
"HELLO"
"String theory is a collection of ideas in theoretical physics in which the fundamental building-blocks of nature are not particles (such as the point-like electron) but instead strings. Imagine microscopic wiggling rubber bands."
"S"
"๐งถ"
"letย myString: stringย = 'hello';"
"HELLO"
"a string is a sequence of charactersย used to represent text."
"a primitive value, immutable, always strictly equal to itself"
TASK ONE
DEMOCRACY!
"StringS"
string
"hello"
"HELLO"
"String theory is a collection of ideas in theoretical physics in which the fundamental building-blocks of nature are not particles (such as the point-like electron) but instead strings. Imagine microscopic wiggling rubber bands."
"S"
"๐งถ"
""
"๐จโ๐จโ๐งโ๐ง"
|S| = โ
"SUPER"
|S| = 1
"SUPER"
TASK TWO
"UNIONS"
string
"hello"
"HELLO"
"String theory is a collection of ideas in theoretical physics in which the fundamental building-blocks of nature are not particles (such as the point-like electron) but instead strings. Imagine microscopic wiggling rubber bands."
"S"
"๐งถ"
""
"๐จโ๐จโ๐งโ๐ง"
|S| = โ
"SUPER"
"SUPER"
|S| = 1
"Marie Curie"
"Marie Curie"
"Maria Goeppert-Mayer"
"Maria Goeppert-Mayer"
"Donna Strickland"
"Donna Strickland"
"Andrea Ghez"
"Andrea Ghez"
"Anne L'Huillier"
"Anne L'Huillier"
"Marie Curie"
"Maria Goeppert-Mayer"
"Donna Strickland"
"Andrea Ghez"
"Anne L'Huillier"
|S| = 5
"Marie Curie" | "Maria Goeppert-Mayer" | "Donna Strickland" | "Andrea Ghez" | "Anne L'Huillier"
TASK THREE
"INDEXES"
type Electron = {
readonly name: 'electron';
readonly mass: 9.1093837e-35;
readonly spin: 0.5;
}
Record<string, Paper>;
interface Paper {
authors: Array<string>;
date: Date;
}
{ [index: number]: Paper }
type Electron = {
readonly name: 'electron';
readonly mass: 9.1093837e-35;
readonly spin: 0.5;
}
type Mass = Electron['mass'];
type Papers = Array<Paper>;
type SpecificPaper = Papers[0];
TASK FOUR
"KEYS"
type Electron = {
readonly name: 'electron';
readonly mass: 9.1093837e-35;
readonly spin: 0.5;
}
type ElectronKeys = 'name' | 'mass' | 'spin';
TASK FIVE
"TEMPLATES"
const hydrogen = "H"
const oxygen = "O"
const water = `${hydrogen}${hydrogen}${oxygen}`;
type Hydrogen = "H"
type Oxygen = "O"
type Water = `${Hydrogen}${Hydrogen}${Oxygen}`;
type Elements =
"H" | "He" | "Li" | "Be" | "B" |
"C". | "N" | "O" | "F" | "Ne";
type Molecules =
`${Elements}${Elements}${Elements}`;
type Molecules =
"HHH" | "HHHe" | "HHLi" | "HHBe" | "HHB" | "HHC" | "HHeH"
| "HHeHe" | "HHeLi" | "HHeBe" | "HHeB" | "HHeC" | "HLiH"
| "HLiHe" | "HLiLi" | "HLiBe" | "HLiB" | "HLiC" | "HBeH"
| "HBeHe" | ... 195 more ... | "CCC"
type StandardParticles =
| "Higgs boson"
| "Neutrino"
| "Lepton"
| "Z boson"
| "W boson"
| "Gluon"
| "Muon"
| "Top quark";
type SuperPartnerParticles =
| "Higgsino"
| "Sneutrino"
| "Slepton"
| "Zino"
| "Wino"
| "Gluion"
| "Smuon"
| "Stop Squark";
Can we use TypeScript string types to transform from a Standard Particle name to a Super Partner Particle?
TASK SIX
"INTRINSICS"
"SNeutrino" | "SLepton" | "SMuon" | "STop quark";
type Lower = Lowercase<"SNeutrino">; // "sneutrino"
type Upper = Uppercase<"SLepton">; // "SLEPTON"
type Capital = Capitalize<"SMuon">; // "SMuon"
type Uncapital = Uncapitalize<"STop quark">; // "sTop quark"
TASK SEVEN
"MAPS"
type NobelWinners = {
"Marie Curie": "researches on the radiation phenomena";
"Maria Goeppert-Mayer": "discoveries concerning nuclear shell structure";
"Donna Strickland": "a method of generating high-intensity, ultra-short optical pulses";
"Andrea Ghez": "the discovery of a supermassive compact object at the centre of our galaxy";
"Anne L'Huillier": "Experimental methods that generate attosecond pulses of light";
};
type NobelGreetingMap = {
[Name in keyof NobelWinners]: `Hello ${Name}`;
};
TASK EIGHT
"INFERENCE"
A extends B ? C : D
"Conditional Types"
Input extends `${infer Start}${infer End}`
? Start | End
: never;
"Infer"
TASK NINE
"RECURSION!"
TASK TEN
"EVERYTHING"
TASK ELEVEN
"THE END"
String Theory ngconf 2024
By Craig Spence
String Theory ngconf 2024
- 1,027