About me

I'm a Senior Research Associate (EPSRC Doctoral Prize Fellow) in the field of Programming Languages, and am affiliated with the Programming Languages Research Group at the University of Bristol. Before this, I also did my PhD and MEng in Computer Science at Bristol. Some of my main interests include functional programming (Haskell in particular), types & strongly-typed languages, and all things glorious that involve them.


Currently, I'm looking at:

Lazy evaluation for bidirectional live programming investigating lazy bidirectional evaluation, for generating updated source code that produces a desired change to its output.
Bidirectional transformations for missing data in web-development investigating a bidirectional system for synchronising missing and shared data, applying this to a modular framework for web development where back-end "models" may be shared between multiple front-end "views".
Graph-based program slicing for data provenance investigating graph-based slicing techniques, for calculating the fragments of programs needed to compute specific fragments of their outputs.
Monte Carlo algorithms for property-based testing investigating Monte Carlo notions of "similarity", for randomly generating program inputs that satisfy a desired property.

For my PhD, I investigated how algebraic effects and effect handlers can be used to improve the design of probabilistic programming languages. I used these techniques to implement a type-safe, modular framework for programmable inference [λ], and an embedding of probabilistic models as first-class citizens [λ].

Other projects I've led include the application of recursion schemes for implementing and training neural networks [λ]; in particular, I show how neural networks can be represented as fixed-points of recursive data structures, and forward and back propagation as folds and unfolds over these structures.

Papers, etc.

  Lazy Bidirectional Evaluation
   X.Zhang, M.Nguyen
  In submission, 2024
  Conjugate Operators for Transparent, Explorable Research Outputs (preprint)
   J.Bond, C. David, M.Nguyen, D.Orchard, R.Perera
  In submission, 2024
 Effects and Effect Handlers for Probabilistic Programming (pdf)
   Doctoral Thesis, 2023
  Effect Handlers for Programmable Inference (preprint, proceedings)
   M.Nguyen, R.Perera, M.Wang, S.Ramsay
   Haskell Symposium, 2023
  Towards Type-driven Data Science in Idris (abstract, repository)
   O.Kammar, K.Marek, M.Nguyen, M.Steuwer, J.Walters, R.Wright
   Languages for Inference Workshop, 2023
 Folding over Neural Networks (preprint, proceedings)
   M.Nguyen, N.Wu
   Mathematics of Program Construction, 2022
 Modular Probabilistic Models via Algebraic Effects (preprint, proceedings, repository)
   M.Nguyen, R.Perera, M.Weng, N.Wu
   International Conference on Functional Programming, 2022
 Linked visualisations via Galois dependencies (preprint, proceedings, repository)
   R.Perera, M.Nguyen, T.Petricek, M.Weng
   Principles Of Programming Languages, 2022
 Composable, Modular Probabilistic Models (extended abstract, poster)
   M.Nguyen, R.Perera, M.Weng
   International Conference on Functional Programming (SRC), 2021
 Composable, Modular Probabilistic Models (paper)
   M.Nguyen, R.Perera, M.Weng
   Implementation and Application of Functional Languages, 2021

Some Talks

 Effects and Effect Handlers for Probabilistic Programming
    PhD Defence, Sep 2023
 Effect Handlers for Programmable Inference
   Haskell Symposium, Sep 2023  (video)
   Tech Talk @ The Alan Turing Institute, May 2023
 Modular Probabilistic Models via Algebraic Effects  
   International Conference on Functional Programming, Sep 2022 (video, slides)
   Programming Languages Seminar @ University of Edinburgh, May 2022 (slides)
   Tech Talk @ The Alan Turing Institute, Jan 2023
 Folding over Neural Networks  
   Mathematics of Program Construction, Sep 2022
 Composable, Modular Probabilistic Models
   International Conference on Functional Programming (SRC), Sep 2021 (video, slides)
   Implementation and Application of Functional Languages,  Sep 2021 (video, slides)

Work & Studies

2023 - Present
Senior Research Associate (EPSRC Doctoral Prize Fellow) in Programming Languages
  hosted by Cristina David @ University of Bristol
Jun - Sep 2022
Research Intern: Dependently typed probabilistic programming for Idris2 (repositories)
  supervised by Ohad Kammar @ University of Edinburgh
2020 - 2023
PhD in Programming Languages
  supervised by Meng Wang and Roly Perera @ University of Bristol
2015 - 2019
MEng in Computer Science (first class)
  supervised by Nicolas Wu @ University of Bristol


2019 - Present
Seminars and guest lectures to the Programming Languages Research Group and CS undergraduates @ University of Bristol.
2017 - Present
Teaching in CS: Advanced Topics in Programming Languages (4th year), Language Engineering (2nd year), and Functional Programming (1st year) @ University of Bristol.
Supervisor for a 2nd year CS student in their research internship, on "Typed Functional Programming for Automatic Differentiation and Inference" @ University of Bristol.
Supervisor for a 4th year CS student in their masters dissertation, on "Deep Learning Architectures As Pure Functions" @ University of Bristol.

Funding & Awards

2023 ESPRC Doctoral Prize Fellowship Award
2021 1st Place: ICFP Graduate Research Competition, ACM
2020 EPSRC Doctoral Training Partnership Studentship Award
2019 Best Machine Learning Thesis, Bloomberg Award, University of Bristol
2018 Best Third Year Group Project, Graphcore Award, University of Bristol
2017 Top Ten Achieving CS Students, Netcraft Award, University of Bristol