Agda Implementors' Meeting XXXVII

The 37th Agda Implementors' Meeting will take place in Taipei, Taiwan from 20 to 25 Nov 2023, co-located with the 21st Asian Symposium on Programming Languages and Systems (APLAS'23). It will be hosted at the Institute of Information Science, Academia Sinica. It will be possible to attend the talks online, but the rest of the meeting is mostly in-person.

Registration deadline : 20 Oct 2023 (soft deadline)
AIM XXXVII : 20 – 25 Nov 2023
Table of contents

Program


Except Tuesday and Thursday morning, talks, coffee breaks and sprints will take place in room 108, Old Building of Institute of Information Science. On Tuesday and Thursday morning, the event will take place in room 101, New Building.

Planning


Monday, 20 Nov (Room 108, Old Building)
09:30Introduction & planning (slides)
10:15Coffee break
10:45Liang-Ting Chen: Towards Agda for the Web with Zero Installations (slides)
11:30 12:15Lunch
13:00 13:30Ting-gian LUA: agda-modes & Agda Language Server
14:30Coffee break
15:00Groups/Code sprints/Discussions
17:30Wrap-up meeting
Tuesday, 21 Nov (Room 101, New Building until 12:00; Room 108, Old Building after 12:00)
09:30Shin-Cheng Mu: Bottom-Up Computation Using Naturality and String Diagrams, Part I
10:15Coffee break
10:30Josh Ko: Bottom-Up Computation Using Naturality and String Diagrams, Part II
11:30Lunch
13:00Groups/Code sprints/Discussions
14:30Coffee break
15:00Groups/Code sprints/Discussions
17:00Wrap-up meeting
Wednesday, 22 Nov (Room 108, Old Building)
10:00Andras Kovacs: Practical Staged Programming from the Ground Up
11:30Lunch
13:30On-campus excursion
14:30Guided tour: Museum of the Institute of History and Philology
17:30 17:00Meeting dinner at Le Ble D'or
Thursday, 23 Nov (Room 101, New Building until 12:00; Room 108, Old Building after 12:00)
09:30Liang-Ting Chen: Verified Generic Bidirectional Type Checker
10:15Coffee break
10:30Groups/Code sprints/Discussions
12:00Lunch
13:30Groups/Code sprints/Discussions
15:00Coffee break
15:30Discussions with remote participants (CET 8:30, zoom link)
17:00Wrap-up meeting
Friday, 24 Nov (Room 108, Old Building)
09:30Groups/Code sprints/Discussions
10:30Coffee break
11:00Groups/Code sprints/Discussions
12:30Lunch
14:00Andreas Abel: Type-preserving compilation via dependently typed syntax (link)
15:30Coffee break
16:00 17:30Wrap-up meeting
Saturday, 25 Nov (Excursion)
09:00After-Meeting Excursion at Jioufen

Talks Proposals


Verified Generic Bidirectional Type Checker
Liang-Ting Chen
TBA
Bottom-Up Computation Using Naturality and String Diagrams
Shin-Cheng Mu and Josh Ko
Some top-down problem specifications, if executed, may compute sub-problems repeatedly. For such problems we want a bottom-up algorithm that stores solutions of sub-problems in some table so they can be reused. We study a special case proposed by Richard Bird in 2008: computing a function h :: List X -> Y such that h xs is defined in terms of all immediate sublists of ‘’xs''. Bird's algorithm builds trees having certain shapes. We discovered that dependent types not only enforces the shapes of trees, but also helps to prove the correctness of the algorithm, since the shape of a tree is uniquely determined by its type. The proofs use naturality extensively, and it turns out that these proofs can be greatly simplified if expressed in string diagrams, where natuality is, naturally, encoded in the notation.
Practical Staged Programming from the Ground Up
András Kovács
I sketch a programming language that's built around two-stage compilation as a core feature. The language aims to support high-level functional programming, but with much stronger guarantees about code generation and performance than what we get in OCaml and Haskell. For example, we can formally guarantee that fusion optimizations work properly. This enables a style of programming where fusion is widely used, and much of the traditional work of optimizing compilers is instead being done by user-written metaprograms.
Type-preserving compilation via dependently typed syntax
Andreas Abel

The CompCert project produced a verified compiler for a large fragment of the C programming language. The CompCert compiler is implemented in the type-theoretic proof assistant Coq, and is fully verified: there is a proof that the semantics of the source program matches the semantics of the target program. However, full verification comes with a price: the majority of the formalization is concerned not with the runnable code of the compiler, but with the properties of its components and proofs of these properties. If we are not willing to pay the price of full verification, can we nevertheless profit from the technology of type-theoretic proof assistants to make our compilers safer and less likely to contain bugs?

In this talk, I am presenting a compiler for a small fragment of the C language using dependently-typed syntax. A typical compiler is proceeding in phases: parsing, type checking, code generation, and finally, object/binary file creation. Parsing and type checking make up the front end, which may report syntax and type errors to the user; the other phases constitute the back end that should only fail in exceptional cases. After type checking succeeded, we have to deal only with well-typed source programs, whose abstract syntax trees can be captured with the indexed data types of dependently-typed proof assistants and programming languages like Agda, Coq, Idris, Lean etc. More concisely, we shall by dependently-typed syntax refers to the technique of capturing well-typedness invariants of syntax trees. Representing also typed assembly language via dependently-typed syntax, we can write a type-preserving compiler whose type soundness is given *by construction*. In the talk, the target of compilation is a fragment of the Java Virtual Machine (JVM) enriched by some *administrative instructions* that declare the types of local variables. With JVM being a stack machine, instructions are indexed not only by the types of the local variables, but also by the types of the stack entries before and after the instruction. However for instructions that change the control flow, such as unconditional and conditional jumps, we need an additional structure to ensure type safety. Jumps are safe if the jump target has the same machine typing than the jump source. By machine typing we mean the pair of the types of the local variables and the types of the stack entries. Consequently, each label (i.e., jump target) needs to be assigned a machine type and can only be targeted from a program point with the same machine type. We then distinguish two types of labels:

  • Join points, e.g., labels of statements following an if-else statement. Join points can be represented by a let binding in the abstract JVM syntax.
  • Looping points, e.g., labels at the beginning of a while statement that allows back jumps to iterate the loop. Those are represented by fix (recursion).

Using dependently-typed machine syntax, we ensure that well-typed jumps do not miss. As a result, we obtain a type-preserving compiler by construction, with a good chance of full correctness, since many compiler faults already break typing invariants. Intrinsic well-typedness also allows us to write the compiler as a total function from well-typed source to typed assembly, and totality can be automatically verified by the Agda type and termination checker.

Discussion Proposals


Agda for the web with zero installations
Liang-Ting Chen
I'd like to talk about the possibility of combining web-based IDEs, the ongoing development of Agda language server, and the experimental GHC wasm backend to create a fully functioning web-based Agda development environment.

Code Sprint Proposals


Implementing Language Server Protocol for Agda
Ting-gian LUA
TBA
Work on agda2hs
Orestis Melkonian
  • bugfixes
    • a lot of entry-level bugs currently on the issue tracker
    • happy to help anyone interested in getting started with agda2hs, show them around the codebase, fix bugs together, etc...
  • better error reporting
    • there are currently situations where agda2hs can produce invalid Haskell (e.g. when using identifiers supported by Agda, but not by Haskell)
    • these appear to the user at a later phase when invoking GHC
    • it would be nicer to catch them early on in our backend and have faster/better error messages
  • new Haskell features
    • GADTs
    • extract property-based tests from (erased) proofs
  • Prelude completeness
    • agda2hs comes with a port of Haskell's prelude written in Agda
      • ...but it is currently incomplete
      • ...and there are not many properties proven about these definitions
  • new application for agda2hs -- simplistic barebones blockchain
    • Within IOG, there is currently some potential for using agda2hs for a blockchain ledger formalisation in Agda.
    • To begin with, I would like personally to start a prototype solution for a "toy" blockchain that will be easier to work with.
      • this would be good for newcomers to get acquainted with agda2hs and how to use it for a simple application
      • moreover, I expect a lot of bug-finding to arise from this endeavour, so the plan is to start prototyping and see where we get stuck!
  • theoretical investigation, proving the compilation correct
    1. prototype featherweight Haskell and featherweight Agda (agda-core maybe?)
    2. decide on the methodology to use (piggyback on nad's work on erasure perhaps?)
Extensible frontends
Orestis Melkonian

In the same spirits as extensible backends (where we use Agda as a library and provide a new Haskell package), I would like to discuss the possibility for extensible frontends. For instance, `agda2hs` currently copy-pastes thousands LOC related to Emacs from the Agda codespace in order to be able to interactively call the backend from Emacs (+ possibly provide some backend-specific commands).

Another example from my own projects is the agda2train backend for generating training data for machine-learning purposes. These data cannot really be utilised in an interactive fashion (once we have a machine-learned model trained on those data), unless the backend can also provide Emacs functionality specific to this backend.

(More) extensible backends
Orestis Melkonian

Currently backends use Agda as a library, but it would be nice to be able to dynamically provide them as plugins to an existing Agda installation.

  • e.g. if I have two backends there is no easy way to use both at the same time, other than writing a new Haskell package that imports them and provides a "merged" backend
  • more of a discussion than a code sprint at this stage
datatype generics + agda-stdlib-meta = <3
Orestis Melkonian
  • discuss feasibility with Liang-Ting & Cas
  • compare & contrast deriving solution (e.g. for decidable equality DecEq)
Model checking
Orestis Melkonian

Make the prototype from AIMXXXVI (using the kind2 solver) more robust/general

  • either to include more Agda datatypes and more capabilities
  • ...or to use other solvers apart from `kind2`
  • ...or to write a solver within Agda
Agda Web, I: Compiling Agda into a usable WASM version
Liang-Ting Chen

This code sprint is a step towards a usable Agda inside a browser. As Agda is used as a library for implementing a language server, it is required to compile Agda into WASM. However, many parts of Agda assume it will be running on an actual OS instead of a browser. For example, a full file system does not exist and libraries cannot be imported.

We will first need to make sure that Agda can be compiled with the latest GHC WebAssembly backend.

Organisation



Location


The meeting will take place at the Institute of Information Science, Academia Sinica, Taipei, Taiwan.

  • Address: 128 Academia Road, Section 2, Taipei, Taiwan

Transportation, local Information, etc.

Campus map is here.

See https://conf.researchr.org/venue/aplas-2023/aplas-2023-venue for ways to arrive at Academia Sinica and https://conf.researchr.org/attending/aplas-2023/food_drink for dining options.

Suggested Way to arrive at Academia Sinica from the TPE airport:

  1. Go to the Taoyuan HSR Station via Airport MRT
  2. Go to the Nangang HSR Station via HSR
  3. (Optionally) Buy some food at Citylink Nangang (a mega shopping mall) above the HSR station
  4. Go to the Academia Sinica via Taxi (typically cash only) or Uber

Registration


To register, you can fill out the following form and send it to liang <dot> ting <dot> chen <dot> tw <at> gmail <dot> com. You can also directly fill your name in the section participants. In this case, you can also directly add a talk / discussion / code sprint proposal by copy and pasting the box examples.

If you can not attend in person, it will be possible to attend online the talks. You can register via email or directly by adding your name to the list.

to: liang <dot> ting <dot> chen <dot> tw <at> gmail <dot> com
Subject: Registration for Agda Implementors' Meeting XXXVII
  • Name:
  • Online or In person:
  • Affiliation:
  • If you wish to give a talk:
    • Title
    • Short Abstract (Optional)
  • If you wish to suggest a talk topic:
    • Topic
    • Short Description (Optional)
  • If you wish to suggest a code sprint:
    • Proposal
    • Short Description (Optional)
  • Other comments:
  • Will you require on-campus accommodation? (Yes / No)
    • If so, please indicate your preferred dates of stay between 18–25 Nov:
  • Please indicate any special requests or dietary restrictions.

Accommodation


The on-campus accommodation operated by the Academic Activity Centre, Academia Sinica (20 on the map) is available to book during AIM XXXVII and APLAS’23. The accommodation venue is a few hundred metres away from the meeting venue and has recently been refurbished.

The rate is NTD 1100 (approx. £29 / €33) per night, which is very low compared to hotels in Taipei. See the fare information for more details.

However, the number of pre-booked rooms is limited. If you need on-campus accommodation, please let us know and register before the registration deadline. If we run out of rooms, we prioritise underprivileged groups (students, independent researchers, etc.).

If you wish to extend your stay for APLAS, please also apply for on-campus accommodation from APLAS. We will merge your stay whenever possible.

For the off-campus accommodation, see https://conf.researchr.org/attending/aplas-2023/accommodation.

Excursion


We plan to have a half-day on-campus excursion at Academia Sinica on Wednesday and an outdoor excursion on Saturday.

The half-day on-campus excursion will consist of an hour free time and an English guided tour at the Museum of the Institute of History and Philology starting from 14:30, followed by the meeting dinner. During the free time, there are plenty of museums and exhibitions, such as the exhibition organised by the Institute of Taiwan History, to visit before the guided tour. See the map of museums for further detail.

Participants


Attending in person

  • Liang-Ting Chen
  • Shin-Cheng Mu
  • Hsiang-Shang ‘Josh’ Ko
  • Ting-gian LUA (banacorn at GitHub)
  • Sean Watters
  • András Kovács
  • Kuang-Lin Pan
  • Tzu-Chi Lin
  • Zong-You Shih
  • Orestis Melkonian
  • Andre Knispel
  • Andreas Abel
  • Tzu-Chun Tsai
  • Cas van der Rest
  • Tyng-Ruey Chuang
  • (your name here)

Attending online

  • Piotr Paradziński
  • (your name here)

Wrap-up Notes



Note: For people reading the wrap-up notes, it is easier if they are grouped first by subject, then by date, rather than the other way around.

Monday 20 Nov


TBA

Tuesday 21 Nov


  • Andras Kovacs: meta variables
  • Andre Knispel: tried writing a Quickstart section of the documentation, figuring binaries setup with data_dir, creating a PR, etc.
  • banacorn: fixed the "Download" feature of VS Code extension for Agda.
  • Kuang-Lin Pan: was fixing the install script for macOS (Apple Silicone) of GHC WebAssembly
  • Liang-Ting: discussed about deploy workflow and how to fix, trying to fix Agda's VS Code extension CI/CD, discussion about merging agda-stdlib-meta and NDGP, figuring how to build GHC WASM backend
  • Andreas Abel: built Agda language server with a newer lsp package, fixed the CI/CD,
  • Sean Walter: (enjoying the discussion about datatype-generic programming and metaprogramming)
  • Orestis Melkonian: tried prototyping agda2hs for some toy blockchain and discussed with Liang-Ting about metaprogramming

Thursday 23 Nov


  • Liang-Ting: figured out how to implement definition parameters with Andreas, proposing to move types for syntaxes in agda to an independent package
  • banacorn: updated VS code agda mode's dependency
  • Kuang-Lin Pan: compiled Agda into WASM which crashes while type-checking an empty file, though
  • András Kovács: looked into the terrible implementation of instantiation full and planning to rewrite it by NbE
  • Andre Knispel: categorised and organised every page in the documentation, cleaned it up, tried using Pandoc to compile the documentation to markdown
  • Andreas Abel: published language server for Agda 2.6.3

Friday 24 Nov


  • Kuang-Lin Pan: Recompiled GHC with profiling support but didn't find why WASM Agda crashes yet
  • banacorn: (no progress)
  • Andreas Abel: Agda language server
Page last modified on November 24, 2023, at 10:13 am
Powered by PmWiki