diff --git a/150/01/lecture01.pdf b/150/01/lecture01.pdf new file mode 100644 index 0000000..871b7d8 Binary files /dev/null and b/150/01/lecture01.pdf differ diff --git a/150/01/lecture01.png b/150/01/lecture01.png new file mode 100644 index 0000000..1a558db Binary files /dev/null and b/150/01/lecture01.png differ diff --git a/150/02/lecture02.pdf b/150/02/lecture02.pdf new file mode 100644 index 0000000..a9f6402 Binary files /dev/null and b/150/02/lecture02.pdf differ diff --git a/150/02/lecture02.png b/150/02/lecture02.png new file mode 100644 index 0000000..bf62ada Binary files /dev/null and b/150/02/lecture02.png differ diff --git a/150/03/lecture03.pdf b/150/03/lecture03.pdf new file mode 100644 index 0000000..579b3fb Binary files /dev/null and b/150/03/lecture03.pdf differ diff --git a/150/03/lecture03.png b/150/03/lecture03.png new file mode 100644 index 0000000..26c2c81 Binary files /dev/null and b/150/03/lecture03.png differ diff --git a/150/04/lecture04.pdf b/150/04/lecture04.pdf new file mode 100644 index 0000000..991deba Binary files /dev/null and b/150/04/lecture04.pdf differ diff --git a/150/04/lecture04.png b/150/04/lecture04.png new file mode 100644 index 0000000..4f2b9b7 Binary files /dev/null and b/150/04/lecture04.png differ diff --git a/150/05/lecture05.pdf b/150/05/lecture05.pdf new file mode 100644 index 0000000..18b7a3a Binary files /dev/null and b/150/05/lecture05.pdf differ diff --git a/150/05/lecture05.png b/150/05/lecture05.png new file mode 100644 index 0000000..e826809 Binary files /dev/null and b/150/05/lecture05.png differ diff --git a/150/06/lecture06.pdf b/150/06/lecture06.pdf new file mode 100644 index 0000000..4fb6499 Binary files /dev/null and b/150/06/lecture06.pdf differ diff --git a/150/06/lecture06.png b/150/06/lecture06.png new file mode 100644 index 0000000..6fe9faa Binary files /dev/null and b/150/06/lecture06.png differ diff --git a/150/07/lecture07.pdf b/150/07/lecture07.pdf new file mode 100644 index 0000000..67c5d98 Binary files /dev/null and b/150/07/lecture07.pdf differ diff --git a/150/07/lecture07.png b/150/07/lecture07.png new file mode 100644 index 0000000..bfbe9d8 Binary files /dev/null and b/150/07/lecture07.png differ diff --git a/150/08/lecture08.pdf b/150/08/lecture08.pdf new file mode 100644 index 0000000..a393dd3 Binary files /dev/null and b/150/08/lecture08.pdf differ diff --git a/150/08/lecture08.png b/150/08/lecture08.png new file mode 100644 index 0000000..74294c8 Binary files /dev/null and b/150/08/lecture08.png differ diff --git a/150/09/lecture09.pdf b/150/09/lecture09.pdf new file mode 100644 index 0000000..0cc4aad Binary files /dev/null and b/150/09/lecture09.pdf differ diff --git a/150/09/lecture09.png b/150/09/lecture09.png new file mode 100644 index 0000000..76d8996 Binary files /dev/null and b/150/09/lecture09.png differ diff --git a/150/10/lecture10.pdf b/150/10/lecture10.pdf new file mode 100644 index 0000000..0f14cb6 Binary files /dev/null and b/150/10/lecture10.pdf differ diff --git a/150/10/lecture10.png b/150/10/lecture10.png new file mode 100644 index 0000000..ca6061e Binary files /dev/null and b/150/10/lecture10.png differ diff --git a/150/11/lecture11.pdf b/150/11/lecture11.pdf new file mode 100644 index 0000000..ce8afee Binary files /dev/null and b/150/11/lecture11.pdf differ diff --git a/150/11/lecture11.png b/150/11/lecture11.png new file mode 100644 index 0000000..f7314cd Binary files /dev/null and b/150/11/lecture11.png differ diff --git a/150/12/lecture12.pdf b/150/12/lecture12.pdf new file mode 100644 index 0000000..ea9e92f Binary files /dev/null and b/150/12/lecture12.pdf differ diff --git a/150/12/lecture12.png b/150/12/lecture12.png new file mode 100644 index 0000000..6890bb2 Binary files /dev/null and b/150/12/lecture12.png differ diff --git a/150/13/lecture13.pdf b/150/13/lecture13.pdf new file mode 100644 index 0000000..18265ea Binary files /dev/null and b/150/13/lecture13.pdf differ diff --git a/150/13/lecture13.png b/150/13/lecture13.png new file mode 100644 index 0000000..1c33eb4 Binary files /dev/null and b/150/13/lecture13.png differ diff --git a/150/14/lecture14.pdf b/150/14/lecture14.pdf new file mode 100644 index 0000000..b7add6d Binary files /dev/null and b/150/14/lecture14.pdf differ diff --git a/150/14/lecture14.png b/150/14/lecture14.png new file mode 100644 index 0000000..ba5678c Binary files /dev/null and b/150/14/lecture14.png differ diff --git a/150/15/lecture15.pdf b/150/15/lecture15.pdf new file mode 100644 index 0000000..113b6ba Binary files /dev/null and b/150/15/lecture15.pdf differ diff --git a/150/15/lecture15.png b/150/15/lecture15.png new file mode 100644 index 0000000..507c1f8 Binary files /dev/null and b/150/15/lecture15.png differ diff --git a/150/16/lecture16.pdf b/150/16/lecture16.pdf new file mode 100644 index 0000000..fd86c9c Binary files /dev/null and b/150/16/lecture16.pdf differ diff --git a/150/16/lecture16.png b/150/16/lecture16.png new file mode 100644 index 0000000..c430f92 Binary files /dev/null and b/150/16/lecture16.png differ diff --git a/150/17/lecture17.pdf b/150/17/lecture17.pdf new file mode 100644 index 0000000..9fdaf6f Binary files /dev/null and b/150/17/lecture17.pdf differ diff --git a/150/17/lecture17.png b/150/17/lecture17.png new file mode 100644 index 0000000..f031ba5 Binary files /dev/null and b/150/17/lecture17.png differ diff --git a/150/18/lecture18.pdf b/150/18/lecture18.pdf new file mode 100644 index 0000000..8cf4d22 Binary files /dev/null and b/150/18/lecture18.pdf differ diff --git a/150/18/lecture18.png b/150/18/lecture18.png new file mode 100644 index 0000000..32749c6 Binary files /dev/null and b/150/18/lecture18.png differ diff --git a/150/19/lecture19.pdf b/150/19/lecture19.pdf new file mode 100644 index 0000000..fc96608 Binary files /dev/null and b/150/19/lecture19.pdf differ diff --git a/150/19/lecture19.png b/150/19/lecture19.png new file mode 100644 index 0000000..9c3ed4b Binary files /dev/null and b/150/19/lecture19.png differ diff --git a/150/20/lecture20.pdf b/150/20/lecture20.pdf new file mode 100644 index 0000000..dd1fa4e Binary files /dev/null and b/150/20/lecture20.pdf differ diff --git a/150/20/lecture20.png b/150/20/lecture20.png new file mode 100644 index 0000000..e97f3c1 Binary files /dev/null and b/150/20/lecture20.png differ diff --git a/150/21/lecture21.pdf b/150/21/lecture21.pdf new file mode 100644 index 0000000..2ca7a09 Binary files /dev/null and b/150/21/lecture21.pdf differ diff --git a/150/21/lecture21.png b/150/21/lecture21.png new file mode 100644 index 0000000..a06bfd9 Binary files /dev/null and b/150/21/lecture21.png differ diff --git a/150/22/lecture22.pdf b/150/22/lecture22.pdf new file mode 100644 index 0000000..5874976 Binary files /dev/null and b/150/22/lecture22.pdf differ diff --git a/150/22/lecture22.png b/150/22/lecture22.png new file mode 100644 index 0000000..4b7ca38 Binary files /dev/null and b/150/22/lecture22.png differ diff --git a/150/index.html b/150/index.html new file mode 100644 index 0000000..ca9ef1a --- /dev/null +++ b/150/index.html @@ -0,0 +1,847 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ +

15-150: Principles of Functional Programming

+ + + + + +
+

If you are a current student in 15-150 during the Summer 2024 semester, please note that some of the content has been changed!

+

In particular, any references to 'totality' are not relevant for your semester. All other information should be accurate.

+

Please also refer to your instructor's excellent notes at http://www.cs.cmu.edu/~15150/lect.html

+

Introduction

+

I had the pleasure of serving as the summer instructor for 15-150, the introduction +functional programming class for computer science students at Carnegie Mellon, in +the Summer 2023 semester.

+

This course typically serves as the second or third course in the traditional +computer science undergraduate sequence, a privilege which not many other universities +get to enjoy, as functional programming is often considered a niche topic.

+

Despite this, I (and CMU) believe this to be of the utmost importance. A disciplined, +type-oriented, safety-first view of programming can be of utmost benefit to burgeoning +computer science scholars, and I have often heard feedback from students that it is has +a transformative view on their perspective of computer science in general.

+

To that end, I have made my lecture materials from my iteration of the course available +for free on the Internet. Please feel free to use this knowledge in any way that you see +fit, and I hope that it aids you in your future endeavors.

+

Lectures

+
+ +
+
+ + +
+
+
+
+ + + + Lecture 01: Prologue + + + +
+ +
+ "Welcome to the rest of your life!" +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 02: Equivalence, Binding, and Scope + + + +
+ +
+ "Equivalences save lives." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 03: Induction and Recursion + + + +
+ +
+ "Recursion is the bread and butter of doing anything in a functional language." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 04: Structural Induction and Tail Recursion + + + +
+ +
+ "Proving things about pretty much any kind of data you can imagine." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 05: Trees + + + +
+ +
+ "Trees are the most fundamental data structure." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 06: Asymptotic Analysis + + + +
+ +
+ "A step is not always a step. We care about analyzing performance mathematically." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 07: Sorting and Parallelism + + + +
+ +
+ "What do we do when we have infinitely many processors?" +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 08: Polymorphism + + + +
+ +
+ "Code reuse at different types, without breaking any of our safety properties." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 09: Higher-Order Functions + + + +
+ +
+ "We can take in functions and also return functions, like any other value." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 10: Combinators and Staging + + + +
+ +
+ "You shouldn't have to wait on something unrelated when you can do work right now." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 11: Continuation-Passing Style + + + +
+ +
+ "CPS is the difference between writing instructions now, or remembering them later." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 12: Exceptions + + + +
+ +
+ "Exceptions make mathematical thinking harder." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 13: Regular Expressions + + + +
+ +
+ "Regular expressions are one of the most practical things you can learn." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 14: Structures and Signatures + + + +
+ +
+ "SML has one of the most sophisticated module systems of any programming language." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 15: Functors + + + +
+ +
+ "Functors will show us how we can write code that depends upon modules." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 16: Red-Black Trees + + + +
+ +
+ "Red-black trees are a very good application of modules for protecting invariants." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 17: Sequences + + + +
+ +
+ "With sequences, we can keep immutability and also have the benefits of arrays." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 18: Lazy Programming + + + +
+ +
+ "With laziness, only pay for for the computations you want to use." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 19: Imperative Programming + + + +
+ +
+ "We invented immutability and purity, but we do not serve them. It's OK to be a little mutable." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 20: Compilers + + + +
+ +
+ "A long time ago, programming languages did not exist." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 21: Program Analysis + + + +
+ +
+ "We are solving an unsolvable problem." +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + Lecture 22: Finale + + + +
+ +
+ "You can never go back, because you are forever a functional programmer." +
+
+ +
+
+
+
+
+

Supplemental Lectures

+ +
+
+ + +
+
+
+
+ + + Supplemental Lecture 01: From SML to OCaml + + +
+
+ "From one language to another." +
+
+
+
+
+
+
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/150/manifest.yaml b/150/manifest.yaml new file mode 100644 index 0000000..f33ebd4 --- /dev/null +++ b/150/manifest.yaml @@ -0,0 +1,110 @@ +- number: 01 + name: prologue + fullname: Prologue + color: "rgb(105, 105, 105)" + quote: "Welcome to the rest of your life!" +- number: 02 + name: equivalence + fullname: Equivalence, Binding, and Scope + color: "rgb(137, 86, 219)" + quote: "Equivalences save lives." +- number: 03 + name: induction + fullname: Induction and Recursion + color: "rgb(13, 158, 131)" + quote: "Recursion is the bread and butter of doing anything in a functional language." +- number: 04 + name: structural + fullname: Structural Induction and Tail Recursion + color: "rgb(69, 209, 143)" + quote: "Proving things about pretty much any kind of data you can imagine." +- number: 05 + name: trees + fullname: Trees + color: "rgb(228, 132, 214)" + quote: "Trees are the most fundamental data structure." +- number: 06 + name: asymptotic + fullname: Asymptotic Analysis + color: "rgb(239, 171, 93)" + quote: "A step is not always a step. We care about analyzing performance mathematically." +- number: 07 + name: parallel + fullname: Sorting and Parallelism + color: "rgb(243, 194, 82)" + quote: "What do we do when we have infinitely many processors?" +- number: 08 + name: poly + fullname: Polymorphism + color: "rgb(229, 71, 53)" + quote: "Code reuse at different types, without breaking any of our safety properties." +- number: 09 + name: hofs + fullname: Higher-Order Functions + color: "rgb(26, 183, 167)" + quote: "We can take in functions and also return functions, like any other value." +- number: 10 + name: staging + fullname: Combinators and Staging + color: "rgb(239, 100, 218)" + quote: "You shouldn't have to wait on something unrelated when you can do work right now." +- number: 11 + name: cps + fullname: Continuation-Passing Style + color: "rgb(35, 113, 240)" + quote: "CPS is the difference between writing instructions now, or remembering them later." +- number: 12 + name: exceptions + fullname: Exceptions + color: "rgb(166, 74, 241)" + quote: "Exceptions make mathematical thinking harder." +- number: 13 + name: regex + fullname: Regular Expressions + color: "rgb(234, 56, 115)" + quote: "Regular expressions are one of the most practical things you can learn." +- number: 14 + name: modules + fullname: Structures and Signatures + color: "rgb(212, 95, 49)" + quote: "SML has one of the most sophisticated module systems of any programming language." +- number: 15 + name: functors + fullname: Functors + color: "rgb(241, 111, 55)" + quote: "Functors will show us how we can write code that depends upon modules." +- number: 16 + name: redblack + fullname: Red-Black Trees + color: "rgb(139, 21, 21)" + quote: "Red-black trees are a very good application of modules for protecting invariants." +- number: 17 + name: seq + fullname: Sequences + color: "rgb(246, 212, 43)" + quote: "With sequences, we can keep immutability and also have the benefits of arrays." +- number: 18 + name: lazy + fullname: Lazy Programming + color: "rgb(73, 220, 237)" + quote: "With laziness, only pay for for the computations you want to use." +- number: 19 + name: imperative + fullname: Imperative Programming + color: "rgb(170, 170, 170)" + quote: "We invented immutability and purity, but we do not serve them. It's OK to be a little mutable." +- number: 20 + name: compilers + fullname: Compilers + color: "rgb(35, 215, 173)" + quote: "A long time ago, programming languages did not exist." +- number: 21 + name: pa + fullname: Program Analysis + color: "rgb(95, 67, 219)" + quote: "We are solving an unsolvable problem." +- number: 22 + name: finale + fullname: Finale + color: "rgb(18, 44, 189)" + quote: "You can never go back, because you are forever a functional programmer." \ No newline at end of file diff --git a/150/manifest_supplemental.yaml b/150/manifest_supplemental.yaml new file mode 100644 index 0000000..fa8d161 --- /dev/null +++ b/150/manifest_supplemental.yaml @@ -0,0 +1,6 @@ +- number: 01 + name: ocaml + fullname: From SML to OCaml + path: sml_to_ocaml + color: "rgb(255, 190, 77)" + quote: "From one language to another." \ No newline at end of file diff --git a/150/ocaml/sml_to_ocaml.pdf b/150/ocaml/sml_to_ocaml.pdf new file mode 100644 index 0000000..ba5ae62 Binary files /dev/null and b/150/ocaml/sml_to_ocaml.pdf differ diff --git a/150/ocaml/sml_to_ocaml.png b/150/ocaml/sml_to_ocaml.png new file mode 100644 index 0000000..81193e0 Binary files /dev/null and b/150/ocaml/sml_to_ocaml.png differ diff --git a/404.html b/404.html new file mode 100644 index 0000000..aba495f --- /dev/null +++ b/404.html @@ -0,0 +1,124 @@ + + + + + +404 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + +
+ + +
+ +
+

Lost?

+

This page does not exist.

+
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/about/index.html b/about/index.html new file mode 100644 index 0000000..d99f830 --- /dev/null +++ b/about/index.html @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ +

About Me

+ + + + + +
+ + + + + + + + +

Hi there! As mentioned on the home page, my name is Brandon Wu, and I work as +a program analysis engineer at a company called +Semgrep, to profoundly improve +the future of software security.

+

I graduated from Carnegie Mellon University in 2022 with a degree in computer science and a concentration in programming +languages, and my interests include functional programming and things +related to functional programming.

+

When I'm not working or teaching (which is not terribly often), I like playing +guitar, listening to musical theater, and consuming content from the Marvel +Cinematic Universe.

+

Academic Interests

+

Academically, I am interested in programming languages, type theory, compilers, +and functional programming. I enjoy elegant and beautiful code, and I believe +that functional programming allows you to express ideas in terse, clear, and +aesthetically pleasing ways. At one point in my life I thought about doing a +Ph.D., but I never really enjoyed research or reading papers, so I went to +the industry instead.

+

My favorite languages include OCaml and Standard ML, +and that's pretty much it. I have a middling understanding of other languages, +but for any problem that I am interested in solving, I would rather do it in +OCaml than really any other alternative, at this point in my career. I have +long-term ambitions to one day actually pick up Haskell and Scala for some reason, +but as of now I have not done so.

+

I think that there is nothing cooler or more interesting than writing code +which works on programs. Compilers, static analysis, and developer tooling +are all use cases that I am very interested in, and I intend to take +advantage of the full employment theorem for the rest of my life.

+

I also think that writing parsers is fun, contrary to the popular belief of +many of my peers. It's like a nice, relaxing sudoku puzzle.

+

Music

+

I listen to a lot of musical theatre, which is not a fact I am normally proud to +disclose, but if anything's to go on the personal website, this is it. I tend +to enjoy more contemporary musicals that are in recent pop culture, so a list +of my top three would probably be:

+
    +
  1. Come From Away
  2. +
  3. Beetlejuice
  4. +
  5. Six
  6. +
+

but honorable mentions include Hamilton, Book of Mormon, and the Lightning +Thief Musical. I used to be a lot more into Dear Evan Hansen, but I think I've +outgrown it, for the most part.

+

Since I graduated college, I've been gradually transitioning away from musical +theatre, and now I listen to more varied stuff, though mostly pop music. I am +a big fan of an indie band called Bug Hunter, Bo Burnham, Olivia Rodrigo, +Taylor Swift, and myriad other random singles.

+

Books

+

I tend to enjoy re-reading things, and the activation energy to start something +new is rather high. Here's some books and other works that I've enjoyed quite +a bit though, in no particular order:

+
    +
  • Worm, by Wildbow
  • +
  • Ra, by qntm
  • +
  • The Mistborn Trilogy, by Brandon Sanderson +
      +
    • Relatedly, The Stormlight Archive, by Brandon Sanderson
    • +
    +
  • +
  • Gödel, Escher, Bach: an Eternal Golden Braid, by Douglas Hofstadter
  • +
  • This Is How They Tell Me the World Ends: The Cyberweapons Arms Race, by Nicole Perlroth
  • +
+

Hopefully this list will expand in the near future.

+

Video Games

+

I used to play far too many video games when I was younger, and now I don't really +play them at all. Here's some I enjoyed a lot, though:

+
    +
  • League of Legends - I played this game for about four years, +and the maximum rank I ever attained was Diamond V. When I was in high school, +I used to run an organization called Ascension eSports, which organized tournaments +for amateur competitive play, which is where I first started teaching, as a team +coach.
  • +
  • Final Fantasy XV - I went through a phase where I consumed all +media related to Final Fantasy XV for a period of about a year, when I was in +high school. I think it's a fantastic tragedy and a beautiful game, executed +very stylishly, and to an amazing soundtrack.
  • +
  • Bioshock Infinite - This one has a similar story, for me, as +Final Fantasy XV, though a few years later. I fully believe in video games as +an art form, and I think the story of Bioshock Infinite is emotionally charged, +philosophically compelling, and ultimately a masterpiece of storytelling through +gaming.
  • +
  • Darkest Dungeon - I have a fair amount of fondness for roguelikes, +and Darkest Dungeon is one of my favorites. I think it hits the jackpot for how +its aesthetics synthesize with its gameplay, to create an immersively brutal +campaign with a satisfying (if enraging) gameplay loop. I have never once in many +hours of playing this game beat the Darkest Dungeon.
  • +
+

The list of games that I want to play grows ever larger with every passing year, +and although I tell myself eventually I will get around to it, the list of things +I need to accomplish in other domains of my life also grows ever larger.

+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/asymptotic/index.html b/asymptotic/index.html new file mode 100644 index 0000000..f03f72c --- /dev/null +++ b/asymptotic/index.html @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 6 - Asymptotic Analysis

+ + + + + + + +
+

Estimating the time complexity of a given function can be a tough task. Usually +such reasoning is done in a casual way, which can mask errors in an analysis. +When reasoning about the runtime of recursive functions, however, it turns out +that we can write recurrence relations, which are mathematical +equations that describe the runtime in a recursive way, and can be solved to +a closed form.

+

We saw how we could examine SML code to obtain these recurrences, which describe +the work, or runtime cost, of a function. By using a simple +unrolling method, we can obtain a closed form, and then derive +an asymptotic bound for a function's cost.

+

Next we introduced the concept of span, which is the work done +by a parallel computer which can evaluate arbitrarily many expressions at the +same time, and saw that we could similarly derive recurrences for estimating the +span of a function.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/asymptotic/lecture06.pdf b/asymptotic/lecture06.pdf new file mode 100644 index 0000000..4fb6499 Binary files /dev/null and b/asymptotic/lecture06.pdf differ diff --git a/asymptotic/lecture06.png b/asymptotic/lecture06.png new file mode 100644 index 0000000..6fe9faa Binary files /dev/null and b/asymptotic/lecture06.png differ diff --git a/blog/index.html b/blog/index.html new file mode 100644 index 0000000..3e3198f --- /dev/null +++ b/blog/index.html @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ + +
+
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/blog/page/1/index.html b/blog/page/1/index.html new file mode 100644 index 0000000..737b796 --- /dev/null +++ b/blog/page/1/index.html @@ -0,0 +1,6 @@ + + + + +Redirect +

Click here to be redirected.

diff --git a/buttons.css b/buttons.css new file mode 100644 index 0000000..462f45e --- /dev/null +++ b/buttons.css @@ -0,0 +1 @@ +.button-container{display:table;margin-left:auto;margin-right:auto}button,.button,a.button{position:relative;display:flex;align-items:center;justify-content:center;padding:8px 18px;margin-bottom:5px;text-align:center;border-radius:8px;border:1px solid rgba(0,0,0,0);appearance:none;cursor:pointer;outline:none;}button.outline,.button.outline,a.button.outline{background:rgba(0,0,0,0);box-shadow:none;padding:8px 18px}button.outline :hover,.button.outline :hover,a.button.outline :hover{transform:none;box-shadow:none}button.primary,.button.primary,a.button.primary{box-shadow:0 4px 6px rgba(50,50,93,.11),0 1px 3px rgba(0,0,0,.08)}button.primary:hover,.button.primary:hover,a.button.primary:hover{box-shadow:0 2px 6px rgba(50,50,93,.21),0 1px 3px rgba(0,0,0,.08)}button.link,.button.link,a.button.link{background:none;font-size:1rem}button.small,.button.small,a.button.small{font-size:.8rem}button.wide,.button.wide,a.button.wide{min-width:200px;padding:14px 24px}a.read-more,a.read-more:hover,a.read-more:active{display:inline-flex;background:none;box-shadow:none;padding:0;margin:20px 0;max-width:100%}.code-toolbar{margin-bottom:20px}.code-toolbar .toolbar-item a{position:relative;display:inline-flex;align-items:center;justify-content:center;padding:3px 8px;margin-bottom:5px;text-align:center;font-size:13px;font-weight:500;border-radius:8px;border:1px solid rgba(0,0,0,0);appearance:none;cursor:pointer;outline:none} \ No newline at end of file diff --git a/color/background_auto.css b/color/background_auto.css new file mode 100644 index 0000000..a14b617 --- /dev/null +++ b/color/background_auto.css @@ -0,0 +1 @@ +@media (prefers-color-scheme: light){:root{--background: white;--color: #101010}}@media (prefers-color-scheme: dark){:root{--background: #101010;--color: #A9B7C6}} \ No newline at end of file diff --git a/color/background_blue.css b/color/background_blue.css new file mode 100644 index 0000000..084eec8 --- /dev/null +++ b/color/background_blue.css @@ -0,0 +1 @@ +:root{--background: #1D212C} \ No newline at end of file diff --git a/color/background_dark.css b/color/background_dark.css new file mode 100644 index 0000000..c1b491b --- /dev/null +++ b/color/background_dark.css @@ -0,0 +1 @@ +:root{--background: #101010;--color: #A9B7C6} \ No newline at end of file diff --git a/color/background_green.css b/color/background_green.css new file mode 100644 index 0000000..de564d5 --- /dev/null +++ b/color/background_green.css @@ -0,0 +1 @@ +:root{--background: #1F222A} \ No newline at end of file diff --git a/color/background_light.css b/color/background_light.css new file mode 100644 index 0000000..ea0bc08 --- /dev/null +++ b/color/background_light.css @@ -0,0 +1 @@ +:root{--background: #f0f0f0} \ No newline at end of file diff --git a/color/background_orange.css b/color/background_orange.css new file mode 100644 index 0000000..8d64140 --- /dev/null +++ b/color/background_orange.css @@ -0,0 +1 @@ +:root{--background: #222129} \ No newline at end of file diff --git a/color/background_pink.css b/color/background_pink.css new file mode 100644 index 0000000..17693cb --- /dev/null +++ b/color/background_pink.css @@ -0,0 +1 @@ +:root{--background: #21202C} \ No newline at end of file diff --git a/color/background_red.css b/color/background_red.css new file mode 100644 index 0000000..3605399 --- /dev/null +++ b/color/background_red.css @@ -0,0 +1 @@ +:root{--background: #221F29} \ No newline at end of file diff --git a/color/blue-auto.css b/color/blue-auto.css new file mode 100644 index 0000000..56ff54f --- /dev/null +++ b/color/blue-auto.css @@ -0,0 +1 @@ +@media (prefers-color-scheme: dark){:root{--accent: rgb(35,176,255);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #101010;--color: #f0f0f0;--border-color: rgba(255,240,224,.125)}:root div.logo{color:#000}}@media (prefers-color-scheme: light){:root{--accent: rgb(32,128,192);--accent-alpha-70: rgba(32,128,192,.7);--accent-alpha-20: rgba(32,128,192,.2);--background: white;--color: #201030;--border-color: rgba(0,0,16,.125)}:root div.logo{color:#fff}} \ No newline at end of file diff --git a/color/blue-light.css b/color/blue-light.css new file mode 100644 index 0000000..2e8deda --- /dev/null +++ b/color/blue-light.css @@ -0,0 +1 @@ +:root{--accent: rgb(32,128,192);--accent-alpha-70: rgba(32,128,192,.7);--accent-alpha-20: rgba(32,128,192,.2);--background: white;--color: #1D212C;--border-color: rgba(0, 0, 0, .1)}:root div.logo{color:#fff} \ No newline at end of file diff --git a/color/blue.css b/color/blue.css new file mode 100644 index 0000000..b5ee951 --- /dev/null +++ b/color/blue.css @@ -0,0 +1 @@ +:root{--accent: rgb(35,176,255);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1D212C;--color: white;--border-color: rgba(255, 255, 255, .1)} \ No newline at end of file diff --git a/color/green-auto.css b/color/green-auto.css new file mode 100644 index 0000000..e671b44 --- /dev/null +++ b/color/green-auto.css @@ -0,0 +1 @@ +@media (prefers-color-scheme: dark){:root{--accent: rgb(120,226,160);--accent-alpha-70: rgba(120,226,160,.7);--accent-alpha-20: rgba(120,226,160,.2);--background: #101010;--color: #f0f0f0;--border-color: rgba(255,240,224,.125)}:root div.logo{color:#000}}@media (prefers-color-scheme: light){:root{--accent: rgb(24, 192, 128);--accent-alpha-70: rgba(24, 192, 128,.7);--accent-alpha-20: rgba(24, 192, 128,.2);--background: white;--color: #201030;--border-color: rgba(0,0,16,.125)}:root div.logo{color:#fff}} \ No newline at end of file diff --git a/color/green-light.css b/color/green-light.css new file mode 100644 index 0000000..6788de0 --- /dev/null +++ b/color/green-light.css @@ -0,0 +1 @@ +:root{--accent: rgb(24, 192, 128);--accent-alpha-70: rgba(24, 192, 128,.7);--accent-alpha-20: rgba(24, 192, 128,.2);--background: white;--color: #1D212C;--border-color: rgba(0, 0, 0, .1)}:root div.logo{color:#fff} \ No newline at end of file diff --git a/color/green.css b/color/green.css new file mode 100644 index 0000000..e622015 --- /dev/null +++ b/color/green.css @@ -0,0 +1 @@ +:root{--accent: rgb(120,226,160);--accent-alpha-70: rgba(120,226,160,.7);--accent-alpha-20: rgba(120,226,160,.2);--background: #1F222A;--color: white;--border-color: rgba(255, 255, 255, .1)} \ No newline at end of file diff --git a/color/lecture_black.css b/color/lecture_black.css new file mode 100644 index 0000000..cba38f2 --- /dev/null +++ b/color/lecture_black.css @@ -0,0 +1 @@ +:root{--accent: rgb(105, 105, 105);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_blue.css b/color/lecture_blue.css new file mode 100644 index 0000000..c888a62 --- /dev/null +++ b/color/lecture_blue.css @@ -0,0 +1 @@ +:root{--accent: rgb(35, 113, 240);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_brown.css b/color/lecture_brown.css new file mode 100644 index 0000000..7d876ce --- /dev/null +++ b/color/lecture_brown.css @@ -0,0 +1 @@ +:root{--accent: rgb(212, 95, 49);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_cool_purple.css b/color/lecture_cool_purple.css new file mode 100644 index 0000000..212ec78 --- /dev/null +++ b/color/lecture_cool_purple.css @@ -0,0 +1 @@ +:root{--accent: rgb(95, 67, 219);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_dark_blue.css b/color/lecture_dark_blue.css new file mode 100644 index 0000000..419ad4c --- /dev/null +++ b/color/lecture_dark_blue.css @@ -0,0 +1 @@ +:root{--accent: rgb(18, 44, 189);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_dark_orange.css b/color/lecture_dark_orange.css new file mode 100644 index 0000000..be74cdb --- /dev/null +++ b/color/lecture_dark_orange.css @@ -0,0 +1 @@ +:root{--accent: rgb(241, 111, 55);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_dark_red.css b/color/lecture_dark_red.css new file mode 100644 index 0000000..1c66e5c --- /dev/null +++ b/color/lecture_dark_red.css @@ -0,0 +1 @@ +:root{--accent: rgb(139, 21, 21);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_gold.css b/color/lecture_gold.css new file mode 100644 index 0000000..6cd821b --- /dev/null +++ b/color/lecture_gold.css @@ -0,0 +1 @@ +:root{--accent: rgb(243, 194, 82);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_gold2.css b/color/lecture_gold2.css new file mode 100644 index 0000000..38704e4 --- /dev/null +++ b/color/lecture_gold2.css @@ -0,0 +1 @@ +:root{--accent: rgb(255, 190, 77);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_green.css b/color/lecture_green.css new file mode 100644 index 0000000..1bb0bf5 --- /dev/null +++ b/color/lecture_green.css @@ -0,0 +1 @@ +:root{--accent: rgb(69, 209, 143);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_grey.css b/color/lecture_grey.css new file mode 100644 index 0000000..de79dd6 --- /dev/null +++ b/color/lecture_grey.css @@ -0,0 +1 @@ +:root{--accent: rgb(170, 170, 170);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_hot_pink.css b/color/lecture_hot_pink.css new file mode 100644 index 0000000..df213f7 --- /dev/null +++ b/color/lecture_hot_pink.css @@ -0,0 +1 @@ +:root{--accent: rgb(239, 100, 218);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_light_blue.css b/color/lecture_light_blue.css new file mode 100644 index 0000000..5e61e4a --- /dev/null +++ b/color/lecture_light_blue.css @@ -0,0 +1 @@ +:root{--accent: rgb(73, 220, 237);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_light_purple.css b/color/lecture_light_purple.css new file mode 100644 index 0000000..683c23b --- /dev/null +++ b/color/lecture_light_purple.css @@ -0,0 +1 @@ +:root{--accent: rgb(166, 74, 241);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_light_turquoise.css b/color/lecture_light_turquoise.css new file mode 100644 index 0000000..cb96614 --- /dev/null +++ b/color/lecture_light_turquoise.css @@ -0,0 +1 @@ +:root{--accent: rgb(35, 215, 173);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_orange.css b/color/lecture_orange.css new file mode 100644 index 0000000..3735a25 --- /dev/null +++ b/color/lecture_orange.css @@ -0,0 +1 @@ +:root{--accent: rgb(239, 171, 93);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_pink.css b/color/lecture_pink.css new file mode 100644 index 0000000..297b812 --- /dev/null +++ b/color/lecture_pink.css @@ -0,0 +1 @@ +:root{--accent: rgb(228, 132, 214);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_pinkish_red.css b/color/lecture_pinkish_red.css new file mode 100644 index 0000000..9b36964 --- /dev/null +++ b/color/lecture_pinkish_red.css @@ -0,0 +1 @@ +:root{--accent: rgb(234, 56, 115);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_purple.css b/color/lecture_purple.css new file mode 100644 index 0000000..98b835b --- /dev/null +++ b/color/lecture_purple.css @@ -0,0 +1 @@ +:root{--accent: rgb(137, 86, 219);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_red.css b/color/lecture_red.css new file mode 100644 index 0000000..dcda3dd --- /dev/null +++ b/color/lecture_red.css @@ -0,0 +1 @@ +:root{--accent: rgb(229, 71, 53);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_teal.css b/color/lecture_teal.css new file mode 100644 index 0000000..ba3b582 --- /dev/null +++ b/color/lecture_teal.css @@ -0,0 +1 @@ +:root{--accent: rgb(13, 158, 131);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_turquoise.css b/color/lecture_turquoise.css new file mode 100644 index 0000000..a3c5ead --- /dev/null +++ b/color/lecture_turquoise.css @@ -0,0 +1 @@ +:root{--accent: rgb(26, 183, 167);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/lecture_yellow.css b/color/lecture_yellow.css new file mode 100644 index 0000000..8994a6c --- /dev/null +++ b/color/lecture_yellow.css @@ -0,0 +1 @@ +:root{--accent: rgb(246, 212, 43);--accent-alpha-70: rgba(35,176,255,.7);--accent-alpha-20: rgba(35,176,255,.2);--background: #1d212c;--color: #fff;--border-color: rgba(255,255,255,.1)} \ No newline at end of file diff --git a/color/orange-auto.css b/color/orange-auto.css new file mode 100644 index 0000000..50ee1d8 --- /dev/null +++ b/color/orange-auto.css @@ -0,0 +1 @@ +@media (prefers-color-scheme: dark){:root{--accent: rgb(255,168,106);--accent-alpha-70: rgba(255,168,106,.7);--accent-alpha-20: rgba(255,168,106,.2);--background: #101010;--color: #f0f0f0;--border-color: rgba(255,240,224,.125)}:root div.logo{color:#000}}@media (prefers-color-scheme: light){:root{--accent: rgb(240,128,48);--accent-alpha-70: rgba(240,128,48,.7);--accent-alpha-20: rgba(240,128,48,.2);--background: white;--color: #201030;--border-color: rgba(0,0,16,.125)}:root div.logo{color:#fff}} \ No newline at end of file diff --git a/color/orange-light.css b/color/orange-light.css new file mode 100644 index 0000000..979f284 --- /dev/null +++ b/color/orange-light.css @@ -0,0 +1 @@ +:root{--accent: rgb(240,128,48);--accent-alpha-70: rgba(240,128,48,.7);--accent-alpha-20: rgba(240,128,48,.2);--background: white;--color: #1D212C;--border-color: rgba(0, 0, 0, .1)}:root div.logo{color:#fff} \ No newline at end of file diff --git a/color/orange.css b/color/orange.css new file mode 100644 index 0000000..3f1a992 --- /dev/null +++ b/color/orange.css @@ -0,0 +1 @@ +:root{--accent: rgb(255,168,106);--accent-alpha-70: rgba(255,168,106,.7);--accent-alpha-20: rgba(255,168,106,.2);--background: #222129;--color: white;--border-color: rgba(255, 255, 255, .1)} \ No newline at end of file diff --git a/color/pink-auto.css b/color/pink-auto.css new file mode 100644 index 0000000..34df818 --- /dev/null +++ b/color/pink-auto.css @@ -0,0 +1 @@ +@media (prefers-color-scheme: dark){:root{--accent: rgb(224,64,192);--accent-alpha-70: rgba(224,64,192);--accent-alpha-20: rgba(224,64,192,.2);--background: #101010;--color: #f0f0f0;--border-color: rgba(255,240,224,.125)}:root div.logo{color:#000}}@media (prefers-color-scheme: light){:root{--accent: rgb(238,114,241);--accent-alpha-70: rgba(238,114,241,.7);--accent-alpha-20: rgba(238,114,241,.2);--background: white;--color: #201030;--border-color: rgba(0,0,16,.125)}:root div.logo{color:#fff}} \ No newline at end of file diff --git a/color/pink-light.css b/color/pink-light.css new file mode 100644 index 0000000..881f216 --- /dev/null +++ b/color/pink-light.css @@ -0,0 +1 @@ +:root{--accent: rgb(224,64,192);--accent-alpha-70: rgba(224,64,192);--accent-alpha-20: rgba(224,64,192,.2);--background: white;--color: #1D212C;--border-color: rgba(0, 0, 0, .1)}:root div.logo{color:#fff} \ No newline at end of file diff --git a/color/pink.css b/color/pink.css new file mode 100644 index 0000000..f2c4c43 --- /dev/null +++ b/color/pink.css @@ -0,0 +1 @@ +:root{--accent: rgb(238,114,241);--accent-alpha-70: rgba(238,114,241,.7);--accent-alpha-20: rgba(238,114,241,.2);--background: #21202C;--color: white;--border-color: rgba(255, 255, 255, .1)} \ No newline at end of file diff --git a/color/red-auto.css b/color/red-auto.css new file mode 100644 index 0000000..d0c7147 --- /dev/null +++ b/color/red-auto.css @@ -0,0 +1 @@ +@media (prefers-color-scheme: dark){:root{--accent: rgb(255,98,102);--accent-alpha-70: rgba(255,98,102,.7);--accent-alpha-20: rgba(255,98,102,.2);--background: #101010;--color: #f0f0f0;--border-color: rgba(255,240,224,.125)}:root div.logo{color:#000}}@media (prefers-color-scheme: light){:root{--accent: rgb(240,48,64);--accent-alpha-70: rgba(240,48,64,.7);--accent-alpha-20: rgba(240,48,64,.2);--background: white;--color: #201030;--border-color: rgba(0,0,16,.125)}:root div.logo{color:#fff}} \ No newline at end of file diff --git a/color/red-light.css b/color/red-light.css new file mode 100644 index 0000000..a854a79 --- /dev/null +++ b/color/red-light.css @@ -0,0 +1 @@ +:root{--accent: rgb(240,48,64);--accent-alpha-70: rgba(240,48,64,.7);--accent-alpha-20: rgba(240,48,64,.2);--background: white;--color: #1D212C;--border-color: rgba(0, 0, 0, .1)}:root div.logo{color:#fff} \ No newline at end of file diff --git a/color/red.css b/color/red.css new file mode 100644 index 0000000..3b1e34a --- /dev/null +++ b/color/red.css @@ -0,0 +1 @@ +:root{--accent: rgb(255,98,102);--accent-alpha-70: rgba(255,98,102,.7);--accent-alpha-20: rgba(255,98,102,.2);--background: #221F29;--color: white;--border-color: rgba(255, 255, 255, .1)} \ No newline at end of file diff --git a/color/variables.css b/color/variables.css new file mode 100644 index 0000000..e69de29 diff --git a/compilers/index.html b/compilers/index.html new file mode 100644 index 0000000..e8012a4 --- /dev/null +++ b/compilers/index.html @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 20 - Special Topics: Compilers

+ + + + + + + +
+

Compilers are one of the most interesting and essential advances in the field of +computer science, which form the backbone of every piece of software that has ever +been produced in the world today.

+

Functional programming is good for many things, but in particular, writing +compilers is an extremely powerful use case for it. In this lecture, we went +over the historical context behind compilers, the theory behind how they +operate, and the bird's-eye view for the various steps behind implementing a +compiler.

+

We went specifically into the phases of a compiler, lexing, +parsing, IR generation, optimization, +and code generation. Each of these presents their own theory and challenges, but many benefit from the kind of rich data that can be described by +algebraic datatypes.

+

Ultimately, programs are themselves representable by data structures, +and a program really is just a fancy kind of tree. Compilers must be able to read +and interpret programs, so compilers can be seen as really nothing more than a +series of pure transformations on trees, which functional programming excels at.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/compilers/lecture20.pdf b/compilers/lecture20.pdf new file mode 100644 index 0000000..dd1fa4e Binary files /dev/null and b/compilers/lecture20.pdf differ diff --git a/compilers/lecture20.png b/compilers/lecture20.png new file mode 100644 index 0000000..e97f3c1 Binary files /dev/null and b/compilers/lecture20.png differ diff --git a/courses/index.html b/courses/index.html new file mode 100644 index 0000000..e2d8bb9 --- /dev/null +++ b/courses/index.html @@ -0,0 +1,394 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Courses

+ + + + + +
+

In keeping with my fellow CMU alumni, I feel obligated to write down a +record and review of each semester of courses that I took while I was +an undergraduate, because I have frighteningly little personality +outside of my education.

+

Here, I am using colors to signify classes that I thought were particularly +noteworthy. Colored in green will be classes that I thought were +particularly thought-provoking or well-taught. Colored in magenta will be classes that I thought were life-changing.

+

(Freshman) Fall 2018

+
    +
  • 15-122: Principles of Imperative Computation
  • +
  • 21-127: Concepts of Mathematics
  • +
  • 21-241: Matrices and Linear Transformations
  • +
  • 66-106: Quantitative Social Science Scholars Freshman Seminar
  • +
  • 79-104: Global Histories
  • +
  • 85-150: Cognitive Science at CMU and Beyond
  • +
  • 98-194: (StuCo) Puzzle Hunts
  • +
+

Extracurriculars: A cappella

+

This semester was a whirlwind of adjusting to college life, having things to do +outside of video games in my free time, and learning how to learn. In +retrospect, the workload was far less than what I would become used to later, +but my ability to take on more increased exponentially over the course of this +first year.

+

I had never done proof-based mathematics before, so Concepts gets the credit here +for introducing me to aspects of math that I didn't know existed. While everything +I was learning was hard, I was also loving the fact that I was learning things that +I thought were cool and interesting, which I never really got in high school.

+

I definitely also learned a lot from 122, but most of it was just getting +practice with programming, and practice with actually thinking while +programming. As an introductory course, it was pretty good, but I don't think it +was noteworthy enough for a special mention.

+

Generally, the other classes were chores that I tried to get done quickly so I could +focus on other things. I appreciated Ricky Law's enthusiasm for 79-104 a lot, though.

+

(Freshman) Spring 2019

+
    +
  • 15-150: Principles of Functional Programming
  • +
  • 15-381: Artificial Intelligence Representation and Problem-Solving
  • +
  • 76-106: Writing about Literature and Art
  • +
  • 76-108: Writing about Public Problems
  • +
  • 80-251: Kant
  • +
  • 85-412: Cognitive Modeling
  • +
+

Extracurriculars: A cappella

+

I found this semester a lot less cohesive than the last, because it +seemed like my attention was fragmented between many unrelated things, +whereas the previous semester just felt like a fundamental core, plus +a few extra things. In terms of my internal storyboard, this matters.

+

I have some scattered thoughts:

+
    +
  • 150 gets the position as one of the few CS courses I took where I did not fall +asleep most lectures. I found it very interesting to be learning something which +was a brand new paradigm that I had never seen before, and it tickled a part of +my brain which was looking for elegance and beauty, that I began to nurture over +the course of the next few years.
  • +
  • Writing about Public Problems was an unexpectedly good course, where I felt like +I could write about something which actually mattered. Unfortunately, it was +only a half-semester course, and by "unexpectedly good", I just mean that I +spent only a moderate amount of time completing things haphazardly, rather than +most of the time.
  • +
  • I took 381 expecting AI to be something that I would be good at, or enjoy, due +to being a cognitive science major interested in computer science. I found that +neither of those things were true, unfortunately.
  • +
  • Cognitive Modeling was interesting, but it's where I first began to experience +dissonance with cognitive science, because it felt to me like there should be +something more principled than just fine tuning parameters to get models to +produce marginally human behavior. I began to get quite weary of experimental +results and approximations -- I wanted something more fundamental.
  • +
+

(Freshman) Summer 2019

+

This summer, I worked in the HoltLab and Lab in Multisensory Neuroscience, under +Dr. Neeraj Sharma (under Profs. Barbara Shinn-Cunningham and Lori Holt).

+

This summer, I was working using machine learning to classify EEG data, and +I worked on an autoencoder to try and capture the essential features for that +classification task. I learned a lot about practically using machine learning +libraries in Python, signal processing, and principal components analysis.

+

(Sophomore) Fall 2019

+
    +
  • 15-213: Introduction to Computer Systems
  • +
  • 15-251: Great Theoretical Ideas in Computer Science
  • +
  • 85-213: Human Information Processing and Artificial Intelligence
  • +
  • 85-219: Biological Foundations of Behavior
  • +
+

Extracurriculars: Alpha Epsilon Pi, TA for 15-150, a cappella

+

I think every waking moment I spent this semester was running to and from 213 +labs, 251 problem sets, and 150 commitments. I spent many evenings in 251 office +hours. I would not recommend taking both of these courses together.

+

Despite the fact that I had almost no free time, I thought that both classes +were extremely interesting, and only cemented my interest in computer science +further. I think this is the semester where I began to realize that I could +really pursue computer science, that it was something that was within my +ability.

+

In addition, this was the first semester where I started TAing! 150 was a great +time, and it was when I started to meet people outside of my friends from +freshman year and Discord. Overall, I experienced a great tonal shift this +semester, in terms of my own self-image.

+

(Sophomore) Spring 2020

+
    +
  • 15-210: Parallel and Sequential Data Structures and Algorithms
  • +
  • 15-259: Probability and Computing
  • +
  • 15-455: Undergraduate Complexity Theory
  • +
  • 33-104: Experimental Physics
  • +
  • 98-242: (StuCo) Esoteric Programming Languages
  • +
  • 98-317: (StuCo) Hype for Types
  • +
  • 98-360: (StuCo) GEB
  • +
+

Extracurriculars: Alpha Epsilon Pi, TA for 15-150, a cappella

+

This semester was the first semester of COVID, so there was an abrupt shift in +this semester, and towards the latter half I definitely stopped caring as much +about school.

+
    +
  • Students tend to fall into a bucket of enjoying 213 or 210, and to my surprise, +given that 210 was in SML, I was in the 213 bucket. It was a fine class, but I +had better things to do, and I'm not very good at coming up with algorithms, it +turns out.
  • +
  • I was very excited about complexity theory, but I thought we spent too long on +some topics, and while some other students could appreciate Klaus' detours into +CDM-level math, I was not one such student, so I learned that the latter half of +every lecture, I could pretty much not understand.
  • +
  • Experimental physics also was unbearable for me, I hate experiments +(Anderson was great though).
  • +
  • Mor Harchol-Balter is great, and so is PNC. I don't enjoy probability (or math +involving numbers) very much, but she has a way of engaging the audience that I +found very compelling. I didn't get any chocolate, but I have lots of fond memories +of the course.
  • +
+

This was the semester where I completed my transfer into computer science. It was +a great weight off my shoulders to realize that I was finally free to study +the things that I wanted to study.

+

(Sophomore) Summer 2020

+

This was the first summer of COVID, so while I had an internship at IBM, I ended up +doing it remotely back home for the whole summer. This, put simply, kind of sucked. +I also got a project which was not particularly interesting to me, since it was a +rehash of a 213 assignment (ProxyLab) in C, and I at no point wrote code which anyone +actually tested, I'm pretty sure.

+

In addition, I TA'd for 150 and 213 this summer. Originally, the plan was that since +150 was a half-summer course, I would TA 150 for one half and 213 for the other. +Unfortunately, nobody actually stopped me from TAing for both, so I ended up +juggling my internship, TAing for 150, and TAing for 213. This meant some days +I was in office hours for four hours straight. I would not recommend this.

+

This was also the summer I wrote SML Help (most of it).

+

(Junior) Fall 2020

+
    +
  • 15-312: Foundations of Programming Languages
  • +
  • 15-317: Constructive Logic
  • +
  • 15-459: Quantum Computation
  • +
  • 21-373: Algebraic Structures
  • +
  • 80-413: Category Theory
  • +
+

Extracurriculars: Head TA for 15-150

+

There is precisely one class on this entire list that I felt was deserving of life-changing, +and that is 15-312. I thought about whether 15-150 should be one, but I only really began +to appreciate and understand 150 after I took it, while I was TAing, so I wouldn't have +said it changed my life as I was taking it.

+

15-312 changed my life as I was taking it. Bob Harper's teaching style was so amazingly +infectious and exciting that, after semesters of being at CMU, I felt like I was finally +understood. This class showed me exactly the fundamentals I was looking for, with all +the elegance and beauty that I wanted. I could not think about programming languages +the same way, after this course. I can recommend no other course more highly.

+

This was probably my favorite semester, academically speaking, at CMU. After a few +semesters of TAing 150, I had begun to learn snippets and whispers of the programming +language theory that it hinted at, and this semester I decided to go all in. Bob Harper +has an idea of "computational trinitarianism", comprised of logic, computer science, and +math. This was my computational trinitarinism semester. Every class, I felt like I learned +something which only peeled the curtain of reality back further, and everything was +wonderfully interconnected.

+
    +
  • Clogic was a pretty interesting class, but it annoyed me that there were so +many people taking the course purely for the requirement, whereas I was there +because of my interest. I felt like the course could have been more in-depth +if not for that.
  • +
  • Algebraic structures was terrible, and I could have learned an equivalent amount +purely out of reading Dummit & Foote.
  • +
  • Category theory was very interesting, albeit a little too abstract for me. I +think I would have gotten more appreciation had it been taught with more of the +computer science perspective in mind, as I did not have enough background math +knowledge to really appreciate it.
  • +
  • Quantum computation was unrelated to all the PL stuff, but it was actually a +great course too -- Ryan O'Donnell is a terrific professor. While I am certain I +will use none of the information I learned in this course again in my life, it +was a lot of fun.
  • +
+

(Junior) Spring 2021

+
    +
  • 15-451: Algorithm Design and Analysis
  • +
  • 15-539: CS Pedagogy
  • +
  • 15-745: Optimizing Compilers for Modern Architectures
  • +
  • 15-819: Computational Type Theory
  • +
  • 33-114: Physics of Musical Sound
  • +
  • 80-514: Categorical Logic
  • +
+

Extracurriculars: Head TA for 15-150

+

This is the beginning of the end, for my CS education, because this is the last semester +where I took a significant load. At this point, courses were still remote, for the most +part, and after the excitement of the previous semester, this selection of courses just +couldn't measure up. I spent most of this semester procrastinating and burning out of +my ability to do coursework.

+
    +
  • Bob's grad class was great, but unfortunately due to my lack of motivation, I didn't +do most of the homeworks. This had the unfortunate effect of ensuring that I learned very +little from the class, which was not Bob's fault.
  • +
  • I also found categorical logic rather +uninteresting, because I wanted something that was more based in the computer science +aspects of category theory.
  • +
  • Optimizing Compilers would have been a better course, were I not to be so burned out. +Unfortunately, the prospect of working on C++ fatigued me quite a bit, and I felt like +the class was more of an algorithms class than the compilers part.
  • +
  • 451 was fun at times, but only because there were leaderboards for the fastest submission +to solve a certain problem, and I took it as a personal challenge to try to beat as many +people as possible with SML. I think I got top 10 at one point. Otherwise, it was a little +too theoretical for me at times.
  • +
  • CS Pedagogy was something I was interested in, but unfortunately I found it to not +quite match up to what I was looking for. The course was mainly focused on content +creation for CS Academy, and while we had a few fun seminars where we discussed +pedagogical topics, those were rare occasions. I was moreso looking for something +where we could discuss/learn more science-based techniques to pedagogy.
  • +
+

(Junior) Summer 2021

+

This summer, I was an intern at Facebook (then called Facebook), working on the Pyre +team, which is a Python type-checker written in OCaml. I'm pretty sure for the team +selection form I made it very clear I wanted to work on something functional, and I am +very glad that it ended up happening.

+

I thought this was a great summer. For one thing, although it was still remote, I was +able to get corporate housing, which meant I didn't need to be at home. The housing +was in Emeryville, and no one lives in Emeryville, to be fair, but it was nice to be +in California nonetheless.

+

I learned a lot about software engineering this summer, and I think this was the most +essential thing for my career after college, that I had already had experience with PRs +and Git and writing production OCaml. My project had to do with implementing shape types +for tensors, so that shape mismatches could statically be caught by Pyre, which I thought +was super cool. At one point, I got to present my work to Guido van Rossum himself!

+

(Senior) Fall 2021

+
    +
  • 15-300: Research and Innovation in Computer Science
  • +
  • 15-411: Compiler Design
  • +
  • 15-591: Independent Study in Computer Science
  • +
+

Extracurriculars: TA for 15-312, Vice President for AEPi, StuCo instructor (x2)

+

This semester, I became Vice President for AEPi, and started doing that as basically a +full-time job. Compilers was definitely an interesting course, albeit one whose 8am +lectures I could not possibly wake up in time for, and I enjoyed doing the homeworks +(and working in OCaml) quite a bit.

+

I started doing a senior thesis this semester, but I ultimately ended up dropping it +by the spring. I'd spent quite a bit of time debating about whether or not I should go +to the industry, or pursue academia, and I came to realize that research is just not +something that I enjoy doing.

+

(Senior) Spring 2022

+
    +
  • 17-355: Program Analysis
  • +
  • 79-320: Women, Politics, and Protest
  • +
  • 98-008: (StuCo) Shilling the Rust Programming Language
  • +
+

Extracurriculars: TA for 15-150, Vice President for AEPi, Greek Sing, StuCo instructor (x2)

+

I pretty much took a single class this semester, and focused on Greek Sing for +the rest of it. Sorry to say that I don't really have much to say, here. I found program +analysis really quite dry, and spending four weeks on dataflow analysis was a surefire way +to get me to mentally check out of the class completely.

+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/cps/index.html b/cps/index.html new file mode 100644 index 0000000..8405648 --- /dev/null +++ b/cps/index.html @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 11 - Continuation-Passing Style

+ + + + + + + +
+

So far in this course, we have used accumulators as tools to implement +functions which are tail recursive, by storing our intermediate computations +in an extra argument to the function in question, as we recurse.

+

Continuation-passing style is a natural extension of accumulation, +where instead of using an accumulator of a type like int, the accumulator is a +function which represents the work left to do by the function. This allows us +to store computations in our accumulator argument, called the continuation, and discharge them all at a later time.

+

Philosophically, continuation-passing style can be seen as contrasting to +direct-style recursion by noting down instructions of what instructions to execute, +rather than executing instructions themselves and storing the results in the +accumulator. These end up being spiritually the same information, but having +slightly different implications for implementation.

+

We saw that we could use continuation-passing style to make the control flow of +our programs extremely clear, and implement backtracking and doubly-recursing +functions easily via using them. Written in such a way, these programs have a +more explicit evaluation order, and rely less on implicit evaluation rules.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/cps/lecture11.pdf b/cps/lecture11.pdf new file mode 100644 index 0000000..ce8afee Binary files /dev/null and b/cps/lecture11.pdf differ diff --git a/cps/lecture11.png b/cps/lecture11.png new file mode 100644 index 0000000..f7314cd Binary files /dev/null and b/cps/lecture11.png differ diff --git a/creative/behind.jpg b/creative/behind.jpg new file mode 100644 index 0000000..28c3d37 Binary files /dev/null and b/creative/behind.jpg differ diff --git a/creative/closeup.jpg b/creative/closeup.jpg new file mode 100644 index 0000000..be8de0d Binary files /dev/null and b/creative/closeup.jpg differ diff --git a/creative/colors.jpg b/creative/colors.jpg new file mode 100644 index 0000000..6df728f Binary files /dev/null and b/creative/colors.jpg differ diff --git a/creative/dance.jpg b/creative/dance.jpg new file mode 100644 index 0000000..02a9c1d Binary files /dev/null and b/creative/dance.jpg differ diff --git a/creative/ending.jpg b/creative/ending.jpg new file mode 100644 index 0000000..88e165b Binary files /dev/null and b/creative/ending.jpg differ diff --git a/creative/farewell.jpg b/creative/farewell.jpg new file mode 100644 index 0000000..d3e368c Binary files /dev/null and b/creative/farewell.jpg differ diff --git a/creative/fight.jpg b/creative/fight.jpg new file mode 100644 index 0000000..0c8779a Binary files /dev/null and b/creative/fight.jpg differ diff --git a/creative/index.html b/creative/index.html new file mode 100644 index 0000000..4feecb1 --- /dev/null +++ b/creative/index.html @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ +

Creative

+ + + + + +
+

I believe that everyone should have three prevailing components in their life, +which are a working/intellectual component, a social component, and a creative component. Several +times I have witnessed that I experience burnout because I focused too hard on +one category without allowances for the other two, so it's important that all +three remain important in my life.

+

Sometimes, I do creative things. Primarily, I'm interested in theatre, +singing, and making music, but I also have mild interests in technical +and creative writing, design, and filmmaking.

+

Theatre

+

In my senior year of undergrad, I had the privilege to serve as +Head Greek Sing Chair for my fraternity, Alpha Epsilon Pi, which entailed +putting on a fifteen-minute long production of the musical Come From Away.

+ + + + + + + + +

This project was my life for several months, and remains one of my proudest +creations and fondest memories to this day. I think that there is +unmatched meaning and fulfillment in storytelling, and the opportunity to work +with others to tell such a weighty story about community, compassion, and loss, +was one that I will not soon forget.

+

The show is available to watch online here.

+

Music

+

I picked up the guitar during my senior year of college, and it is one of my +main hobbies. I don't really have anything to share here, as I'm +not yet at the level of skill where I'm happy with what I can produce, but I'm +inching closer every day.

+

I was in an a cappella group called Hillelujah in college, though. +Here's a video of us performing at +Kol Haolam, the annual national Jewish a cappella +competition, in 2019.

+

Filmmaking

+

I find the medium of film an interesting one because of the unique presence of +the elements of visual, audio, and storytelling elements. On various occasions +in my life, I've had reason to work on a video project, and I find it a very +relaxing process to mentally storyboard a project and edit it to the way that +I like.

+

Often, for me, it starts with a song that I would like to set a moment of my +life to, or set a scene in a story to. This has only happened a couple times, +and in very, very amateur settings, but I am proud of what I create anyways.

+

Here is one such example, of a video I created to preserve the +memories of my freshman year at CMU.

+

I also consider film analysis video essays on YouTube a guilty pleasure of mine, +including channels such as Every Frame a Painting, shnee, and Now You See It.

+

Website

+

One example of a creative outlet is also this website, which I have painstakingly +rendered into a form that I find aesthetically pleasing.

+

Significant efforts were put into rendering syntax highlighting using Highlight.js rather +than Zola's in-built syntax highlighting, because Zola does not natively support Standard ML +as a language. These colors were also picked out especially to make Standard ML look nice, +by my standards. Have a look.

+
val x = 3 + (3 * 4)
+val y = foo (2) |> 4
+val y = fn x => 2
+
+val y = ([1, 2, 3], "hi")
+
+exception Foo
+
+val y = x >>= f
+
+(* foo *)
+fun foo (x : 'a, y : int, z : int list) = 2
+
+structure Foo : FOO =
+  struct
+    type t = int * string
+
+    datatype t2 =
+        One
+      | Two
+  end
+
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/creative/moment.jpg b/creative/moment.jpg new file mode 100644 index 0000000..f0322bb Binary files /dev/null and b/creative/moment.jpg differ diff --git a/creative/piloting.jpg b/creative/piloting.jpg new file mode 100644 index 0000000..8258f22 Binary files /dev/null and b/creative/piloting.jpg differ diff --git a/creative/plane.jpg b/creative/plane.jpg new file mode 100644 index 0000000..a03fb7f Binary files /dev/null and b/creative/plane.jpg differ diff --git a/creative/remembering.jpg b/creative/remembering.jpg new file mode 100644 index 0000000..47df914 Binary files /dev/null and b/creative/remembering.jpg differ diff --git a/creative/return.jpg b/creative/return.jpg new file mode 100644 index 0000000..268421b Binary files /dev/null and b/creative/return.jpg differ diff --git a/creative/same.jpg b/creative/same.jpg new file mode 100644 index 0000000..1288e2d Binary files /dev/null and b/creative/same.jpg differ diff --git a/creative/steps.jpg b/creative/steps.jpg new file mode 100644 index 0000000..43f83b4 Binary files /dev/null and b/creative/steps.jpg differ diff --git a/creative/together.jpg b/creative/together.jpg new file mode 100644 index 0000000..13d525a Binary files /dev/null and b/creative/together.jpg differ diff --git a/equivalence/index.html b/equivalence/index.html new file mode 100644 index 0000000..a9ba8b4 --- /dev/null +++ b/equivalence/index.html @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 2 - Equivalence, Binding, and Scope

+ + + + + + + +
+

Following the first lecture, this lesson went into more about +the evaluation model of SML.

+

In the first lecture, we talked about the difference between +functional and imperative languages in the former's lack of +state, which involves the mutation of a +variable to have multiple different values over time.

+

We explored the idea of binding, which distinguishes +variable declarations in SML from variable declarations in an imperative +language, in that bound variables never change. Instead, they may +be shadowed, which simply introduces a new, unrelated +variable that happens to be named the same.

+

We then looked more examples of SML code, using the mechanism of +pattern matching, which lets us decompose more complex +values, like tuples, into their constituent components.

+

To wrap up the lecture, we discussed the concept of extensional +equivalence, which allows us to perform analysis of code in the same way +that one might reason about an algebraic equation (also called equational reasoning). We applied this to a small example, and +saw how simple algebraic reasoning can greatly help us simplify our code.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/equivalence/lecture02.pdf b/equivalence/lecture02.pdf new file mode 100644 index 0000000..a9f6402 Binary files /dev/null and b/equivalence/lecture02.pdf differ diff --git a/equivalence/lecture02.png b/equivalence/lecture02.png new file mode 100644 index 0000000..bf62ada Binary files /dev/null and b/equivalence/lecture02.png differ diff --git a/events/index.html b/events/index.html new file mode 100644 index 0000000..a30d129 --- /dev/null +++ b/events/index.html @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ + +
+
+ +

Website creation

+ + + + + +
+

an event

+ +
+ +
+ +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/events/test/index.html b/events/test/index.html new file mode 100644 index 0000000..085419a --- /dev/null +++ b/events/test/index.html @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Website creation

+ + + + + +
+

an event

+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/exceptions/index.html b/exceptions/index.html new file mode 100644 index 0000000..cf2e662 --- /dev/null +++ b/exceptions/index.html @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 12 - Exceptions

+ + + + + + + +
+

We have so far described three behaviors that are allowed of a legal SML program -- +it may either evaluate to a value, loop forever, or raise an exception. While we have +been brief on the last of these three, it is a useful language mechanism for +dealing with cases where we do not necessarily desire to give back a value.

+

In this lecture, we learned that exceptions are values of a type +called exn, which enjoys the property of extensibility, in that +constructors may be added to it dynamically, via using the exception keyword.

+

These include common exceptions such as Bind, Div, and Match, but also +custom exceptions, which may be defined to take in information in the form of +other values, much like other constructors. This is useful, because exceptions +may also be handled via the handle keyword, which allows us to +recover from potentially-fatal errors at a different location.

+

This is both useful for error recovery, and for nuanced control flow. We saw +that using this, we were able to write functions in an exception-handling style, which resembled the form of +continuation-passing style code.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/exceptions/lecture12.pdf b/exceptions/lecture12.pdf new file mode 100644 index 0000000..ea9e92f Binary files /dev/null and b/exceptions/lecture12.pdf differ diff --git a/exceptions/lecture12.png b/exceptions/lecture12.png new file mode 100644 index 0000000..6890bb2 Binary files /dev/null and b/exceptions/lecture12.png differ diff --git a/favicon.png b/favicon.png new file mode 100644 index 0000000..6d23627 Binary files /dev/null and b/favicon.png differ diff --git a/finale/index.html b/finale/index.html new file mode 100644 index 0000000..f3125d9 --- /dev/null +++ b/finale/index.html @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 22 - Finale

+ + + + + + + +
+

In this lecture, we went backwards to review every single lecture that has +occurred in the course so far. While this was meant to be review material for +the upcoming final exam, it was also equally meant to clarify the goals and +high-level takeaways from each lesson.

+

We then discussed the course themes, the three theses that were established at +the beginning of the course, and ideas that have been continuously cropping up +over the tenure of the course. Mostly, this was a look at whether or not the +promises laid down at the beginning of the course were kept, and reinforcing +those ideas by examining them in context of what we now know about functional +programming.

+

The end of this lecture served as a personal send off for myself, to all of +my students, 150, and CMU in general. I thanked many of my influences and people +who inspired me to teach this course, and clarified some lessons that I learned +from the course, as well as what I wanted students to take away from it.

+

I hope you got something out of this course as well.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/finale/lecture22.pdf b/finale/lecture22.pdf new file mode 100644 index 0000000..5874976 Binary files /dev/null and b/finale/lecture22.pdf differ diff --git a/finale/lecture22.png b/finale/lecture22.png new file mode 100644 index 0000000..4b7ca38 Binary files /dev/null and b/finale/lecture22.png differ diff --git a/font-hack-subset.css b/font-hack-subset.css new file mode 100644 index 0000000..2707279 --- /dev/null +++ b/font-hack-subset.css @@ -0,0 +1,4 @@ +/*! + * Hack typeface https://github.com/source-foundry/Hack + * License: https://github.com/source-foundry/Hack/blob/master/LICENSE.md + */@font-face{font-family:"Hack";src:url("fonts/hack-regular.woff2?sha=3114f1256") format("woff2"),url("fonts/hack-regular.woff?sha=3114f1256") format("woff");font-weight:400;font-style:normal}@font-face{font-family:"Hack";src:url("fonts/hack-bold-subset.woff2?sha=3114f1256") format("woff2"),url("fonts/hack-bold-subset.woff?sha=3114f1256") format("woff");font-weight:700;font-style:normal}@font-face{font-family:"Hack";src:url("fonts/hack-italic-subset.woff2?sha=3114f1256") format("woff2"),url("fonts/hack-italic-webfont.woff?sha=3114f1256") format("woff");font-weight:400;font-style:italic}@font-face{font-family:"Hack";src:url("fonts/hack-bolditalic-subset.woff2?sha=3114f1256") format("woff2"),url("fonts/hack-bolditalic-subset.woff?sha=3114f1256") format("woff");font-weight:700;font-style:italic} \ No newline at end of file diff --git a/font-hack.css b/font-hack.css new file mode 100644 index 0000000..2a0205d --- /dev/null +++ b/font-hack.css @@ -0,0 +1,4 @@ +/*! + * Hack typeface https://github.com/source-foundry/Hack + * License: https://github.com/source-foundry/Hack/blob/master/LICENSE.md + */@font-face{font-family:"Hack";src:url("fonts/hack-regular.woff2?sha=3114f1256") format("woff2"),url("fonts/hack-regular.woff?sha=3114f1256") format("woff");font-weight:400;font-style:normal}@font-face{font-family:"Hack";src:url("fonts/hack-bold.woff2?sha=3114f1256") format("woff2"),url("fonts/hack-bold.woff?sha=3114f1256") format("woff");font-weight:700;font-style:normal}@font-face{font-family:"Hack";src:url("fonts/hack-italic.woff2?sha=3114f1256") format("woff2"),url("fonts/hack-italic.woff?sha=3114f1256") format("woff");font-weight:400;font-style:italic}@font-face{font-family:"Hack";src:url("fonts/hack-bolditalic.woff2?sha=3114f1256") format("woff2"),url("fonts/hack-bolditalic.woff?sha=3114f1256") format("woff");font-weight:700;font-style:italic} \ No newline at end of file diff --git a/fonts/hack-bold-subset.woff b/fonts/hack-bold-subset.woff new file mode 100644 index 0000000..a47c8aa Binary files /dev/null and b/fonts/hack-bold-subset.woff differ diff --git a/fonts/hack-bold-subset.woff2 b/fonts/hack-bold-subset.woff2 new file mode 100644 index 0000000..93d425e Binary files /dev/null and b/fonts/hack-bold-subset.woff2 differ diff --git a/fonts/hack-bold.woff b/fonts/hack-bold.woff new file mode 100644 index 0000000..368b913 Binary files /dev/null and b/fonts/hack-bold.woff differ diff --git a/fonts/hack-bold.woff2 b/fonts/hack-bold.woff2 new file mode 100644 index 0000000..1155477 Binary files /dev/null and b/fonts/hack-bold.woff2 differ diff --git a/fonts/hack-bolditalic-subset.woff b/fonts/hack-bolditalic-subset.woff new file mode 100644 index 0000000..0da4750 Binary files /dev/null and b/fonts/hack-bolditalic-subset.woff differ diff --git a/fonts/hack-bolditalic-subset.woff2 b/fonts/hack-bolditalic-subset.woff2 new file mode 100644 index 0000000..236b7de Binary files /dev/null and b/fonts/hack-bolditalic-subset.woff2 differ diff --git a/fonts/hack-bolditalic.woff b/fonts/hack-bolditalic.woff new file mode 100644 index 0000000..ce87fe2 Binary files /dev/null and b/fonts/hack-bolditalic.woff differ diff --git a/fonts/hack-bolditalic.woff2 b/fonts/hack-bolditalic.woff2 new file mode 100644 index 0000000..46ff1c4 Binary files /dev/null and b/fonts/hack-bolditalic.woff2 differ diff --git a/fonts/hack-italic-subset.woff b/fonts/hack-italic-subset.woff new file mode 100644 index 0000000..1d1f511 Binary files /dev/null and b/fonts/hack-italic-subset.woff differ diff --git a/fonts/hack-italic-subset.woff2 b/fonts/hack-italic-subset.woff2 new file mode 100644 index 0000000..b6f5fc9 Binary files /dev/null and b/fonts/hack-italic-subset.woff2 differ diff --git a/fonts/hack-italic.woff b/fonts/hack-italic.woff new file mode 100644 index 0000000..bd545e4 Binary files /dev/null and b/fonts/hack-italic.woff differ diff --git a/fonts/hack-italic.woff2 b/fonts/hack-italic.woff2 new file mode 100644 index 0000000..1e7630c Binary files /dev/null and b/fonts/hack-italic.woff2 differ diff --git a/fonts/hack-regular-subset.woff b/fonts/hack-regular-subset.woff new file mode 100644 index 0000000..85583a5 Binary files /dev/null and b/fonts/hack-regular-subset.woff differ diff --git a/fonts/hack-regular-subset.woff2 b/fonts/hack-regular-subset.woff2 new file mode 100644 index 0000000..1e3abb9 Binary files /dev/null and b/fonts/hack-regular-subset.woff2 differ diff --git a/fonts/hack-regular.woff b/fonts/hack-regular.woff new file mode 100644 index 0000000..e835381 Binary files /dev/null and b/fonts/hack-regular.woff differ diff --git a/fonts/hack-regular.woff2 b/fonts/hack-regular.woff2 new file mode 100644 index 0000000..524465c Binary files /dev/null and b/fonts/hack-regular.woff2 differ diff --git a/foo.css b/foo.css new file mode 100644 index 0000000..888afa9 --- /dev/null +++ b/foo.css @@ -0,0 +1,155 @@ +/* This file is part of Dream, released under the MIT license. See + LICENSE.md for details, or visit https://github.com/aantron/dream. + + Copyright 2021 Anton Bachin */ + + + +/* Fonts. */ + +@font-face { + font-family: 'Tenor Sans'; + font-style: normal; + font-weight: 400; + src: url('tenor-sans-v12-latin-regular.woff2') format('woff2'); +} + +/* Theme */ + +/* Dark theme (default) */ +:root, body:not([data-theme="light"]) { + --bg-color: #131618; + --text-color: #c9d1d9; + --code-bg-color: #2c333b; + --border-color: #282828; + --link-color: #8dc5ff; + --external-link-color: #5d7fcd; + --anchor-color: #bfcdea; + + --of-color: #bec5cd; + --target-backing-color: #390022; + + --hljs-keyword-color: #ff6c9b; + --hljs-identifier-color: #70df5c; + --hljs-tag-color: #c28eff; + --hljs-string-color: #e3db7a; +} + +/* Light theme */ +:root, body[data-theme="light"] { + --bg-color: #f5f7fa; + --text-color: #1f2937; + --code-bg-color: #eef1f6; + --header-bg-color: #f5f7fa; + --border-color: #e0e0e0; + --link-color: #1c7ed6; + --external-link-color: #1d4ed8; + --anchor-color: #888; + + --of-color: #6b7280; + --target-backing-color: #f7f6f3; + + --hljs-keyword-color: #d94879; + --hljs-identifier-color: #22863a; + --hljs-tag-color: #6f42c1; + --hljs-string-color: #b94e48; +} + +nav ~ * a[href="#builtin"], +nav ~ * a[href="#errors"], +nav ~ * a[href="#headers"], +nav ~ * a[href="#routing"], +nav ~ * a[href="#requests"], +nav ~ * a[href="#responses"], +nav ~ * a[href="#sessions"], +nav ~ * a[href="#templates"] { + font-style: italic; +} + +a[href*=example] { + font-weight: bold; +} + +a[href^=http]::after { + content: "\f35d"; + font-family: FontAwesome; + font-size: 10px; + line-height: 18px; + color: var(--external-link-color); + position: relative; + top: -1px; + margin-left: 2px; + margin-right: 3px; +} +.odoc-content a[href^=http] > code { + margin-right: -3px; +} + +a, a:visited, a:active { + color: var(--link-color); + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +.odoc-content a > code { + color: var(--link-color); +} + +.hljs-module-access, .hljs-keyword, .keyword { + color: var(--hljs-keyword-color); +} + +.hljs-identifier, .hljs-literal, .hljs-type { + color: var(--hljs-identifier-color); +} + +.hljs-tag { + color: var(--hljs-tag-color); +} + +.hljs-string { + color: var(--hljs-string-color); +} + +.of { + color: var(--of-color); +} + +.topmost ul { + list-style: none; +} + +.topmost ul li { + height: 24px; +} + +.topmost ul li::before +{ + display: inline-block; + width: 2rem; + padding-right: 0.25rem; + text-align: center; + font-family: FontAwesome, FontAwesomeBrands; + font-size: 15px; +} + +.topmost ul li:nth-child(3)::before { + content: '\f09b'; +} + +.topmost ul li:nth-child(1)::before { + content: '\f126'; +} + +.topmost ul li:nth-child(2)::before { + content: '\f49e'; + font-size: 13px; +} + +.topmost ul li:nth-child(4)::before { + content: '\f303'; + font-size: 14px; +} diff --git a/footer.css b/footer.css new file mode 100644 index 0000000..435ff7b --- /dev/null +++ b/footer.css @@ -0,0 +1 @@ +.footer{padding:40px 0;flex-grow:0;opacity:.5}.footer__inner{display:flex;align-items:center;justify-content:space-between;margin:0;width:760px;max-width:100%}@media (max-width: 899px){.footer__inner{flex-direction:column}}.footer a{color:inherit}.footer .copyright{display:flex;flex-direction:row;align-items:center;font-size:1rem;color:var(--light-color-secondary)}.footer .copyright--user{margin:auto;text-align:center}.footer .copyright>*:first-child:not(:only-child){margin-right:10px}@media (max-width: 899px){.footer .copyright>*:first-child:not(:only-child){border:none;padding:0;margin:0}}@media (max-width: 899px){.footer .copyright{flex-direction:column;margin-top:10px}}@media (max-width: 899px){.footer .copyright-theme-sep{display:none}}@media (max-width: 899px){.footer .copyright-theme{font-size:.75rem}} \ No newline at end of file diff --git a/functors/index.html b/functors/index.html new file mode 100644 index 0000000..7f73856 --- /dev/null +++ b/functors/index.html @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 15 - Functors

+ + + + + + + +
+

This lecture continues our exploration of the SML module system, by introducing +the idea of functors, which are simply module-level functions +which take in structures and produce other structures.

+

We motivated this idea by trying to implement a structure for polymorphic +dictionaries, which are dictionaries that can map from keys of arbitrary (but fixed) +type to values of also arbitrary type. To do this, we required taking in a +comparison function to order the keys, but this ended up producing unsafe behavior +in the event that this comparison function was used erroneously.

+

We found that a safer approach was to parameterize our structure on a type class ORD, which describes structures of types that have +included comparison functions. By defining it according to a singular instance +of the ORD type class, we were able to then translate the code into a functor, +which assumed the type class as an argument.

+

We then saw that we could reuse the same dictionary-creating code for many +different type classes, at minimal extra burden. This demonstrates the power of +functors, which allow us to parameterize software components based on other +software components in a well-specified way.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/functors/lecture15.pdf b/functors/lecture15.pdf new file mode 100644 index 0000000..113b6ba Binary files /dev/null and b/functors/lecture15.pdf differ diff --git a/functors/lecture15.png b/functors/lecture15.png new file mode 100644 index 0000000..507c1f8 Binary files /dev/null and b/functors/lecture15.png differ diff --git a/greek_sing.jpg b/greek_sing.jpg new file mode 100644 index 0000000..1f2db10 Binary files /dev/null and b/greek_sing.jpg differ diff --git a/header.css b/header.css new file mode 100644 index 0000000..8961941 --- /dev/null +++ b/header.css @@ -0,0 +1 @@ +.header{display:flex;flex-direction:column;position:relative}.header__inner{display:flex;align-items:center;justify-content:space-between}.header__logo{display:flex;flex:1}.header__logo:after{content:"";background:repeating-linear-gradient(90deg, var(--accent), var(--accent) 2px, rgba(0,0,0,0) 0, rgba(0,0,0,0) 16px);display:block;width:100%;right:10px}.header__logo a{flex:0 0 auto;max-width:100%}.header .menu{margin:20px 0}.header .menu__inner{display:flex;flex-wrap:wrap;list-style:none;margin:0;padding:0}.header .menu__inner li.active{color:var(--accent-alpha-70)}.header .menu__inner li:not(:last-of-type){margin-right:20px;margin-bottom:10px;flex:0 0 auto}.header .menu__sub-inner{position:relative;list-style:none;padding:0;margin:0}.header .menu__sub-inner:not(:only-child){margin-left:20px}.header .menu__sub-inner-more{position:absolute;background:var(--background);box-shadow:var(--shadow);color:#fff;border:2px solid;margin:0;padding:10px;list-style:none;z-index:99;top:35px;left:0}.header .menu__sub-inner-more-trigger{color:var(--accent);user-select:none;cursor:pointer}.header .menu__sub-inner-more li{margin:0;padding:5px;white-space:nowrap} \ No newline at end of file diff --git a/header.png b/header.png new file mode 100644 index 0000000..c71d5a2 Binary files /dev/null and b/header.png differ diff --git a/hofs/index.html b/hofs/index.html new file mode 100644 index 0000000..74ce2f5 --- /dev/null +++ b/hofs/index.html @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 9 - Higher-Order Functions

+ + + + + + + +
+

We have so far learned that values can be passed into functions and returned +from functions, even complex values such as constructors of a variant type, +or tuples. One core idea in this class is that functions are values, +which by transitivity implies that functions can be given as arguments to functions +and returned from functions.

+

This is an idea which gives rise to currying and higher-order functions, which describe functions which do both of these +things. In the last lecture, we exploited the latter to write a generic sorting +function, which could be instantiated with any comparison function to achieve +a sort for that particular relation.

+

Higher-order functions give us an idea of parameterizing our code over other +code -- viewed in this way, we can write functions which can vary their behavior +based on the behavior of their arguments. This ends up being very powerful for +the purpose of eliminating boilerplate, as we can then write functions which +abstract over common patterns in our code, and lead to simpler code overall.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/hofs/lecture09.pdf b/hofs/lecture09.pdf new file mode 100644 index 0000000..0cc4aad Binary files /dev/null and b/hofs/lecture09.pdf differ diff --git a/hofs/lecture09.png b/hofs/lecture09.png new file mode 100644 index 0000000..76d8996 Binary files /dev/null and b/hofs/lecture09.png differ diff --git a/imperative/index.html b/imperative/index.html new file mode 100644 index 0000000..45a2244 --- /dev/null +++ b/imperative/index.html @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 19 - Imperative Programming

+ + + + + + + +
+

The whole semester, we have been dealing in the pure fragment of SML, which acts +much like a purely functional programming langauge. SML is not, however, a purely +functional language, as it actually has imperative features that we have been +avoiding, up until this lecture.

+

Mutability is a problem, but generally moreso when it is used unrestrictedly. We +favor the style of immutability by default, which simply entails avoiding +mutability, and defaulting to immutability, rather than going so far as to +forbid mutability entirely. This allows us the strength of functional +programming, without necessarily completely shutting ourselves out from +convenience when necessary.

+

We achieve this in SML by the t ref type, which is a type of mutable boxes storing values of type t. The key takeaway is that +these boxes may remain the same, but the contents of the boxes can change. We +went over the !, ref and := functions, which allow us to interface with +these boxes.

+

Mutability can break some of our nice notions of purity and extensional +equivalence, but can be a convenient tool in small doses.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/imperative/lecture19.pdf b/imperative/lecture19.pdf new file mode 100644 index 0000000..fc96608 Binary files /dev/null and b/imperative/lecture19.pdf differ diff --git a/imperative/lecture19.png b/imperative/lecture19.png new file mode 100644 index 0000000..9c3ed4b Binary files /dev/null and b/imperative/lecture19.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..36c31e3 --- /dev/null +++ b/index.html @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ + +
+
+ + +

Brandon Wu

+ +

+ Hi there! My name is Brandon Wu, and I'm a program analysis engineer working + at a company called Semgrep. +

+ +

+ I graduated from Carnegie Mellon University in 2022 with a degree in + computer science + and a + concentration in programming + languages, and my interests include functional programming and things + related to functional programming. +

+ +

This is my personal website for blogging (mostly about computer science, + teaching, or pop culture), as well as sharing things about my personal life. + There just isn't enough of my data on the internet. +

+
+ + + + + + +

+ If you are here, you may be interested in: +

+

+ +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/induction/index.html b/induction/index.html new file mode 100644 index 0000000..773d1c8 --- /dev/null +++ b/induction/index.html @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 3 - Induction and Recursion

+ + + + + + + +
+

Early on, it was claimed that almost every function in 150 would be recursive. +This lecture introduces a very deep idea that induction and recursion are two +sides of the same coin, and follow similar principles of solving problems +via using answers to smaller subproblems.

+

We reviewed the idea of induction, which lets us prove theorems on the natural +numbers by a rigid structure of a base case and inductive step. This lets us essentially show that a theorem can be +proven for any given number, via finite repetitions of the inductive step to the +base case.

+

This process ends up being very similar to the act of writing a recursive +function, by connecting the idea of assuming an induction hypothesis with +assuming that a recursive function already works, a technique dubbed the recursive leap of faith.

+

We then went over more aspects of the SML language, including patterns, which are the fundamental constructs by which we break +down data into simpler parts, in SML.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/induction/lecture03.pdf b/induction/lecture03.pdf new file mode 100644 index 0000000..579b3fb Binary files /dev/null and b/induction/lecture03.pdf differ diff --git a/induction/lecture03.png b/induction/lecture03.png new file mode 100644 index 0000000..26c2c81 Binary files /dev/null and b/induction/lecture03.png differ diff --git a/lazy/index.html b/lazy/index.html new file mode 100644 index 0000000..0a8cbca --- /dev/null +++ b/lazy/index.html @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 18 - Lazy Programming

+ + + + + + + +
+

We are now comfortable with the idea of using functions as first-class values, +which means that the can be bound to variables, passed to functions, and treated +like pretty much any other value.

+

This lecture introduces lazy programming, which entails +programming by trying to do as little work as possible, until it is absolutely +necessary. For instance, when mapping a function onto a list, SML will eagerly +compute each new entry, even if we don't use any of the entries for anything.

+

We can simulate such lazy structures by using thunks, which +are functions that take in a useless unit parameter, which suspends the +body of the function, causing no computations to occur. This lets us define +lazy data structures, which compute elements only when they +are asked for them. This results in less work overall, and the ability to +theoretically store "infinitely" many elements.

+

In addition to lazy lists, we discussed streams, which are +lazy lists that are maximally lazy, by making sure that +the least amount of work is done when the stream is not being actively +queried for elements.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/lazy/lecture18.pdf b/lazy/lecture18.pdf new file mode 100644 index 0000000..8cf4d22 Binary files /dev/null and b/lazy/lecture18.pdf differ diff --git a/lazy/lecture18.png b/lazy/lecture18.png new file mode 100644 index 0000000..32749c6 Binary files /dev/null and b/lazy/lecture18.png differ diff --git a/logo.css b/logo.css new file mode 100644 index 0000000..b5150a4 --- /dev/null +++ b/logo.css @@ -0,0 +1 @@ +.logo{display:flex;align-items:center;text-decoration:none;background:var(--accent);color:#000;padding:5px 10px} \ No newline at end of file diff --git a/main.css b/main.css new file mode 100644 index 0000000..940bc3a --- /dev/null +++ b/main.css @@ -0,0 +1 @@ +html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}body{margin:0;padding:0;font-family:"Trebuchet MS","Lucida Sans Unicode","Lucida Grande","Lucida Sans",Arial,sans-serif;font-size:1rem;line-height:1.54;background-color:var(--background);color:var(--color);text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-text-size-adjust:100%}@media (max-width: 683px){body{font-size:1rem}}h1,h2,h3,h4,h5,h6{display:flex;align-items:center;font-weight:bold;line-height:1.3}h1{font-size:1.4rem}h2{font-size:1.3rem}h3{font-size:1.2rem}h4,h5,h6{font-size:1.15rem}a{color:inherit}img{display:block;max-width:100%}img.left{margin-right:auto}img.center{margin-left:auto;margin-right:auto}img.right{margin-left:auto}.responsive-iframe-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden}.responsive-iframe-container iframe{position:absolute;top:0;left:0;width:100%;height:100%}.coolthing{float:right;width:50%}p{margin-bottom:20px}figure{display:table;max-width:100%;margin:25px 0}figure.left,figure img{margin-right:auto}figure.center,figure img{margin-left:auto;margin-right:auto}figure.right,figure img{margin-left:auto}figure figcaption{font-size:14px;padding:5px 10px;margin-top:5px;background:var(--accent);color:var(--background)}figure figcaption.left{text-align:left}figure figcaption.center{text-align:center}figure figcaption.right{text-align:right}code{font-family:Hack,DejaVu Sans Mono,Monaco,Consolas,Ubuntu Mono,monospace;font-feature-settings:normal;color:#8b77cd;padding:0px 0px;margin:0 2px;font-size:.95rem;border-style:solid;border-color:#434343;border-width:1.5px}pre{font-family:Hack,DejaVu Sans Mono,Monaco,Consolas,Ubuntu Mono,monospace;padding:10px;font-size:.95rem;overflow:auto}@media (max-width: 683px){pre{white-space:pre-wrap;word-wrap:break-word}}pre code{padding:0;margin:0;background:none}blockquote{border-top:1px solid var(--accent);border-bottom:1px solid var(--accent);margin:40px 0;padding:25px}@media (max-width: 683px){blockquote{padding-right:0}}blockquote:before{content:"”";font-family:Georgia,serif;font-size:3.875rem;position:absolute;left:-40px;top:-20px}blockquote p:first-of-type{margin-top:0}blockquote p:last-of-type{margin-bottom:0}blockquote p{position:relative}blockquote p:before{content:">";display:block;position:absolute;left:-25px;color:var(--accent)}table{table-layout:fixed;border-collapse:collapse;width:100%;margin:40px 0}table,th,td{padding:10px}th{color:var(--accent)}ul,ol{margin-left:30px;padding:0}ul li,ol li{position:relative}@media (max-width: 683px){ul,ol{margin-left:20px}}ul.fancy{list-style:none}ul.fancy li:before{content:"➔";position:absolute;left:-20px;color:var(--accent)}ol ol{list-style-type:lower-alpha}.container{display:flex;flex-direction:column;padding:40px;max-width:864px;min-height:100vh;margin:0 auto}@media (max-width: 683px){.container{padding:20px}}.content{display:flex}hr{width:100%;border:none;background:var(--border-color);height:1px}.hidden{display:none}.profile{width:100%;margin-right:5rem;border-top:1px solid rgba(255,255,255,.1);border-bottom:1px solid rgba(255,255,255,.1)}.profile .address{margin-bottom:5px;margin-top:5px;font-family:monospace}.profile .address p{display:inline-block;margin:0}.profile.float-right{margin-right:5rem}.profile.float-right img{display:block}.event{display:inline;height:100%;vertical-align:middle}.image-gallery{display:flex;flex-wrap:wrap;padding:10px 10px;border-top:1px solid rgba(255,255,255,.1);border-bottom:1px solid rgba(255,255,255,.1)}.image-gallery a{flex:0 0 calc(33% - 10px);margin:5px}.lecture-entry{flex-wrap:wrap;border-top:1px solid rgba(255,255,255,.1);border-bottom:1px solid rgba(255,255,255,.1)}.lecture-entry .image-column{display:inline-block;margin-right:10px;vertical-align:top;width:40%}.lecture-entry .info-column{display:inline-block;width:58%;height:200px}.lecture-entry .flexy-thing{width:auto;justify-content:space-between;flex-direction:column;display:flex;height:100%}.lecture-entry .lecture-entry-title{height:40%;font-size:19px;margin-top:10px;margin-bottom:3px}.lecture-entry-title-span{border-bottom:1px solid #4d4d4d}.lecture-entry-title-span a{text-decoration:none}.lecture-entry .lecture-entry-description{color:#c3c3c3}.lecture-entry .lecture-entry-quote{height:30%;font-style:italic;font-size:20px}.lecture-entry .lecture-entry-link{height:40%}.with-bottom-spacing{margin-bottom:2cm} \ No newline at end of file diff --git a/me.jpg b/me.jpg new file mode 100644 index 0000000..cf40625 Binary files /dev/null and b/me.jpg differ diff --git a/me2.png b/me2.png new file mode 100644 index 0000000..16a9119 Binary files /dev/null and b/me2.png differ diff --git a/modules/index.html b/modules/index.html new file mode 100644 index 0000000..f80927d --- /dev/null +++ b/modules/index.html @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 14 - Structures and Signatures

+ + + + + + + +
+

In this course, so far we have been implementing simple and not-so-simple functions +that stand for themselves for the most part, and which solve well-defined problems +that have been handed to you, for the most part.

+

Computer science is often a collaborative art, and in particular, when producing +software, such well-defined structure does not always exist. The problem of +software engineering is determining how to produce such well-architected code, +which remains both easy to maintain and clear to its readers.

+

This lecture introduced SML's sophisticated module system, which +entails a language of structures, which are constructs that may +store exceptions, datatypes, and values, the things that we have been working so far +in the course. We also saw that we could use signatures to denote +the interface of such modules, which is akin to a "type" that describes the contents +of a given module.

+

These structures are important because they exhibit information +hiding, which lets us cleanly separate the boundaries between areas of a +codebase, by defining well-specified interfaces between them, using the language of +types and values.

+

We saw how we could use opaque ascription and transparent ascription to control the degree of information hiding, +the former allowing us to define abstract types whose definitions +are unknown to users, something which grants us great strength by forbidding the +breaking of abstraction, and in particular, implementation invariants.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/modules/lecture14.pdf b/modules/lecture14.pdf new file mode 100644 index 0000000..b7add6d Binary files /dev/null and b/modules/lecture14.pdf differ diff --git a/modules/lecture14.png b/modules/lecture14.png new file mode 100644 index 0000000..ba5678c Binary files /dev/null and b/modules/lecture14.png differ diff --git a/ocaml/index.html b/ocaml/index.html new file mode 100644 index 0000000..3e22e3a --- /dev/null +++ b/ocaml/index.html @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Supplemental Lecture 01 - From SML to OCaml

+ + + + + + + +
+

People are often skeptical of the usefulness of 150, due to the fact that +the SML language is not a language that is ever really used in any industrial +context.

+

While there are a great deal more rebuttals I could give to that line of +thinking, one fact remains, which is that students of 15-150 effectively know +another language automatically. That is the OCaml language, which resembles SML +greatly, and is used for various real-world applications.

+

This lecture goes into the differences between SML and OCaml, and the reasons +why OCaml can be a nicer language to work with. It aims to bring a student up +to speed with being able to program in OCaml at a similar level.

+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/ocaml/sml_to_ocaml.pdf b/ocaml/sml_to_ocaml.pdf new file mode 100644 index 0000000..ba5ae62 Binary files /dev/null and b/ocaml/sml_to_ocaml.pdf differ diff --git a/ocaml/sml_to_ocaml.png b/ocaml/sml_to_ocaml.png new file mode 100644 index 0000000..81193e0 Binary files /dev/null and b/ocaml/sml_to_ocaml.png differ diff --git a/pa/index.html b/pa/index.html new file mode 100644 index 0000000..21586bf --- /dev/null +++ b/pa/index.html @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 21 - Special Topics: Program Analysis

+ + + + + + + +
+

In a world which is being increasingly dominated by software, as well as the +challenges that come with its inherent insecurity, it is extremely important +that we be able to keep up with the sheer volume of code being produced. This +leads us to program analysis is the art of obtaining information +about a program through programmatic means.

+

Due to the Halting Problem, it can be demonstrated that it is impossible for +any program to be completely accurate in assessing any property of a given +program. The field of program analysis circumvents this by performing analyses +with heavy approximations, which allow termination, while giving back +potentially inaccurate results.

+

In this lecture, we discussed different kinds of program analyses, which must +compromise on properties such as termination, accuracy, and thoroughness, due to +the impossibility of the task. We also introduced dataflow analysis as a classic technique that is used to ascertain approximate information +about a given program.

+

I also talked about what I do at Semgrep, working on program analysis for securing +code by searching for undesirable parts of programs in many different languages. +I explained some of the technical merits of Semgrep, by utilizing a generic +representation for many different languages, as well as performing analyses via +simple recursive tree matching on the source program, as opposed to descending to +the lower levels of the program.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/pa/lecture21.pdf b/pa/lecture21.pdf new file mode 100644 index 0000000..2ca7a09 Binary files /dev/null and b/pa/lecture21.pdf differ diff --git a/pa/lecture21.png b/pa/lecture21.png new file mode 100644 index 0000000..a06bfd9 Binary files /dev/null and b/pa/lecture21.png differ diff --git a/pages/index.html b/pages/index.html new file mode 100644 index 0000000..36c31e3 --- /dev/null +++ b/pages/index.html @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ + +
+
+ + +

Brandon Wu

+ +

+ Hi there! My name is Brandon Wu, and I'm a program analysis engineer working + at a company called Semgrep. +

+ +

+ I graduated from Carnegie Mellon University in 2022 with a degree in + computer science + and a + concentration in programming + languages, and my interests include functional programming and things + related to functional programming. +

+ +

This is my personal website for blogging (mostly about computer science, + teaching, or pop culture), as well as sharing things about my personal life. + There just isn't enough of my data on the internet. +

+
+ + + + + + +

+ If you are here, you may be interested in: +

+

+ +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/pagination.css b/pagination.css new file mode 100644 index 0000000..defd6c0 --- /dev/null +++ b/pagination.css @@ -0,0 +1 @@ +.pagination{margin-top:50px}.pagination__title{display:flex;text-align:center;position:relative;margin:100px 0 20px}.pagination__title-h{text-align:center;margin:0 auto;padding:5px 10px;background:var(--background);font-size:.8rem;text-transform:uppercase;letter-spacing:.1em;z-index:1}.pagination__title hr{position:absolute;left:0;right:0;width:100%;margin-top:15px;z-index:0}.pagination__buttons{display:flex;align-items:center;justify-content:center}@media (max-width: 683px){.pagination__buttons{flex-direction:column}}.button{position:relative;display:inline-flex;align-items:center;justify-content:center;font-size:1rem;border-radius:8px;max-width:40%;padding:0;cursor:pointer;appearance:none}@media (max-width: 683px){.button{max-width:80%}}.button+.button{margin-left:10px}.button a{display:flex;padding:8px 16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.button__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden} \ No newline at end of file diff --git a/parallel/index.html b/parallel/index.html new file mode 100644 index 0000000..1212b32 --- /dev/null +++ b/parallel/index.html @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 7 - Sorting and Parallelism

+ + + + + + + +
+

This lecture expanded upon the discussions on asymptotic complexity of +the previous lecture, by going more in depth on how we can solve and +reason about the sequential and parallel time complexity of SML functions.

+

The tree method is a useful tool for solving the time +complexity of a recurrence which makes multiple "recursive calls", by +trying to sum over the total cost of each "level" of the call tree induced +by the recurrence.

+

As a specific application of cost analysis, we implemented the insertion sort +and merge sort algorithms in SML, and conducted work and span analysis on them. +In particular, we found that merge sort admitted a very terse and clean +implementation in SML, which could be done in parallel in linear time.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/parallel/lecture07.pdf b/parallel/lecture07.pdf new file mode 100644 index 0000000..67c5d98 Binary files /dev/null and b/parallel/lecture07.pdf differ diff --git a/parallel/lecture07.png b/parallel/lecture07.png new file mode 100644 index 0000000..bfbe9d8 Binary files /dev/null and b/parallel/lecture07.png differ diff --git a/poly/index.html b/poly/index.html new file mode 100644 index 0000000..2b4459d --- /dev/null +++ b/poly/index.html @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 8 - Polymorphism

+ + + + + + + +
+

This semester, we have been type-annotating all of our declarations and +functions, which gives them a concrete type that we can them use them at.

+

In general, however, some functions that we write have the property that +they could be used more generally than we annotate them to be. For instance, +we can write the length : int list -> int function, but if not for +the fact that we specified it to be for int lists, there's no reason why +it should not also be able to be used for string lists.

+

This lecture explores that idea by introducing parametric +polymorphism, which is a language feature in SML that allows polymorphic types which makes use of type variables, which allow a given value to be used at multiple different types. This +allows us the power of writing code which can be used generically, without +needing to constrain it to particular use cases.

+

Our ability to make use of polymorphic types is also greatly aided by the +fact that Standard ML can perform type inference, which allows +it to determine the types of expressions, without any annotations needed. Type +annotations turn out to actually be totally optional, which allows us to +take full power of the SML type system.

+

We finished off the lecture by discussing parameterized types, +such as the list type constructor, which allow us to create types from arbitrary +other types. We also implemented a generic sort function, which achieved a +polymorphic type by taking in a function, which was itself a generic comparison +function.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/poly/lecture08.pdf b/poly/lecture08.pdf new file mode 100644 index 0000000..a393dd3 Binary files /dev/null and b/poly/lecture08.pdf differ diff --git a/poly/lecture08.png b/poly/lecture08.png new file mode 100644 index 0000000..74294c8 Binary files /dev/null and b/poly/lecture08.png differ diff --git a/post.css b/post.css new file mode 100644 index 0000000..6132d9f --- /dev/null +++ b/post.css @@ -0,0 +1 @@ +.posts{width:100%;margin:0 auto}.post{width:100%;text-align:left;margin:-20px auto;padding:20px 0}@media (max-width: 899px){.post{max-width:660px}}.post:not(:last-of-type){border-bottom:1px solid var(--border-color)}.post .post-meta-inline,.post .post-meta{font-size:1rem;margin-bottom:10px;color:var(--accent-alpha-70)}.post-meta-inline{display:inline}.post-title{--border: 2px solid var(--accent);position:relative;color:var(--accent);margin:0 0 15px;padding-bottom:15px;border-bottom:var(--border);font-weight:normal}.post-title a{text-decoration:none}.post .post-tags-inline,.post .post-tags{margin-bottom:20px;font-size:1rem;opacity:.5}.post-tags{display:block}.post-tags-inline{display:inline}@media (max-width: 683px){.post-tags-inline{display:block}}.post-content{margin-top:30px}.post-cover{border:20px solid var(--accent);background:rgba(0,0,0,0);margin:40px 0;padding:20px}@media (max-width: 683px){.post-cover{padding:10px;border-width:10px}}.post ul{list-style:none}.post ul li:before{content:"➔";position:absolute;left:-20px;color:var(--accent)}.post--regulation h1{justify-content:center}.post--regulation h2{justify-content:center;margin-bottom:10px}.post--regulation h2+h2{margin-top:-10px;margin-bottom:20px}.post-list .post-date{color:var(--accent-alpha-70);text-decoration:none}.post-list a{text-decoration:none}.post-list .post-list-title{text-decoration:underline}.post-list .post-tag{text-decoration:underline} \ No newline at end of file diff --git a/processed_images/behind.5e7fa1de289ee157.jpg b/processed_images/behind.5e7fa1de289ee157.jpg new file mode 100644 index 0000000..00b0198 Binary files /dev/null and b/processed_images/behind.5e7fa1de289ee157.jpg differ diff --git a/processed_images/closeup.2e832356f51a590c.jpg b/processed_images/closeup.2e832356f51a590c.jpg new file mode 100644 index 0000000..0f7d196 Binary files /dev/null and b/processed_images/closeup.2e832356f51a590c.jpg differ diff --git a/processed_images/colors.09b2a891ccbdf7b6.jpg b/processed_images/colors.09b2a891ccbdf7b6.jpg new file mode 100644 index 0000000..4057dc5 Binary files /dev/null and b/processed_images/colors.09b2a891ccbdf7b6.jpg differ diff --git a/processed_images/dance.e396605300df685d.jpg b/processed_images/dance.e396605300df685d.jpg new file mode 100644 index 0000000..5bfef9e Binary files /dev/null and b/processed_images/dance.e396605300df685d.jpg differ diff --git a/processed_images/ending.1353d67ed1f08a40.jpg b/processed_images/ending.1353d67ed1f08a40.jpg new file mode 100644 index 0000000..6863b97 Binary files /dev/null and b/processed_images/ending.1353d67ed1f08a40.jpg differ diff --git a/processed_images/farewell.7db4756269c0adf7.jpg b/processed_images/farewell.7db4756269c0adf7.jpg new file mode 100644 index 0000000..f299786 Binary files /dev/null and b/processed_images/farewell.7db4756269c0adf7.jpg differ diff --git a/processed_images/fight.1b2e32e03f8c29f8.jpg b/processed_images/fight.1b2e32e03f8c29f8.jpg new file mode 100644 index 0000000..f43471f Binary files /dev/null and b/processed_images/fight.1b2e32e03f8c29f8.jpg differ diff --git a/processed_images/lecture01.8cfa9f04e0471ce9.png b/processed_images/lecture01.8cfa9f04e0471ce9.png new file mode 100644 index 0000000..d9884ea Binary files /dev/null and b/processed_images/lecture01.8cfa9f04e0471ce9.png differ diff --git a/processed_images/lecture02.dbb17a42aff4940f.png b/processed_images/lecture02.dbb17a42aff4940f.png new file mode 100644 index 0000000..c528091 Binary files /dev/null and b/processed_images/lecture02.dbb17a42aff4940f.png differ diff --git a/processed_images/lecture03.774a63e9a1dfbb56.png b/processed_images/lecture03.774a63e9a1dfbb56.png new file mode 100644 index 0000000..90e9ae3 Binary files /dev/null and b/processed_images/lecture03.774a63e9a1dfbb56.png differ diff --git a/processed_images/lecture04.974e062fd7f7001e.png b/processed_images/lecture04.974e062fd7f7001e.png new file mode 100644 index 0000000..58818ba Binary files /dev/null and b/processed_images/lecture04.974e062fd7f7001e.png differ diff --git a/processed_images/lecture05.8539e15a028111c6.png b/processed_images/lecture05.8539e15a028111c6.png new file mode 100644 index 0000000..69b2929 Binary files /dev/null and b/processed_images/lecture05.8539e15a028111c6.png differ diff --git a/processed_images/lecture06.a3f267b828559249.png b/processed_images/lecture06.a3f267b828559249.png new file mode 100644 index 0000000..bee53cc Binary files /dev/null and b/processed_images/lecture06.a3f267b828559249.png differ diff --git a/processed_images/lecture07.5ab744bceae2c9ab.png b/processed_images/lecture07.5ab744bceae2c9ab.png new file mode 100644 index 0000000..6407079 Binary files /dev/null and b/processed_images/lecture07.5ab744bceae2c9ab.png differ diff --git a/processed_images/lecture08.027b00d6f597898d.png b/processed_images/lecture08.027b00d6f597898d.png new file mode 100644 index 0000000..0549288 Binary files /dev/null and b/processed_images/lecture08.027b00d6f597898d.png differ diff --git a/processed_images/lecture09.7a31c89c34f94ec7.png b/processed_images/lecture09.7a31c89c34f94ec7.png new file mode 100644 index 0000000..b5059b9 Binary files /dev/null and b/processed_images/lecture09.7a31c89c34f94ec7.png differ diff --git a/processed_images/lecture10.cdf16e3f14e06536.png b/processed_images/lecture10.cdf16e3f14e06536.png new file mode 100644 index 0000000..48483a4 Binary files /dev/null and b/processed_images/lecture10.cdf16e3f14e06536.png differ diff --git a/processed_images/lecture11.c89981eacfb29185.png b/processed_images/lecture11.c89981eacfb29185.png new file mode 100644 index 0000000..331c77c Binary files /dev/null and b/processed_images/lecture11.c89981eacfb29185.png differ diff --git a/processed_images/lecture12.b19b28e7698ffba2.png b/processed_images/lecture12.b19b28e7698ffba2.png new file mode 100644 index 0000000..2b001da Binary files /dev/null and b/processed_images/lecture12.b19b28e7698ffba2.png differ diff --git a/processed_images/lecture13.c974ea656c6159e5.png b/processed_images/lecture13.c974ea656c6159e5.png new file mode 100644 index 0000000..f1c0bfe Binary files /dev/null and b/processed_images/lecture13.c974ea656c6159e5.png differ diff --git a/processed_images/lecture14.028518f53cab4cf9.png b/processed_images/lecture14.028518f53cab4cf9.png new file mode 100644 index 0000000..03b791f Binary files /dev/null and b/processed_images/lecture14.028518f53cab4cf9.png differ diff --git a/processed_images/lecture15.d02ccaa2c64ff2be.png b/processed_images/lecture15.d02ccaa2c64ff2be.png new file mode 100644 index 0000000..b0acb53 Binary files /dev/null and b/processed_images/lecture15.d02ccaa2c64ff2be.png differ diff --git a/processed_images/lecture16.28e861d4cac2f212.png b/processed_images/lecture16.28e861d4cac2f212.png new file mode 100644 index 0000000..35745ef Binary files /dev/null and b/processed_images/lecture16.28e861d4cac2f212.png differ diff --git a/processed_images/lecture17.9e68d2a7c8cbf300.png b/processed_images/lecture17.9e68d2a7c8cbf300.png new file mode 100644 index 0000000..81d77bb Binary files /dev/null and b/processed_images/lecture17.9e68d2a7c8cbf300.png differ diff --git a/processed_images/lecture18.454aeebd5547a8f3.png b/processed_images/lecture18.454aeebd5547a8f3.png new file mode 100644 index 0000000..99b67f1 Binary files /dev/null and b/processed_images/lecture18.454aeebd5547a8f3.png differ diff --git a/processed_images/lecture19.6263735050045e5c.png b/processed_images/lecture19.6263735050045e5c.png new file mode 100644 index 0000000..09ac8e3 Binary files /dev/null and b/processed_images/lecture19.6263735050045e5c.png differ diff --git a/processed_images/lecture20.e288d5b5de5a3c92.png b/processed_images/lecture20.e288d5b5de5a3c92.png new file mode 100644 index 0000000..bf4605d Binary files /dev/null and b/processed_images/lecture20.e288d5b5de5a3c92.png differ diff --git a/processed_images/lecture21.3cf027831f3879b7.png b/processed_images/lecture21.3cf027831f3879b7.png new file mode 100644 index 0000000..7a3cf20 Binary files /dev/null and b/processed_images/lecture21.3cf027831f3879b7.png differ diff --git a/processed_images/lecture22.a4bae70d356411b3.png b/processed_images/lecture22.a4bae70d356411b3.png new file mode 100644 index 0000000..4e654d4 Binary files /dev/null and b/processed_images/lecture22.a4bae70d356411b3.png differ diff --git a/processed_images/moment.346d9391fea7c210.jpg b/processed_images/moment.346d9391fea7c210.jpg new file mode 100644 index 0000000..6e9c09d Binary files /dev/null and b/processed_images/moment.346d9391fea7c210.jpg differ diff --git a/processed_images/piloting.1414b611ddc792b6.jpg b/processed_images/piloting.1414b611ddc792b6.jpg new file mode 100644 index 0000000..e0ca69b Binary files /dev/null and b/processed_images/piloting.1414b611ddc792b6.jpg differ diff --git a/processed_images/plane.1d1c4603272df01c.jpg b/processed_images/plane.1d1c4603272df01c.jpg new file mode 100644 index 0000000..632d34e Binary files /dev/null and b/processed_images/plane.1d1c4603272df01c.jpg differ diff --git a/processed_images/remembering.d5cbac5a50428cfe.jpg b/processed_images/remembering.d5cbac5a50428cfe.jpg new file mode 100644 index 0000000..4d0f69d Binary files /dev/null and b/processed_images/remembering.d5cbac5a50428cfe.jpg differ diff --git a/processed_images/return.72ffb896675f2b89.jpg b/processed_images/return.72ffb896675f2b89.jpg new file mode 100644 index 0000000..12a091b Binary files /dev/null and b/processed_images/return.72ffb896675f2b89.jpg differ diff --git a/processed_images/same.08fa69c050176a7c.jpg b/processed_images/same.08fa69c050176a7c.jpg new file mode 100644 index 0000000..ecc4ed3 Binary files /dev/null and b/processed_images/same.08fa69c050176a7c.jpg differ diff --git a/processed_images/sml_to_ocaml.03cb049cbd625314.png b/processed_images/sml_to_ocaml.03cb049cbd625314.png new file mode 100644 index 0000000..e5a95b7 Binary files /dev/null and b/processed_images/sml_to_ocaml.03cb049cbd625314.png differ diff --git a/processed_images/steps.99ab2d5a7cb29585.jpg b/processed_images/steps.99ab2d5a7cb29585.jpg new file mode 100644 index 0000000..99a49ea Binary files /dev/null and b/processed_images/steps.99ab2d5a7cb29585.jpg differ diff --git a/processed_images/together.20b0dcc8c3b1e9eb.jpg b/processed_images/together.20b0dcc8c3b1e9eb.jpg new file mode 100644 index 0000000..17eb6df Binary files /dev/null and b/processed_images/together.20b0dcc8c3b1e9eb.jpg differ diff --git a/projects/index.html b/projects/index.html new file mode 100644 index 0000000..f0dc0c6 --- /dev/null +++ b/projects/index.html @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ +

Projects

+ + + + + +
+

Here are some projects I'm working on, actively or passively, which I felt +didn't fit into the other sections on teaching, or creative works, or details +about myself.

+ +

mulligan

+

mulligan is a stepping debugger for the Standard ML +language, aimed at making it easy to trace through the execution of simple +Standard ML expressions, at a finer level of granularity than is possible +through the SML/NJ REPL, which will not display the intermediary steps it takes +to compute a value.

+
+
+ Floating Image +
+ While mulligan works fine on simple examples, it is + currently in a beta state which is likely to have bugs. In addition, the + standard library is not currently implemented in it, meaning that definitions + must be supplied for most all functions for mulligan to + know about it. Regardless, for teaching purposes, mulligan is useful for programmatically generating traces, as well as for + clarifying to beginners how SML's execution model really works. +
+

+ deriving-sml +

+

+ deriving-sml is a code generation tool that aims to + limitedly mimic the functionality of its more popular OCaml cousin, + ppx-deriving, but + for the Standard ML language. +

+
+
+deriving-sml supports four "plugins", those being eq, compare, show, and map. deriving-sml parses a "meta-SML" +dialect which includes "deriving metadata" attached to type declarations, which +signals to deriving-sml to produce code for each of the +four functionalities, in a type-directed way. +

For instance, the following code:

+
structure Foo =
+  struct
+    type t = int * string [.deriving show, eq]
+
+    datatype t2 =
+        One
+      | Two [.deriving show, compare]
+  end
+
+

produces the following code, when fed into deriving-sml:

+
structure Foo =
+  struct
+    type t = (int * string) (* [.deriving show,eq] *)
+    fun show_t (t1, t2) =
+        (op^ ( ((op^ ( ("(",
+                        (op^ ( ((Int.toString ( t1 )),
+                                (op^ ( (", ",
+                                        (op^ ( ((op^ ( ("\"", t2) )),
+                                                "\"") ))) ))) ))) )),
+                ")") ))
+    and t_show x = (show_t ( x ))
+    fun eq_t ((t5, t7), (t6, t8)) =
+        ((op= ( (t5, t6) )) andalso (op= ( (t7, t8) )))
+    and t_eq x = (eq_t ( x ))
+    datatype t2 = One | Two (* [.deriving show,compare] *)
+    fun show_t2 t9 = (case t9 of One => "One" | Two => "Two")
+    and t2_show x = (show_t2 ( x ))
+    fun cmp_t2 (t10, t11) =
+        (case (t10, t11) of
+           (One, One) => EQUAL
+         | (Two, Two) => EQUAL
+         | (x, y) =>
+             (Int.compare ( (((fn x =>
+                                    (case x of
+                                       One => 0
+                                     | Two => 1)) ( x )),
+                             ((fn x =>
+                                    (case x of
+                                       One => 0
+                                     | Two => 1)) ( y ))) )))
+    and t2_cmp x = (cmp_t2 ( x ))
+    and t2_compare x = (cmp_t2 ( x ))
+    and compare_t2 x = (cmp_t2 ( x ))
+  end
+
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/prologue/index.html b/prologue/index.html new file mode 100644 index 0000000..02d463c --- /dev/null +++ b/prologue/index.html @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 1 - Prologue

+ + + + + + + +
+

This lecture served at the introductory lecture to the course. We +introduced the Standard ML language, which we will be working in +for the remainder of the semester, and discussed some philosophical +objectives for what ideals we should strive for as programmers.

+

Functional programming can be seen as a reification of these ideals, +by striving towards improving our ability to communicate as programmers +through descriptive, modular, and maintainable code. We will see later +on in the semester how functional programming really achieves this, but +the ultimate goal is stated as not just programming, but programming better.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/prologue/lecture01.pdf b/prologue/lecture01.pdf new file mode 100644 index 0000000..871b7d8 Binary files /dev/null and b/prologue/lecture01.pdf differ diff --git a/prologue/lecture01.png b/prologue/lecture01.png new file mode 100644 index 0000000..1a558db Binary files /dev/null and b/prologue/lecture01.png differ diff --git a/redblack/index.html b/redblack/index.html new file mode 100644 index 0000000..4eea3a4 --- /dev/null +++ b/redblack/index.html @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 16 - Red-Black Trees

+ + + + + + + +
+

A key motivation given for SML's module system is in its treatment of abstract types, where we can have modules which contain types whose +definitions are not known, which forbids users from creating invalid instances +of values of that type. This is especially useful when dealing with data +structures with inner invariants, which could cause unsafe behavior when those +invariants are broken.

+

A classic example of a data structure with invariants is a binary search tree, +which maintains an ordering invariant on its keys. A stronger example still is +that of the self-balancing binary tree, which is a binary search +tree which maintains rough balance (and thus $O(\log n)$ complexity operations) +via disciplined use of invariants. This includes red-black trees.

+

We saw that red-black trees employ three main invariants, which involve keeping +a color for each node in the tree. We discussed the theory behind why these +invariants would preserve efficient lookup and insertion, and devised a scheme +for preserving the invariants by briefly breaking them, and then restoring them +again.

+

This provided another strong example for the efficacy of reasoning via +specification, as by fixing a specification that contained desirable properties, +and then focusing solely on incrementally maintaining that specification, we +were able to implement our desired data structure. Via our usage of modules, +these invariants also have the extremely strong property that they can never be +broken via a consumer of the library.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/redblack/lecture16.pdf b/redblack/lecture16.pdf new file mode 100644 index 0000000..fd86c9c Binary files /dev/null and b/redblack/lecture16.pdf differ diff --git a/redblack/lecture16.png b/redblack/lecture16.png new file mode 100644 index 0000000..c430f92 Binary files /dev/null and b/redblack/lecture16.png differ diff --git a/regex/index.html b/regex/index.html new file mode 100644 index 0000000..e941b06 --- /dev/null +++ b/regex/index.html @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 13 - Regular Expressions

+ + + + + + + +
+

String validation is an important problem in computer science. We are often +interested in processing some kind of text and extracting information from it, +or verifying that it matches some expected input schema. Regular +expressions are an extremely well-established tool in the field of computer +science, which aim to solve exactly that problem.

+

In this lecture, we explored the theory of regular expressions, and saw how they +could be defined by a simple SML datatype. Regular expressions are defined to +correspond to a particular set of strings, known as a language, +according to a simple recursive mathematical description.

+

We then used this SML datatype of regexp to define a function that attempts to +match a string to a regular expression, by recursive decomposition on the structure +of the regular expression. We found that this admitted a reasonably terse and +simple implementation, via a match function with a particular specification +having to do with splitting the string into a prefix and suffix satisfying +certain conditions.

+

While this description seems scary, it is easier to think of in terms of a +picture, which gives credence to thinking about code behind a layer of intuitive +abstraction, whenever possible. By reasoning via specification or picture, we +can prove our implementation correct, and learn how to implement such a function +well.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/regex/lecture13.pdf b/regex/lecture13.pdf new file mode 100644 index 0000000..18265ea Binary files /dev/null and b/regex/lecture13.pdf differ diff --git a/regex/lecture13.png b/regex/lecture13.png new file mode 100644 index 0000000..1c33eb4 Binary files /dev/null and b/regex/lecture13.png differ diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..3c748bc --- /dev/null +++ b/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Disallow: +Allow: / +Sitemap: https://brandonspark.github.io/sitemap.xml diff --git a/seq/index.html b/seq/index.html new file mode 100644 index 0000000..a9d924b --- /dev/null +++ b/seq/index.html @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 17 - Sequences

+ + + + + + + +
+

We have discussed the importance of parallelism several times thus far in the +course, and even conducted mathematical analysis of time complexity in the +presence of parallelism, but so far given a limited selection of +parallel-friendly data structures. Our go-to data structure for parallelism +purposes is the tree, as the list is an inherently sequential data structure, +but it doesn't need to be the only one.

+

In this lecture, we introduced sequences, which are essentially +immutable arrays. They are fixed-size lists that admit constant-time access to +any given element, which is a very strong property that allows us to have nice +parallel operations. For instance, mapping a function onto a sequence can be done +faster than $O(n)$ in the length of the sequence, as each cell can be done at the +same time, whereas on a list it is bottlenecked to be at least linear, due to +needing to traverse to the end of the list.

+

We walked through the sequence library, which provided many familiar list +functions, albeit on sequences. We also discussed the theory of cost +graphs, which are a mathematical tool that we can use to analyze the time +complexity of nested sequence operations.

+

While sequences are useful, they are generally better for bulk operations when +the number of elements is known ahead of time. For serial operations involving +singular elements, lists tend to be better. Sequences are overall an interesting +application of a module with an abstract interface, as well as a nice case study +of how we can obtain the benefits of imperative structures like arrays, without +compromising immutability.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/seq/lecture17.pdf b/seq/lecture17.pdf new file mode 100644 index 0000000..9fdaf6f Binary files /dev/null and b/seq/lecture17.pdf differ diff --git a/seq/lecture17.png b/seq/lecture17.png new file mode 100644 index 0000000..f031ba5 Binary files /dev/null and b/seq/lecture17.png differ diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..0f8c995 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,109 @@ + + + + https://brandonspark.github.io/ + + + https://brandonspark.github.io/150/ + + + https://brandonspark.github.io/about/ + + + https://brandonspark.github.io/asymptotic/ + + + https://brandonspark.github.io/blog/ + + + https://brandonspark.github.io/compilers/ + + + https://brandonspark.github.io/courses/ + + + https://brandonspark.github.io/cps/ + + + https://brandonspark.github.io/creative/ + + + https://brandonspark.github.io/equivalence/ + + + https://brandonspark.github.io/events/ + + + https://brandonspark.github.io/events/test/ + 2019-11-27 + + + https://brandonspark.github.io/exceptions/ + + + https://brandonspark.github.io/finale/ + + + https://brandonspark.github.io/functors/ + + + https://brandonspark.github.io/hofs/ + + + https://brandonspark.github.io/imperative/ + + + https://brandonspark.github.io/induction/ + + + https://brandonspark.github.io/lazy/ + + + https://brandonspark.github.io/modules/ + + + https://brandonspark.github.io/ocaml/ + + + https://brandonspark.github.io/pa/ + + + https://brandonspark.github.io/pages/ + + + https://brandonspark.github.io/parallel/ + + + https://brandonspark.github.io/poly/ + + + https://brandonspark.github.io/projects/ + + + https://brandonspark.github.io/prologue/ + + + https://brandonspark.github.io/redblack/ + + + https://brandonspark.github.io/regex/ + + + https://brandonspark.github.io/seq/ + + + https://brandonspark.github.io/staging/ + + + https://brandonspark.github.io/structural/ + + + https://brandonspark.github.io/tags/ + + + https://brandonspark.github.io/teaching/ + + + https://brandonspark.github.io/trees/ + + diff --git a/sml.js b/sml.js new file mode 100644 index 0000000..11d9c6f --- /dev/null +++ b/sml.js @@ -0,0 +1,29 @@ +/*! `sml` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>({name:"SML (Standard ML)", +aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?", +keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while", +built_in:"array bool char exn int list option order real ref string substring vector unit word", +literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/, +contains: + [ { className:"literal", + begin:/\[(\|\|)?\]|\(\)/, + relevance:0 + }, + e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}), + // EDITED: just to make it separate from the others, shoved it into attribute + {className:"attribute", begin:"'[A-Za-z_](?!')[\\w']*"}, + {className:"type",begin:"`[A-Z][\\w']*"}, + {className:"variable",begin:"\\b[A-Z][\\w']*",relevance:0}, + {begin:"[a-z_]\\w*'[\\w']*"}, + e.inherit(e.APOS_STRING_MODE,{className:"string", relevance:0}), + e.inherit(e.QUOTE_STRING_MODE,{illegal:null}), + // ADDED: make function names colored + { begin:[/fun/,/\s+/,e.IDENT_RE], + className:{1:"keyword", 3:"title.function"} + }, + { className:"number", + begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)", + relevance:0 + }, + { className:"symbol", begin:/[-=]>|\|>|>>=/ } + ]})})();hljs.registerLanguage("sml",e)})(); \ No newline at end of file diff --git a/staging/index.html b/staging/index.html new file mode 100644 index 0000000..38dc6ac --- /dev/null +++ b/staging/index.html @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 10 - Combinators and Staging

+ + + + + + + +
+

With higher-order, curried functions, we now have an idea of functions of +"multiple arguments", where those arguments may be given to the function at +different times. This leads us to the idea of partial evaluation, where we can specialize a function for later use by giving it a subset of +its curried arguments.

+

With this comes the idea of staging, which entails realizing +that useful work can be moved around a function with respect to its arguments. +This can allow us to do some optimization in terms of labor saved, by ensuring +that we reuse computations wherever possible, and avoid doing extraneous work, +as well as ensuring finer-grained control over our computations in general.

+

Another idea introduced in this lecture is that of the pipe operator, |>, +which is a higher-order function that helps us write code, by sequencing +operations in a way that can be read more intuitively. We also saw its cousin, +the option-oriented >>=, which lets us pipe together operations that may fail, +in a similar way. These are just examples of how higher-order functions give us +more fundamental power in the expressivity and customizability of our code.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/staging/lecture10.pdf b/staging/lecture10.pdf new file mode 100644 index 0000000..0f14cb6 Binary files /dev/null and b/staging/lecture10.pdf differ diff --git a/staging/lecture10.png b/staging/lecture10.png new file mode 100644 index 0000000..ca6061e Binary files /dev/null and b/staging/lecture10.png differ diff --git a/structural/index.html b/structural/index.html new file mode 100644 index 0000000..de5f0dc --- /dev/null +++ b/structural/index.html @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 4 - Structural Induction and Tail Recursion

+ + + + + + + +
+

Simple induction on the natural numbers can get us reasonably far +when it comes to proving theorems, but in this class we are also +interested in proving theorems on SML code, not just for mathematical +propositions. In such cases, we would like to be able to induct on +the structure of data, which leads us to a phenomenon known as +structural induction, a more powerful, more general +form of induction.

+

We saw how we could employ structural induction to induct on the structure of a +list, by proving a base case and inductive case, using the principle of +structural induction for lists. This is similar to the principle of simple +induction for natural numbers, which involves a base case and inductive step of +$n$ and $n+1$, but instead operates on SML lists in the cases of [] and +x::xs.

+

We then introduced the concept of tail recursion, which concerns +recursive functions which perform a recursive call, as the last thing that they +do. We saw that these have implications for efficiency benefits, because by not +needing to remember to do things after the recursive call, we avoid needing to use +excess memory, and we applied this knowledge to write the tail-recursive version +of the length function, in tlength.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/structural/lecture04.pdf b/structural/lecture04.pdf new file mode 100644 index 0000000..991deba Binary files /dev/null and b/structural/lecture04.pdf differ diff --git a/structural/lecture04.png b/structural/lecture04.png new file mode 100644 index 0000000..4f2b9b7 Binary files /dev/null and b/structural/lecture04.png differ diff --git a/style.css b/style.css new file mode 100644 index 0000000..7af8d39 --- /dev/null +++ b/style.css @@ -0,0 +1 @@ +.button-container{display:table;margin-left:auto;margin-right:auto}button,.button,a.button{position:relative;display:flex;align-items:center;justify-content:center;padding:8px 18px;margin-bottom:5px;text-align:center;border-radius:8px;border:1px solid rgba(0,0,0,0);appearance:none;cursor:pointer;outline:none;}button.outline,.button.outline,a.button.outline{background:rgba(0,0,0,0);box-shadow:none;padding:8px 18px}button.outline :hover,.button.outline :hover,a.button.outline :hover{transform:none;box-shadow:none}button.primary,.button.primary,a.button.primary{box-shadow:0 4px 6px rgba(50,50,93,.11),0 1px 3px rgba(0,0,0,.08)}button.primary:hover,.button.primary:hover,a.button.primary:hover{box-shadow:0 2px 6px rgba(50,50,93,.21),0 1px 3px rgba(0,0,0,.08)}button.link,.button.link,a.button.link{background:none;font-size:1rem}button.small,.button.small,a.button.small{font-size:.8rem}button.wide,.button.wide,a.button.wide{min-width:200px;padding:14px 24px}a.read-more,a.read-more:hover,a.read-more:active{display:inline-flex;background:none;box-shadow:none;padding:0;margin:20px 0;max-width:100%}.code-toolbar{margin-bottom:20px}.code-toolbar .toolbar-item a{position:relative;display:inline-flex;align-items:center;justify-content:center;padding:3px 8px;margin-bottom:5px;text-align:center;font-size:13px;font-weight:500;border-radius:8px;border:1px solid rgba(0,0,0,0);appearance:none;cursor:pointer;outline:none}.header{display:flex;flex-direction:column;position:relative}.header__inner{display:flex;align-items:center;justify-content:space-between}.header__logo{display:flex;flex:1}.header__logo:after{content:"";background:repeating-linear-gradient(90deg, var(--accent), var(--accent) 2px, rgba(0,0,0,0) 0, rgba(0,0,0,0) 16px);display:block;width:100%;right:10px}.header__logo a{flex:0 0 auto;max-width:100%}.header .menu{margin:20px 0}.header .menu__inner{display:flex;flex-wrap:wrap;list-style:none;margin:0;padding:0}.header .menu__inner li.active{color:var(--accent-alpha-70)}.header .menu__inner li:not(:last-of-type){margin-right:20px;margin-bottom:10px;flex:0 0 auto}.header .menu__sub-inner{position:relative;list-style:none;padding:0;margin:0}.header .menu__sub-inner:not(:only-child){margin-left:20px}.header .menu__sub-inner-more{position:absolute;background:var(--background);box-shadow:var(--shadow);color:#fff;border:2px solid;margin:0;padding:10px;list-style:none;z-index:99;top:35px;left:0}.header .menu__sub-inner-more-trigger{color:var(--accent);user-select:none;cursor:pointer}.header .menu__sub-inner-more li{margin:0;padding:5px;white-space:nowrap}.logo{display:flex;align-items:center;text-decoration:none;background:var(--accent);color:#000;padding:5px 10px}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}body{margin:0;padding:0;font-family:"Trebuchet MS","Lucida Sans Unicode","Lucida Grande","Lucida Sans",Arial,sans-serif;font-size:1rem;line-height:1.54;background-color:var(--background);color:var(--color);text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-text-size-adjust:100%}@media (max-width: 683px){body{font-size:1rem}}h1,h2,h3,h4,h5,h6{display:flex;align-items:center;font-weight:bold;line-height:1.3}h1{font-size:1.4rem}h2{font-size:1.3rem}h3{font-size:1.2rem}h4,h5,h6{font-size:1.15rem}a{color:inherit}img{display:block;max-width:100%}img.left{margin-right:auto}img.center{margin-left:auto;margin-right:auto}img.right{margin-left:auto}.responsive-iframe-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden}.responsive-iframe-container iframe{position:absolute;top:0;left:0;width:100%;height:100%}.coolthing{float:right;width:50%}p{margin-bottom:20px}figure{display:table;max-width:100%;margin:25px 0}figure.left,figure img{margin-right:auto}figure.center,figure img{margin-left:auto;margin-right:auto}figure.right,figure img{margin-left:auto}figure figcaption{font-size:14px;padding:5px 10px;margin-top:5px;background:var(--accent);color:var(--background)}figure figcaption.left{text-align:left}figure figcaption.center{text-align:center}figure figcaption.right{text-align:right}code{font-family:Hack,DejaVu Sans Mono,Monaco,Consolas,Ubuntu Mono,monospace;font-feature-settings:normal;color:#8b77cd;padding:0px 0px;margin:0 2px;font-size:.95rem;border-style:solid;border-color:#434343;border-width:1.5px}pre{font-family:Hack,DejaVu Sans Mono,Monaco,Consolas,Ubuntu Mono,monospace;padding:10px;font-size:.95rem;overflow:auto}@media (max-width: 683px){pre{white-space:pre-wrap;word-wrap:break-word}}pre code{padding:0;margin:0;background:none}blockquote{border-top:1px solid var(--accent);border-bottom:1px solid var(--accent);margin:40px 0;padding:25px}@media (max-width: 683px){blockquote{padding-right:0}}blockquote:before{content:"”";font-family:Georgia,serif;font-size:3.875rem;position:absolute;left:-40px;top:-20px}blockquote p:first-of-type{margin-top:0}blockquote p:last-of-type{margin-bottom:0}blockquote p{position:relative}blockquote p:before{content:">";display:block;position:absolute;left:-25px;color:var(--accent)}table{table-layout:fixed;border-collapse:collapse;width:100%;margin:40px 0}table,th,td{padding:10px}th{color:var(--accent)}ul,ol{margin-left:30px;padding:0}ul li,ol li{position:relative}@media (max-width: 683px){ul,ol{margin-left:20px}}ul.fancy{list-style:none}ul.fancy li:before{content:"➔";position:absolute;left:-20px;color:var(--accent)}ol ol{list-style-type:lower-alpha}.container{display:flex;flex-direction:column;padding:40px;max-width:864px;min-height:100vh;margin:0 auto}@media (max-width: 683px){.container{padding:20px}}.content{display:flex}hr{width:100%;border:none;background:var(--border-color);height:1px}.hidden{display:none}.profile{width:100%;margin-right:5rem;border-top:1px solid rgba(255,255,255,.1);border-bottom:1px solid rgba(255,255,255,.1)}.profile .address{margin-bottom:5px;margin-top:5px;font-family:monospace}.profile .address p{display:inline-block;margin:0}.profile.float-right{margin-right:5rem}.profile.float-right img{display:block}.event{display:inline;height:100%;vertical-align:middle}.image-gallery{display:flex;flex-wrap:wrap;padding:10px 10px;border-top:1px solid rgba(255,255,255,.1);border-bottom:1px solid rgba(255,255,255,.1)}.image-gallery a{flex:0 0 calc(33% - 10px);margin:5px}.lecture-entry{flex-wrap:wrap;border-top:1px solid rgba(255,255,255,.1);border-bottom:1px solid rgba(255,255,255,.1)}.lecture-entry .image-column{display:inline-block;margin-right:10px;vertical-align:top;width:40%}.lecture-entry .info-column{display:inline-block;width:58%;height:200px}.lecture-entry .flexy-thing{width:auto;justify-content:space-between;flex-direction:column;display:flex;height:100%}.lecture-entry .lecture-entry-title{height:40%;font-size:19px;margin-top:10px;margin-bottom:3px}.lecture-entry-title-span{border-bottom:1px solid #4d4d4d}.lecture-entry-title-span a{text-decoration:none}.lecture-entry .lecture-entry-description{color:#c3c3c3}.lecture-entry .lecture-entry-quote{height:30%;font-style:italic;font-size:20px}.lecture-entry .lecture-entry-link{height:40%}.with-bottom-spacing{margin-bottom:2cm}.posts{width:100%;margin:0 auto}.post{width:100%;text-align:left;margin:-20px auto;padding:20px 0}@media (max-width: 899px){.post{max-width:660px}}.post:not(:last-of-type){border-bottom:1px solid var(--border-color)}.post .post-meta-inline,.post .post-meta{font-size:1rem;margin-bottom:10px;color:var(--accent-alpha-70)}.post-meta-inline{display:inline}.post-title{--border: 2px solid var(--accent);position:relative;color:var(--accent);margin:0 0 15px;padding-bottom:15px;border-bottom:var(--border);font-weight:normal}.post-title a{text-decoration:none}.post .post-tags-inline,.post .post-tags{margin-bottom:20px;font-size:1rem;opacity:.5}.post-tags{display:block}.post-tags-inline{display:inline}@media (max-width: 683px){.post-tags-inline{display:block}}.post-content{margin-top:30px}.post-cover{border:20px solid var(--accent);background:rgba(0,0,0,0);margin:40px 0;padding:20px}@media (max-width: 683px){.post-cover{padding:10px;border-width:10px}}.post ul{list-style:none}.post ul li:before{content:"➔";position:absolute;left:-20px;color:var(--accent)}.post--regulation h1{justify-content:center}.post--regulation h2{justify-content:center;margin-bottom:10px}.post--regulation h2+h2{margin-top:-10px;margin-bottom:20px}.post-list .post-date{color:var(--accent-alpha-70);text-decoration:none}.post-list a{text-decoration:none}.post-list .post-list-title{text-decoration:underline}.post-list .post-tag{text-decoration:underline}.pagination{margin-top:50px}.pagination__title{display:flex;text-align:center;position:relative;margin:100px 0 20px}.pagination__title-h{text-align:center;margin:0 auto;padding:5px 10px;background:var(--background);font-size:.8rem;text-transform:uppercase;letter-spacing:.1em;z-index:1}.pagination__title hr{position:absolute;left:0;right:0;width:100%;margin-top:15px;z-index:0}.pagination__buttons{display:flex;align-items:center;justify-content:center}@media (max-width: 683px){.pagination__buttons{flex-direction:column}}.button{position:relative;display:inline-flex;align-items:center;justify-content:center;font-size:1rem;border-radius:8px;max-width:40%;padding:0;cursor:pointer;appearance:none}@media (max-width: 683px){.button{max-width:80%}}.button+.button{margin-left:10px}.button a{display:flex;padding:8px 16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.button__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.footer{padding:40px 0;flex-grow:0;opacity:.5}.footer__inner{display:flex;align-items:center;justify-content:space-between;margin:0;width:760px;max-width:100%}@media (max-width: 899px){.footer__inner{flex-direction:column}}.footer a{color:inherit}.footer .copyright{display:flex;flex-direction:row;align-items:center;font-size:1rem;color:var(--light-color-secondary)}.footer .copyright--user{margin:auto;text-align:center}.footer .copyright>*:first-child:not(:only-child){margin-right:10px}@media (max-width: 899px){.footer .copyright>*:first-child:not(:only-child){border:none;padding:0;margin:0}}@media (max-width: 899px){.footer .copyright{flex-direction:column;margin-top:10px}}@media (max-width: 899px){.footer .copyright-theme-sep{display:none}}@media (max-width: 899px){.footer .copyright-theme{font-size:.75rem}} \ No newline at end of file diff --git a/syntax_colors.css b/syntax_colors.css new file mode 100644 index 0000000..d7e9527 --- /dev/null +++ b/syntax_colors.css @@ -0,0 +1,62 @@ +/* This is an adaptation of the dark.min.css theme, from + https://github.com/highlightjs/cdn-release/blob/main/build/styles/dark.min.css + + I edited it slightly to have colors I liked better, though. + */ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code + +.hljs{padding:3px 5px} +.hljs{color:#abb2bf;background:#282c34} + +.hljs-comment, +.hljs-quote{color:#5c6370;font-style:italic} + +.hljs-doctag, +.hljs-formula, +.hljs-keyword{color:#9178dd} + +.hljs-deletion, +.hljs-name, +.hljs-section, +.hljs-selector-tag, +.hljs-subst{color:#e06c75} + +.hljs-literal{color:#56b6c2} + +.hljs-addition, +.hljs-meta +.hljs-string, +.hljs-regexp, +.hljs-string{color:#db6969} + +/* Type variables, in SML */ +.hljs-attribute{color:#f2e464} + +.hljs-attr, +.hljs-number, +.hljs-selector-attr, +.hljs-selector-class, +.hljs-selector-pseudo, +.hljs-template-variable, +.hljs-variable{color:#d19a66} + +.hljs-bullet, +.hljs-link, +.hljs-meta, +.hljs-selector-id, +.hljs-symbol, +.hljs-title{color:#61aeee} + +/* Specifically for names that come after `fun` in SML */ +.hljs-title.function_{color:#3ed4cf} + +.hljs-built_in, +.hljs-class + +.hljs-type, +.hljs-title, +.hljs-title.class_{color:#88e67b} + +.hljs-emphasis{font-style:italic} +.hljs-strong{font-weight:700} +.hljs-link{text-decoration:underline} \ No newline at end of file diff --git a/teaching.jpg b/teaching.jpg new file mode 100644 index 0000000..0acae08 Binary files /dev/null and b/teaching.jpg differ diff --git a/teaching/index.html b/teaching/index.html new file mode 100644 index 0000000..556e977 --- /dev/null +++ b/teaching/index.html @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ +

Teaching

+ + + + + +
+ + + + + + + + +

Teaching is something which is very important to me. I was fortunate enough +to have had the opportunity to be a teaching assistant for nearly my entire +undergraduate education, and it's something I feel very passionately for. +I'm always looking for new ways to explain old concepts, new concepts that I +can learn how to explain to others, and new opportunities to teach.

+

Philosophy

+

In some respect, my philosophy on teaching is that there can be no objective +philosophy on teaching. I have encountered many different varieties of +teaching strategies from previous mentors and teachers and professors that +I have had, and while every single instructor has been convinced of their +own efficacy, very few of them tend to agree.

+

I believe that if you pick a teaching style, there are generally enough merits +in their own right that most all of them are perfectly valid. That being +said, I have my own priorities that I believe in.

+

Owing to the fact that I spent approximately 70% of my time in college lectures +asleep, I believe that one of the most important aspects of teaching is in raw passion and ability to engage the audience. +Students cannot learn anything if they are tabbed out or asleep. It should be +the job of the instructor to minimize mental friction as much as possible so +that students don't take opportunities to tune out. In other words: Students +should be having fun!

+

I also believe strongly in interesting visual learning. Classic +computer science materials can be incredibly dry, with boring black-and-white +diagrams and overbearing notation that do little to make an impression. I +think there is much room for graphic visualizations of abstract concepts +and colorful and vivid imagery, and I am trying to change that if at all possible.

+

Experience

+

Here's some of the courses that I taught while I was at CMU:

+
    +
  • 15-150: Principles of Functional Programming (F19, S20, M20$\color{yellow}^\dagger$, F20$\color{yellow}^\dagger$, +S21$\color{yellow}^\dagger$, S22)
  • +
  • 15-213: Introduction to Computer Systems (M20)
  • +
  • 15-312: Foundations of Programming Languages (F21)
  • +
  • 98-389: Gödel, Escher, Bach: an Eternal Golden StuCo (F21, S22)
  • +
  • 98-317: Hype for Types (F21, S22)
  • +
+

(where $\color{yellow}\dagger$ denotes a semester as Head TA)

+

Honorable mentions that I was a tutor for:

+
    +
  • 15-251: Great Theoretical Ideas in Computer Science
  • +
  • 15-122: Principles of Imperative Computation
  • +
  • 21-127: Concepts of Mathematics
  • +
+

15-150

+

15-150 is the class that I taught for the longest, and one which has +single-handedly decided the course of my professional career. I +consider teaching functional programming my mission in life, and I am in +pursuit of as much experience and knowledge in that domain as possible. I have +long-term aspirations of one day teaching functional programming in high +schools.

+

I had the distinct privilege to be the instructor of record for 15-150 in +the Summer 2023 semester. The sum of my career with 150, it gave me the chance +to work with a team of 8 TAs to deliver a world-class education to a class of +50 undergraduates, in my debut as a visiting lecturer.

+

You can find the lectures and recordings from that +semester under this page.

+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/trees/index.html b/trees/index.html new file mode 100644 index 0000000..6ae50a8 --- /dev/null +++ b/trees/index.html @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +
+ +

Lecture 5 - Trees

+ + + + + + + +
+

Like lists, trees are immensely important data structures in computer science. +In this lecture, we saw how we could formulate trees in SML using a new language +feature of datatype declarations, which allow us to create brand +new types, with their own constructors.

+

We then explored the idea of different kinds of tree traversals, +which are prescribed ways to traverse the nodes of a binary tree, and which +also admit a simple recursive implementation in SML.

+

To prove theorems on trees, we saw that we also can derive a principle of +structural induction on trees, which differs from that of lists in that it +involves assuming two induction hypotheses -- one for the left subtree, and one +for the right. We then used this technique to prove a theorem showing the +equivalence of summing the elements of a tree by first turning it into a list, +and by summing the elements of the tree directly.

+

This lecture also introduced the idea of totality citations, +which are an important part of ensuring that our proofs on SML code remain accurate.

+

We finished off by discussing the order type, which is a type with three constructors, +corresponding to the output of a comparison function. We saw how using a new type +explicitly for this purpose is more robust than other methods, like using an int or +a string. This represents a core benefit of a functional language like SML, which lets +us design our types to fit our use cases faithfully.

+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + + \ No newline at end of file diff --git a/trees/lecture05.pdf b/trees/lecture05.pdf new file mode 100644 index 0000000..18b7a3a Binary files /dev/null and b/trees/lecture05.pdf differ diff --git a/trees/lecture05.png b/trees/lecture05.png new file mode 100644 index 0000000..e826809 Binary files /dev/null and b/trees/lecture05.png differ diff --git a/variables.css b/variables.css new file mode 100644 index 0000000..e69de29