-
Notifications
You must be signed in to change notification settings - Fork 31
Miking Meeting Notes 2020
Note-taker: Daniel Lundén
- Reviewing policy:
- Write in Slack when PR ready, ask for review.
- New PRs:
- [Accept] #36 Pretty printer for MExpr.
- [Accept] #43 Replace environment with a context and add float arithmetic.
- Recursion schemes:
- Read up and discuss on future meeting (Viktor lead?)
- Term equivalence:
- Write separate eq checks for own types.
- Have as a semantic function (+ ordering).
- k-CFA:
- Seems like a good idea in general, will discuss further on future meeting (Daniel lead?)
- Mutability:
- Implement everything with immutable data structures for now.
- Syntactic sugar (record with):
- To be continued. Merge operator?
- Default values, types:
- Will be discussed on Slack.
2020-02-25, 13:00-15:00
- Recursion schemes
- k-CFA (edited)
Note-taker: Viktor Palmkvist
Summary on the recursion part of the meeting today:
- Have a semantic function for a single generic step, and a semantic function for a generic fold
-
smap : (focus -> a) -> term -> term[focus -> a]
(The square brackets mean substitution, but we haven't really solved how this looks in the type system, since we don't have a typesystem) (For the example, replaceterm
withStatement
andfocus
withExpression
) sfold : (b -> a -> b) -> b -> term[focus -> a] -> b
- concretely, we will initially implement these as
sem smap_term_focus
andsem sfold_term_focus
- with these we can write, e.g., bottom-up fold as
foldbu f = smap (foldbu f) >>> f
(using>>>
for left-to-right function composition), or counting the number of nodes ascountNodes = foldbu (sfold (+) 1)
Note-taker: Viktor Palmkvist
PRs:
- Oscar: change type of argument to eval https://github.com/miking-lang/miking/pull/43
- we like it
- Oscar: library functions https://github.com/miking-lang/miking/pull/48
- we like it
- Oscar: mcore-mode syntax highlighting bugfix https://github.com/miking-lang/miking/pull/50
- we like it
- Oscar: smap + sfold https://github.com/miking-lang/miking/pull/49
- only for Expr_Expr, and not the things in eval.mc
- we like it
- John: pretty-printing sequences of characters as strings https://github.com/miking-lang/miking/pull/51
- we like it
- John: add language fragments for types to the main composed language https://github.com/miking-lang/miking/pull/53
- we like it
- potential merge conflict (though easily solved) with https://github.com/miking-lang/miking/pull/49
- John: lambda-lifting https://github.com/miking-lang/miking/pull/46
- works for entire ast.mc
- caveat: removes types for now
- no peer-review yet
- adds constructors for toplevel defintions to Expr, maybe add to another syn?
- merge after constructor reuse PR
- Viktor: reuse constructors across language https://github.com/miking-lang/miking/pull/52
- we like it Other points
- David: benchmarks
- Linnea and Viktor in working group
- Viktor: Recursion Cookbook
- Probably put in GitHub wiki for the project Followup questions:
- CSeq in Const contains Expr, do we want to only have TmSeq instead? (it's in Expr)
- Put editor support in separate repositories? Under miking organization?
- Add Linnea to core team
- We cannot set labels for issues, I assume only David and Elias can?
- Changed column "Done and merged" to "Done" in miking project board. Do we want two columns "Done and merged" and "Done and won't be merged"?
Note-taker: Oscar Eriksson
PRs
- Add lambda lifting in MCore
https://github.com/miking-lang/miking/pull/46
We like it - merge
Going forward:
- To be able to handle partial applications over constants we can use eta-expansion.
- Add test: evaluate lifted to non-lifted.
- Add missing parenthesis in pretty printer for TmApp https://github.com/miking-lang/miking/pull/56 We like it - merge
- Implemented non-observable unique symbols https://github.com/miking-lang/miking/pull/54 Fix: Change gensymb to gensym then: We like it - merge
- Failed const app error point to app rather than arg declaration https://github.com/miking-lang/miking/pull/55/commits We like it - merge
- From Last time
- CSeq in Const contains Expr, do we want to only have TmSeq instead? (it's in Expr) We want operators over consts to be closed. We have to look at this further and we do not want this duplication in the CSeq case.
- Put editor support in separate repositories? Under miking organization? Yes, add as task. Name repo as miking-.
- Columns in board We suggest that we keep done and remove pull-request column so that done includes tasks that have an associated PR. (edited)
Note-taker: Linnea Ingmar
- From next week and onward: we will have two 1 hour meetings per week. Tuesdays and Thursdays 15-16 by default.
- Went through the board and discussed what everyone is working on
- Created a Wiki to put documentation such as Recursion Cookbook. Anyone logged into GitHub can edit, but we assume this is not a problem.
- PRs -- General comment: Always check on GitHub that PRs can be rebased. -- #57 Bug fix in lambda lifting. https://github.com/miking-lang/miking/pull/57 We like it, merge! -- #59 Reuse of generated arguments within the same scope. https://github.com/miking-lang/miking/pull/59 We like it, merge! -- #58: Forward mode auto diff. https://github.com/miking-lang/miking/pull/58 Needs a review. David volunteers.
- Oscar presented Forward Mode Auto Differentiation.
- Documentation of code: at least, give an overview description in the top of the file. If relevant, include sources of implementation, e.g. reference to papers.
- Follow up discussion on whether to remove CSeq. Agreed to do so!
- Follow up discussion on column in board: agreed to remove pull-request column.
- Next meeting: Linnea and Viktor go through thoughts on benchmarking framework. Use merge sort as example. (edited)
Note-taker: John Wikman
Attendees: David Broman, Viktor Palmkvist, Linnea Ingmar, Daniel Lundén, Oscar Eriksson, Klas Segeljakt, John Wikman Pull requests
- Review and discussion postponed to next meeting due to time shortage.
Code formatting conventions
- Try to keep to 80 characters per line until further notice. Can exceed 80 characters if it aid readability.
- Scope indentation should be 2 spaces. Formally voted in favor of by 6 out of 7 attendees.
- This will be handled by an automatic formatter in the end.
Remove the Const from the AST
- An idea brought forward was to remove the Const type from the AST and replace all removed functionality by Expr constructs. E.g. TmConst (CInt) would become TmInt and TmConst (CAddi) would become TmIntrinsic (Addi).
- This idea was positively received by the attendees.
- Also discussed how to keep gti, lti, neqi, eqi (etc.) in the environment, but in the end that these could be mapped differently to the builtin intrinsics.
Option to output desugared program in boot
- It would be nice to have the option in boot to output the program as it looks after the MLang flattening and desugaring has been applied. Would be passed an an argument option.
- We like it, Daniel will implement it if it doesnt take up too much time.
Factor out convenience functions
- Take the convenience functions from lamlift.mc that are used to create an AST without a parser and move them to a separate file under the stdlib/mexpr.
- We like it, John will implement it.
Benchmarks
- Viktor and Linnea presented their current progress on the benchmark setup.
- The benchmarks will be kept in a separate repository from the miking repository. This will contain benchmarks written in MCore as well as the same tests implemented in other languages for comparison.
- Two approaches of how to organize the benchmarks were presented: A flat structure or a hierachical structure where datasets and test configuration can be inherited from the higher level.
- The discussion leaned towards using some form of hierachy for the structure, but not too hierarchical as some benchmarks might be very specific and not share much configuration or datasets with other benchmarks.
- The tool to manage these testcases would be developed by ourselves. Go was brought up as a candidate language to develop the tool in due to its cross-platform support, but Rust was brought up as a preferrable alternative.
- Some remarks brought forth was that this setup should take into account factors such as architectures, compilers, and compiler flags.
- The benchmark system will be split into 3 separate repostirories: one for the benchmarks, one for the tool, and one for the results.
- Will start sketching on the benchmark structure until next meeting.
Note-taker: Viktor Palmkvist
- Status update
- Decision on library naming style: lower case, words separated by dash (-)
- PRs
- Oscar: https://github.com/miking-lang/miking/pull/62 and/or https://github.com/miking-lang/miking/pull/64
- Go with the first, except have only one new target that uses all external libraries
- We like it (after minor renaming)
- David: https://github.com/miking-lang/miking/pull/61
- Likely merge conflict with https://github.com/miking-lang/miking/pull/62
- We like it
- John: https://github.com/miking-lang/miking/pull/60
- We like it
- John: https://github.com/miking-lang/miking/pull/63
- We like it, but Viktor needs to look at a bug that this PR exposes
- Name the library ast-builder
- Oscar: https://github.com/miking-lang/miking/pull/62 and/or https://github.com/miking-lang/miking/pull/64
Note-taker: Daniel Lundén
Pull requests
- Pull request https://github.com/miking-lang/miking/pull/66
- We like it, merge.
- Pull request https://github.com/miking-lang/miking/pull/65
- We like it, merge after adding test case.
- Pull request https://github.com/miking-lang/miking/pull/63
- We like it (from last time), merge after Viktor's fix.
- Pull request https://github.com/miking-lang/miking/pull/25
- Elias and John will discuss this further.
- Pull request https://github.com/miking-lang/miking/pull/21
- Elias will check with Klas.
Discussions
- Lists/sequences/vectors/universal collections
- John needs fast concat.
- Oscar needs fast random access.
- Temporary solution: finger trees or other more efficient data structure? Oscar will look at it.
- Merging semantic functions with nested patterns
- Discussions lead by Viktor. Viktor and Elias will look at it further? (edited)
Note-taker: Elias Castegren
Pull requests
- Pull request https://github.com/miking-lang/miking/pull/65
- Viktor has updated since last meeting. We like it, merge.
- John tested the PR and saw that it solves his problem. This means that his PR (https://github.com/miking-lang/miking/pull/63) can also be merged.
- Pull request https://github.com/miking-lang/miking/pull/25 was already merged by Elias. In the future, PRs should be merged (or closed) by David in connection to Miking meetings. We liked it, posthumously.
Discussions
- Elias’ issue https://github.com/miking-lang/miking/issues/67
regarding matching on primitives and sequences in semantic
functions
- Some of the features asked for has already been implemented for MExpr (matching on sequences and primitives). Viktor writes a reply to the issue mentioning this. It still needs a translation from MLang though.
- Viktor pointed out that this is very similar to the problems encountered when doing extensible lexing and parsing. The solution we come up with (whether it is a compiler feature or a programming pattern) should be applicable to both.
- Oscar’s experiments with Finger Trees, from Batteries
- Should provide faster random access and concatenation (compared to lists).
- Needs exposing more constant functions to be efficient.
- We went through the interface and decided on which functions to have.
- Oscar would like to have a Map type, since Finger Trees does not help with this. We might add a special case for Oscar’s use-case, to allow us to punt on design decisions regarding, e.g., type classes.
- Discussion on Git(Hub) hygiene
- We decided to use the “Squash and merge” feature of GitHub. This makes the heading of the resulting commit the title of the PR, and the body the concatenation of the commits. This means we should be careful to write informative PR titles (and ideally also informative commit messages).
Note-taker: Oscar Eriksson
PRs
https://github.com/miking-lang/miking/pull/71
- We like it, merge
https://github.com/miking-lang/miking/pull/70
- Replace patterns implementation data-structure with sequence.
- Move init, head, tail, last to stdlib
- Elias reviews
https://github.com/miking-lang/miking/pull/72
- Merge with
pprint.ml
- Viktor reviews
https://github.com/miking-lang/miking/pull/21
- Add andThen
- replace Dyn with lower case parameters, then: accept
Conventions
Make conventions page at Wiki (Oscar) So far, we have adopted the following conventions:
- Type parameters should be lower-case
- CamelCase
- 2 space indent
- 80 char width (if possible)
Note-taker: Viktor Palmkvist
- New convention in OCaml code base
- Snake case for variables, functions, and type names, camel case for constructors
- PRs
- Oscar: https://github.com/miking-lang/miking/pull/70
- We like it
- Daniel: https://github.com/miking-lang/miking/pull/72
- We do not want to have deprecated functions in the code base, make the change instead.
- Consistency on snake case vs. camel case.
- Return ustrings from the functions, but keep the optional configuration arguments.
- Linnea: https://github.com/miking-lang/miking/pull/75
- Refactor to use ast-builder
- Use lower-case for type variables
- After that: we like
- Linnea: https://github.com/miking-lang/miking/pull/74
- Not ready yet, but there was a general air of "we like"
- John: https://github.com/miking-lang/miking/pull/73
- We like it
- Oscar: https://github.com/miking-lang/miking/pull/70
- PRs
Note-taker: Linnea Ingmar
- PRs
- Klas: Add functions for options to the stdlib #21 https://github.com/miking-lang/miking/pull/21:
- We like it
- Elias: Replace stub Option modules with module from Batteries #77 https://github.com/miking-lang/miking/pull/77
- We like it
- Daniel: Improved pretty printing in boot #72 https://github.com/miking-lang/miking/pull/72
- Some fixes from last meeting
- We like it
- Oscar: Exposed Ida functions related to interpolating solution #78 https://github.com/miking-lang/miking/pull/78
- We like it
- Oscar: Set prettify-symbols-alist for mcore-mode #76 https://github.com/miking-lang/miking/pull/76
- We should place the Emacs mcore mode in a separate repository. Elias volunteered. Then Oscar makes this PR to that repo.
- Linnea: graph library.
- We like, except Linnea will update uniq function and add type definition to digraph. Will ping David after doing so.
- Klas: Add functions for options to the stdlib #21 https://github.com/miking-lang/miking/pull/21:
- Discussion about generating unique variable names
- Three alternatives: 1. “Locally Nameless”, 2. a mapping from AST with strings->AST with symbols, or 3. the AST nodes have both a string and a symbol.
- We will probably go with the last alternative, unless any problems arise.
- Elias and David will think more about consequences on the type system etc. of this.
- Daniel’s problem solved by fresh function in eval.mc for now.
Note-taker: Elias Castegren
Pull Requests
- #85 (https://github.com/miking-lang/miking/pull/85).
- Add new term never for impossible cases. Refactor records. Plan for the future is to use pattern matching for projection and to replace tuples by records (syntax remains the same for both). We like it! Merge.
- #83 (https://github.com/miking-lang/miking/pull/83).
- Simple vector and matrix library. Draft, open for comments. Oscar will update names to follow existing conventions. Do not merge yet.
- #82 (https://github.com/miking-lang/miking/pull/82).
- Loosen restrictions for pattern matching and fixing parsing bugs. Viktor wants to remake parts of the implementation. Do not merge yet.
- #81 (https://github.com/miking-lang/miking/pull/81).
- Add atan and pi. We like it! Merge.
- #80 (https://github.com/miking-lang/miking/pull/80).
- Add CTAGS files to .gitignore. We like it! Merge.
- #79 (https://github.com/miking-lang/miking/pull/79).
- Removed the Emacs mode from the Miking repo. We like it! Merge.
Discussions
- We decided to introduce a construct #label (symmetric to #var and #con) for specifying record labels which are not syntactically correct (e.g. numeric values).
- We decided to have maintainers for the repos of different editing modes, for updating them when the language evolves. Elias takes the Emacs mode, Daniel takes the Vim mode and John takes the Sublime mode.
- We discussed if let _ = ... in ... should be valid or not. We decided to punt on the decision.
Note-taker: Viktor Palmkvist
PRs - David: mention of removal of de bruijn indices in boot, which might be merged in-between meetings. - Oscar: https://github.com/miking-lang/miking/pull/83 - We like it, merge - Daniel: look at https://github.com/miking-lang/miking/pull/86, though it's not intended to be merged at this point
- Discussion
- WebAssembly: not really looked at yet, but definitely an interesting target. Analogues to John's compilation to GPU.
- Daniels questions: see response by Elias above, but briefly: things are in progress and those questions are explicitly in the case studies we're considering.
Note-taker: Oscar Eriksson
PRs
-
https://github.com/miking-lang/miking/pull/88
- We like it, merge
- TODO: Possibly change patterns to prefix only
-
https://github.com/miking-lang/miking/pull/86
- We like it, merge
-
https://github.com/miking-lang/miking/pull/87
- We like it, merged
Note-taker: Linnea Ingmar
PRs
- MExpr simplifications https://github.com/miking-lang/miking/pull/89
- Proposal: remove unit keyword (@vipa volunteered to fix)
- We like it (merged during meeting)
- We will move Miking meetings to 14
- Discussion on benchmark ideas for decision points
- Viktor: pattern matching: use memoization or not
- Oscar: Sorting of equations and variables, and representation of data
- Klas: window aggregation algorithms
- John: choice to run on a GPU or CPU
- Daniel: choice of inference algorithms
- Use refinement types for performance (choice of AVX instructions)
- Compile javascript to webassembly or not
- Some related works suggested by Elias
Note-taker: Elias Castegren
Pull Requests
-
https://github.com/miking-lang/miking/pull/90 (David)
- Constructors are no longer first-class (they need to be fully applied). Constructor definitions statically define a unique symbol, rather than it being handled dynamically. Constructor and variable names now live in the same namespace.
- David will revert the change regarding namespaces. Variables and constructors will be syntactically distinct.
- Viktor will finish his review.
- We will revisit this PR next week.
-
https://github.com/miking-lang/miking/pull/91 (Viktor)
- Semantic functions now have nested, order-independent patterns. There is also support for and-patterns, or-patterns and not-patterns. Ambiguous patterns (where two patterns are unordered by specificity but are still overlapping) are considered a compilation error.
- Viktor will write a few more test cases.
- Elias will have a look at the PR.
- We will revisit this PR next week.
Discussions
- We need a story for writing test cases which fail due to compilation errors, or test cases that depend on a specific output.
- We should put Linnea’s lstlisting under github.com/miking-lang/
Note-taker: Daniel Lundén
Pull requests
- https://github.com/miking-lang/miking/pull/90 We like it, merge.
- https://github.com/miking-lang/miking/pull/91 We like it, merge. Some more test cases are required, however.
- https://github.com/miking-lang/miking/pull/92 We like it, merge.
-
https://github.com/miking-lang/miking/pull/93
- Define inf as division with 0 in stdlib instead
- Add CmpFloatEval + test cases
- Add CmpFloatLamlift as a comment only in lamlift.mc
- https://github.com/miking-lang/miking/pull/94 We like it, merge after adding unit tests and after Viktor's PR is merged.
Discussions
- We will start implementing many things in MCore from now on, rather than in boot.
- We will not add Ragnar stuff to boot parser because of bootstrapping issues.
- Postpone comment discussion; Elias will create issue on Github.
Note-taker: Oscar Eriksson
https://github.com/miking-lang/miking/pull/94 Change to nested patterns, then we like it, merge
- https://github.com/miking-lang/miking/pull/93 float.mc -> math.mc, then we like it, merge
- Project board grooming It was groomed
- Issue grooming
- Add labels in Github
- Ensure that everyone can add labels to issues etc.
Note-taker: Elias Castegren
Pull Requests
- No pull requests today!
Discussions
- We discussed the syntax of comments.
- We decided to punt on decisions regarding the precise syntax for documentation, etc., but we noted that we should keep it in mind for the decision.
- We said that whatever we pick should ideally also be compatible with Ragnar in the future.
- We discussed whether we should optimize for free-standing block comments or for commenting out code inline. Most people agreed that the latter is done rarely.
- Some more suggestions were put forth, summarized in the GitHub issue: https://github.com/miking-lang/miking/issues/95