profile
viewpoint
Brendan Zabarauskas brendanzab @yeslogic Melbourne, Australia http://voyager3.tumblr.com I'm a poly-paradigm developer, primarily interested in how how type systems can be used as tools for thought. he/him 👨‍🎨👨‍💻👨‍🔬

brendanzab/codespan 322

Beautiful diagnostic reporting for text-based programming languages.

brendanzab/approx 82

Approximate floating point equality comparisons and assertions

brendanzab/algebra 53

Abstract algebra for Rust (still very much a WIP!)

brendanzab/color-rs 44

A library that provides types and conversions for working with various color formats.

brendanzab/chronicle 34

An event sourced CQRS framework for Rust

brendanzab/bullet-rs 9

Bindings and wrapper for the Bullet physics C API.

brendanzab/elm-stlc 7

Bidirectional type checker for the simply typed lambda calculus

brendanzab/Derelict3 2

A collection of dynamic D bindings to C libraries, useful for multimedia and game development.

brendanzab/efl-rs 2

Servo-specific wrapper for the relevant components of the Enlightenment Foundation Libraries.

brendanzab/elm-compiler 1

Compiler for the Elm programming language. Elm aims to make web development more pleasant. Elm is a type inferred, functional reactive language that compiles to HTML, CSS, and JavaScript.

startedarturo-lang/arturo

started time in 5 hours

startedUlfNorell/quasi-quote

started time in 5 hours

issue openedrust-analyzer/rust-analyzer

Textmate grammar does not highlight raw identifiers correctly

The keywords seem to have precedence? For example:

Screen Shot 2020-10-20 at 8 04 19 pm

For the following code:

    /// Synthesize the type of a term.
    #[debug_ensures(self.universe_offset == old(self.universe_offset))]
    #[debug_ensures(self.types.size() == old(self.types.size()))]
    #[debug_ensures(self.values.size() == old(self.values.size()))]
    pub fn synth_type(&mut self, term: &Term) -> Arc<Value> {
        match &term.data {
            TermData::Global(name) => match self.globals.get(name) {
                Some((r#type, _)) => self.eval_term(r#type),
                None => {
                    self.report(CoreTypingMessage::UnboundGlobal {
                        name: name.to_owned(),
                    });
                    Arc::new(Value::Error)
                }
            },
            TermData::Local(index) => match self.types.get(*index) {
                Some(r#type) => r#type.clone(),
                None => {
                    self.report(CoreTypingMessage::UnboundLocal);
                    Arc::new(Value::Error)
                }
            },

            TermData::Ann(term, r#type) => {
                self.is_type(r#type);
                let r#type = self.eval_term(r#type);
                self.check_type(term, &r#type);
                r#type
            }

created time in 5 hours

push eventpikelet-lang/pikelet

Brendan Zabarauskas

commit sha c5440f70b7db23f7d9edbd39d2710cbf732fec2c

Remove editor highlighting workarounds These were fixed in rust-analyzer’s TextMate grammar

view details

push time in 5 hours

startediliekturtles/uom

started time in 5 hours

startedstefaniatadama/inductive_types

started time in 6 hours

issue commentyeslogic/fathom

Struct terms and eliminations

PR #248 adds a starting point for this!

brendanzab

comment created time in 10 hours

Pull request review commentyeslogic/fathom

Implement struct terms and eliminations

-struct Empty {}-struct Empty {} //~ error: the name `Empty` is defined multiple times-struct Empty {} //~ error: the name `Empty` is defined multiple times+struct Empty : Format {}+struct Empty : Format {} //~ error: the name `Empty` is defined multiple times+struct Empty : Format {} //~ error: the name `Empty` is defined multiple times+Empty = 1 : Int; //~ error: the name `Empty` is defined multiple times

Made an issue for this here: #250

brendanzab

comment created time in 11 hours

PullRequestReviewEvent

issue openedyeslogic/fathom

Rename aliases to 'constants' and use a keyword

I have been calling top-level definitions 'aliases' to distinguish them from struct and enum definitions. The name was inspired by 'type aliases' in languages like Rust:

magic : Int = 83;
add_one (n : Int) : Int = n + 1;
Array3 (Elem : Type) : Type = Array 3 Elem;

Maybe it would be less confusing to call them 'constants' and use the const keyword?

const magic : Int = 83;
const add_one (n : Int) : Int = n + 1;
const Array3 (Elem : Type) : Type = Array 3 Elem;

created time in 11 hours

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha d31da6557a3a134156f54895b135291a2ed2a30a

Rename book section

view details

Brendan Zabarauskas

commit sha 7835e7a379ec06f5924cf7fec485e88c950e567e

Use stars badge instead of forks

view details

Brendan Zabarauskas

commit sha 58ea17a7fd682595e4fef71b0501b8d220634795

Remove unecessary colon in heading

view details

Brendan Zabarauskas

commit sha c54b9b6e894aeea1b00fddafc4be2903728329de

Merge pull request #249 from brendanzab/doc-improvements Documentation improvements

view details

Brendan Zabarauskas

commit sha d291eb7b3da62d7757f9a541661626706b1aba07

Implement non-format struct types I had originally hard-coded the `struct` syntax to define struct formats. This changes it so that we now elaborate to either a struct type or a struct format in the core language depending on an annotation. Not supplying an annotation is an error.

view details

Brendan Zabarauskas

commit sha b5fbfb84f6540d5d17294983e784c8fe14d5c07f

Merge pull request #245 from brendanzab/struct-types Implement struct types

view details

Brendan Zabarauskas

commit sha bc03039c1db194c13d58631cd87bab1d99601617

WIP: Implement struct terms and eliminations

view details

push time in 11 hours

delete branch brendanzab/fathom

delete branch : struct-types

delete time in 11 hours

push eventyeslogic/fathom

Brendan Zabarauskas

commit sha 753bde2f675082d09aa577f35650c872e5e036b0

Rename failing tests with correct prefix These were incorrectly marked as ‘fail_’ rather than ‘pass_’

view details

Brendan Zabarauskas

commit sha 322649cd7ce9951cf4177e1037aeb58b5d27a7d7

Remove some unecessary tests These were leftover after removing the Rust backend (see a3547d7219c1890a15c149b8e588a62350421ab0), and are no longer really applicable.

view details

Brendan Zabarauskas

commit sha b7ad44f07fb8272084fb086c0a0bb682ccd435c3

Fix annotation spacing in struct tests

view details

Brendan Zabarauskas

commit sha d291eb7b3da62d7757f9a541661626706b1aba07

Implement non-format struct types I had originally hard-coded the `struct` syntax to define struct formats. This changes it so that we now elaborate to either a struct type or a struct format in the core language depending on an annotation. Not supplying an annotation is an error.

view details

Brendan Zabarauskas

commit sha b5fbfb84f6540d5d17294983e784c8fe14d5c07f

Merge pull request #245 from brendanzab/struct-types Implement struct types

view details

push time in 11 hours

PR merged yeslogic/fathom

Implement struct types

I had originally hard-coded the struct syntax to define struct formats. This changes it so that we now elaborate to either a struct type or a struct format in the core language depending on an annotation. Not supplying an annotation is an error.

Closes #241 and #242 .

+1088 -497

0 comment

77 changed files

brendanzab

pr closed time in 11 hours

issue closedyeslogic/fathom

Non-dependent struct types

For example:

struct Point : Type {
    x : Int,
    y : Int,
}

closed time in 11 hours

brendanzab

issue closedyeslogic/fathom

Non-dependent struct formats

For example:

struct Point : Format {
    x : S32Be,
    y : S32Be,
}

closed time in 11 hours

brendanzab

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha d291eb7b3da62d7757f9a541661626706b1aba07

Implement non-format struct types I had originally hard-coded the `struct` syntax to define struct formats. This changes it so that we now elaborate to either a struct type or a struct format in the core language depending on an annotation. Not supplying an annotation is an error.

view details

push time in 11 hours

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha 9a7ed9f268578b72367ad3eda36824bd8a211443

Implement non-format struct types I had originally hard-coded the `struct` syntax to define struct formats. This changes it so that we now elaborate to either a struct type or a struct format in the core language depending on an annotation. Not supplying an annotation is an error.

view details

push time in 11 hours

delete branch brendanzab/fathom

delete branch : doc-improvements

delete time in 11 hours

push eventyeslogic/fathom

Brendan Zabarauskas

commit sha d31da6557a3a134156f54895b135291a2ed2a30a

Rename book section

view details

Brendan Zabarauskas

commit sha 7835e7a379ec06f5924cf7fec485e88c950e567e

Use stars badge instead of forks

view details

Brendan Zabarauskas

commit sha 58ea17a7fd682595e4fef71b0501b8d220634795

Remove unecessary colon in heading

view details

Brendan Zabarauskas

commit sha c54b9b6e894aeea1b00fddafc4be2903728329de

Merge pull request #249 from brendanzab/doc-improvements Documentation improvements

view details

push time in 11 hours

PR merged yeslogic/fathom

Documentation improvements
+4 -4

0 comment

5 changed files

brendanzab

pr closed time in 11 hours

Pull request review commentyeslogic/fathom

Implement struct terms and eliminations

+# Structs++Structs are labelled, heterogeneous collections of data.++## Formation++A record type can be formed with a sequence of unique, labelled types called _fields_.+Struct types may be dependent, with types of later fields depending on the value of previous fields.+For example:++```fathom+struct Point : Type {+    x : Int,+    y : Int,+}++struct MyArray : Type {+    len : Int,+    data : Array len Point,+    //           ^ The type of the `data` field depends on `len`+}+```++Struct types can only contain unique fields:++```fathom+struct Point : Type {+    x : Int,+    x : Int, // error!+}+```++Because the syntax is overloaded with [struct format descriptions],+we need to explicitly annotate struct types with `Type` when the usage is ambiguous:++```fathom+struct Point { // error!+    x : Int,+    y : Int,+}+```++[struct format descriptions]: ./format-descriptions.md#struct-formats++Struct types can only contain terms:++```fathom+struct Data : Type {+    type : Type, // error!+}+```++## Introduction++Inhabitants of struct types are known as 'struct terms'.+These can be introduced in with sequences of labelled terms:++```fathom+struct { x = 23, y = 42 } : Point+```++## Elimination++Struct terms can be eliminated using field lookups:++```fathom+point : Point = struct {+    x = 23,+    y = 42,+};++point.x // normalizes to `23`+```++When synthesizing the type of field lookups we need to be careful about data dependencies:

Yeah, we could add it to #244 perhaps?

brendanzab

comment created time in 14 hours

PullRequestReviewEvent

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha 753bde2f675082d09aa577f35650c872e5e036b0

Rename failing tests with correct prefix These were incorrectly marked as ‘fail_’ rather than ‘pass_’

view details

Brendan Zabarauskas

commit sha 322649cd7ce9951cf4177e1037aeb58b5d27a7d7

Remove some unecessary tests These were leftover after removing the Rust backend (see a3547d7219c1890a15c149b8e588a62350421ab0), and are no longer really applicable.

view details

Brendan Zabarauskas

commit sha b7ad44f07fb8272084fb086c0a0bb682ccd435c3

Fix annotation spacing in struct tests

view details

Brendan Zabarauskas

commit sha ec7e6829e80eb12d2b4cd8500fae4e35f433cf44

Implement non-format struct types I had originally hard-coded the `struct` syntax to define struct formats. This changes it so that we now elaborate to either a struct type or a struct format in the core language depending on an annotation. Not supplying an annotation is an error.

view details

Brendan Zabarauskas

commit sha 1091a6ece1deef6154c1f1163cbead3794be6982

WIP: Implement struct terms and eliminations

view details

push time in 17 hours

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha 753bde2f675082d09aa577f35650c872e5e036b0

Rename failing tests with correct prefix These were incorrectly marked as ‘fail_’ rather than ‘pass_’

view details

Brendan Zabarauskas

commit sha 322649cd7ce9951cf4177e1037aeb58b5d27a7d7

Remove some unecessary tests These were leftover after removing the Rust backend (see a3547d7219c1890a15c149b8e588a62350421ab0), and are no longer really applicable.

view details

Brendan Zabarauskas

commit sha b7ad44f07fb8272084fb086c0a0bb682ccd435c3

Fix annotation spacing in struct tests

view details

Brendan Zabarauskas

commit sha ec7e6829e80eb12d2b4cd8500fae4e35f433cf44

Implement non-format struct types I had originally hard-coded the `struct` syntax to define struct formats. This changes it so that we now elaborate to either a struct type or a struct format in the core language depending on an annotation. Not supplying an annotation is an error.

view details

push time in 17 hours

PR opened yeslogic/fathom

Documentation improvements
+4 -4

0 comment

5 changed files

pr created time in 17 hours

create barnchbrendanzab/fathom

branch : doc-improvements

created branch time in 17 hours

startedj3-fortran/fortran_proposals

started time in a day

startedconal/agda-cat-linear

started time in a day

startedbanacorn/agda-mode-vscode

started time in a day

startedGrokmoo/thyme

started time in a day

PR opened yeslogic/fathom

Implement struct terms and eliminations

Closes #247.

+1188 -489

0 comment

80 changed files

pr created time in a day

create barnchbrendanzab/fathom

branch : struct-terms

created branch time in a day

issue openedyeslogic/fathom

Struct terms and eliminations

For example:

struct Point : Type {
    x : Int,
    y : Int,
}

origin : Point = struct {
    x = 0,
    y = 0,
};
origin_x = origin.x;
origin_x = origin.y;

created time in a day

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha 0672dd0cc286279714f62de0bb512971c23b88af

Add some aspirational examples

view details

push time in a day

delete branch brendanzab/fathom

delete branch : dependent-structs

delete time in a day

delete branch brendanzab/fathom

delete branch : dependent-format-types

delete time in a day

delete branch brendanzab/fathom

delete branch : host-structs

delete time in a day

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha 7f414967606a0fc5eff264ead8c7617feece178d

Implement non-format struct types I had originally hard-coded the `struct` syntax to define struct formats. This changes it so that we now elaborate to either a struct type or a struct format in the core language depending on an annotation. Not supplying an annotation is an error.

view details

push time in a day

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha e9265bfbfcf6272d580578f77d3cdc18823f8b12

WIP: Implement non-format struct types I had originally hard-coded the `struct` syntax to define struct formats. This changes it so that we now elaborate to either a struct type or a struct format in the core language depending on an annotation. Not supplying an annotation is an error.

view details

push time in a day

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha 400dad83e2bd8e6da35338b6d483436f3a150d23

Remove unecessary colon

view details

Brendan Zabarauskas

commit sha 2313784df2eb2f8b0ad76046f3b85c1388882452

Rename failing tests appropriately These were marked as ‘fail_’ rather than ‘pass_’

view details

Brendan Zabarauskas

commit sha d7a9fb84d690f3394d4b30491a6d1f45d1ce1a38

Remove some unecessary tests These were leftover after removing the Rust backend (see a3547d7219c1890a15c149b8e588a62350421ab0), and are no longer really applicable.

view details

Brendan Zabarauskas

commit sha 846dead9c6039357d89b41477d10b043475d51f3

Fix annotation spacing in struct tests

view details

Brendan Zabarauskas

commit sha 4203b2cf65578ad0beece0ab89e88763a30153d7

WIP: Implement non-format struct types I had originally hard-coded the `struct` syntax to define struct formats. This changes it so that we now elaborate to either a struct type or a struct format in the core language depending on an annotation. Not supplying an annotation is an error.

view details

push time in a day

startedtweag/nickel

started time in 2 days

push eventpikelet-lang/pikelet

Brendan Zabarauskas

commit sha 8bf3edd38cca20a03237852a9159f7730d877b3a

Add TODO comments to REPL

view details

push time in 2 days

startedyizhouzhang/olaf-coq

started time in 3 days

delete branch brendanzab/pikelet

delete branch : mdbook-docs

delete time in 3 days

push eventpikelet-lang/pikelet

Brendan Zabarauskas

commit sha fa034af124ab504cb9b34a6fea6aec590d72d1fe

Move back to using mdBook for documantation mdBook seems somewhat simpler and more lightweight than Docusaurus, so I’m thinking it might just be good to go with it for now! It also has support for [preprocessors](https://rust-lang.github.io/mdBook/for_developers/preprocessors.html) which could be handy if we want to generated some sort of hyperlinked language specification.

view details

Brendan Zabarauskas

commit sha 04b2489c4868cf58bb7d09afc318f4a46f3bb3db

Merge pull request #232 from brendanzab/mdbook-docs Move back to using mdBook for documantation

view details

push time in 3 days

PR merged pikelet-lang/pikelet

Move back to using mdBook for documantation

mdBook seems somewhat simpler and more lightweight than Docusaurus, so I’m thinking it might just be good to go with it for now! It also has support for preprocessors which could be handy if we want to generated some sort of hyperlinked language specification.

+5778 -11374

0 comment

69 changed files

brendanzab

pr closed time in 3 days

push eventbrendanzab/pikelet

Brendan Zabarauskas

commit sha fa034af124ab504cb9b34a6fea6aec590d72d1fe

Move back to using mdBook for documantation mdBook seems somewhat simpler and more lightweight than Docusaurus, so I’m thinking it might just be good to go with it for now! It also has support for [preprocessors](https://rust-lang.github.io/mdBook/for_developers/preprocessors.html) which could be handy if we want to generated some sort of hyperlinked language specification.

view details

push time in 3 days

push eventbrendanzab/pikelet

Brendan Zabarauskas

commit sha 15c3c0fe9b218244ca98b02e1974ae5eda95eeec

Move back to using mdBook for documantation mdBook seems somewhat simpler and more lightweight than Docusaurus, so I’m thinking it might just be good to go with it for now! It also has support for [preprocessors](https://rust-lang.github.io/mdBook/for_developers/preprocessors.html) which could be handy if we want to generated some sort of hyperlinked language specification.

view details

push time in 3 days

push eventbrendanzab/pikelet

Brendan Zabarauskas

commit sha 5c57642a12b190d47b6abbd2b4836105a2168fa6

Move back to using mdBook for documantation mdBook seems somewhat simpler and more lightweight than Docusaurus, so I’m thinking it might just be good to go with it for now! It also has support for [preprocessors](https://rust-lang.github.io/mdBook/for_developers/preprocessors.html) which could be handy if we want to generated some sort of hyperlinked language specification.

view details

push time in 3 days

startedztellman/rhizome

started time in 3 days

startedHoTT-Intro/Agda

started time in 3 days

startedmniip/ZF

started time in 3 days

startedjonsterling/dreamtt

started time in 4 days

startedjonsterling/dreamtt

started time in 4 days

startedranjitjhala/sprite-lang

started time in 4 days

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha f5e2918f42a1c4018aee7c162392f21c0d8b02f2

WIP: Implement struct types

view details

Brendan Zabarauskas

commit sha 7b2633cb7d80a2e379d58503242180d40080426d

WIP: Implement struct terms

view details

push time in 4 days

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha 252aa9bf5d94fd863a76129896733398ec7989d0

WIP: Implement struct types

view details

Brendan Zabarauskas

commit sha d6cf3fd82b83230f19475c6ae52ab38e29cf0eef

WIP: Implement struct terms

view details

push time in 4 days

startedrust-crdt/rust-crdt

started time in 4 days

Pull request review commentyeslogic/fathom

WIP: Implement struct types

 impl<'me> Context<'me> {                         None => self.synth_type(file_id, &alias.term),                     }; -                    // FIXME: Avoid shadowing builtin definitions-                    match self.items.entry(alias.name.data.clone()) {-                        Entry::Vacant(entry) => {-                            let item_data = core::ItemData::Alias(core::Alias {-                                doc: alias.doc.clone(),-                                name: alias.name.data.clone(),-                                term: Arc::new(core_term),-                            });+                    let item_data = core::ItemData::Alias(core::Alias {+                        doc: alias.doc.clone(),+                        name: alias.name.data.clone(),+                        term: Arc::new(core_term),+                    }); -                            let core_item = core::Item::new(item.range(), item_data);-                            core_items.push(core_item.clone());-                            self.types.push((entry.key().clone(), r#type));-                            entry.insert(core_item);-                        }-                        Entry::Occupied(entry) => {-                            let original_range = entry.get().range();-                            self.push_message(SurfaceToCoreMessage::ItemRedefinition {-                                file_id,-                                name: alias.name.data.clone(),-                                found_range: item.range.clone(),-                                original_range,-                            })-                        }-                    }+                    (&alias.name, item_data, r#type)                 }-                ItemData::Struct(struct_type) => {-                    // Field names that have previously seen, along with the source-                    // range where they were introduced (for diagnostic reporting).-                    let mut seen_field_names = HashMap::new();-                    // Fields that have been elaborated into the core syntax.-                    let mut core_fields = Vec::with_capacity(struct_type.fields.len());--                    for field in &struct_type.fields {-                        let field_range = field.name.range().start..field.term.range().end;-                        let format_type = Arc::new(Value::FormatType);-                        let r#type = self.check_type(file_id, &field.term, &format_type);--                        match seen_field_names.entry(field.name.data.clone()) {-                            Entry::Vacant(entry) => {-                                core_fields.push(core::TypeField {-                                    doc: field.doc.clone(),-                                    name: field.name.data.clone(),-                                    term: Arc::new(r#type),-                                });--                                entry.insert(field_range);-                            }-                            Entry::Occupied(entry) => {-                                self.push_message(SurfaceToCoreMessage::FieldRedeclaration {-                                    file_id,-                                    name: entry.key().clone(),-                                    found_range: field_range,-                                    original_range: entry.get().clone(),-                                });-                            }-                        }-                    }+                ItemData::StructType(struct_type) => {+                    let (_, r#type) = self.synth_type(file_id, &struct_type.type_);+                    let item_data = match r#type.as_ref() {+                        Value::Sort(Sort::Type) => self.is_struct_type(file_id, struct_type),+                        Value::FormatType => self.is_struct_format(file_id, struct_type),+                        r#type => todo!("expected Type or Format"),

Need a proper diagnostic here.

brendanzab

comment created time in 4 days

PullRequestReviewEvent

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha 4406e2993194784ae85ae3aaa1ca8669a46622d5

WIP: Implement struct types

view details

Brendan Zabarauskas

commit sha ea3238f5e01196f4e657383d7474545a898d56e5

WIP: Implement struct terms

view details

push time in 4 days

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha c86e099cf67baebff1dee07f3d133c3013b048d3

WIP: Implement struct types

view details

Brendan Zabarauskas

commit sha c8b3ec0a8f61380ddb183babeff9839c97185db6

WIP: Implement struct terms

view details

push time in 4 days

push eventbrendanzab/fathom

Brendan Zabarauskas

commit sha 603e6ff2134dc67e3af3fde06504347651a4c255

WIP: Implement struct types

view details

Brendan Zabarauskas

commit sha 7f9fb51828620c8c9e20fb7f45e08571fc9dd1e0

WIP: Implement struct terms

view details

push time in 4 days

PR opened yeslogic/fathom

Add some aspirational examples
+124 -0

0 comment

4 changed files

pr created time in 5 days

create barnchbrendanzab/fathom

branch : examples

created branch time in 5 days

PR opened yeslogic/fathom

WIP: Implement struct types

This makes a distinction between struct types and struct formats in the core language. Originally we only supported formats.

Posting this as a WIP… got some work to do though.

  • [ ] Elaborate struct terms
  • [ ] Tests
  • [ ] Diagnostics
  • [ ] Evaluation rules
+454 -206

0 comment

52 changed files

pr created time in 5 days

create barnchbrendanzab/fathom

branch : struct-types

created branch time in 5 days

startedvrahli/NuprlInCoq

started time in 6 days

startedDreamLinuxer/FracAncilla

started time in 7 days

startedzetzit/zz

started time in 7 days

issue commentbrendanzab/approx

Support for slices?

Ahh - once we have const generics we can implement it for fixed size arrays. We could also do what the standard library used to do and implement the traits for fixed size arrays of length 0 to 32. In the mean time you might be able to do:

assert_abs_diff_eq!([1.0, 2.0, 3.0].as_ref(), [1.0, 2.0, 3.0].as_ref());

This converts both sides to `&[{float}].

bluenote10

comment created time in 7 days

startedzserge/awfice

started time in 7 days

startedtrikita/slide-html

started time in 7 days

startedBlaisorblade/dot-iris

started time in 7 days

startedAirblader/i3

started time in 8 days

push eventbrendanzab/pikelet

Brendan Zabarauskas

commit sha 5893c85bcfb91cb6c351e28c1cf4da88887d0c7a

WIP: Move back to using mdBook for documantation mdBook seems somewhat simpler and more lightweight than Docusaurus, so I’m thinking it might just be good to go with it for now! It also has support for [preprocessors](https://rust-lang.github.io/mdBook/for_developers/preprocessors.html) which could be handy if we want to generated some sort of hyperlinked language specification.

view details

push time in 8 days

issue commentbrendanzab/approx

Support for slices?

Yeah, this seems like it would be really useful!

bluenote10

comment created time in 8 days

starteddtolnay/paste

started time in 9 days

issue openedMichael-F-Bryan/mdbook-linkcheck

"Potential incomplete link" warnings generated for checklists

I get the following warning when I run mdbook-linkcheck on a markdown file with a checklist:

warning: Potential incomplete link
   ┌─ development/roadmap.md:19:5
   │
19 │   - [x] Comments
   │     ^^^ Did you forget to define a URL for `x`?
   │
   = hint: declare the link's URL. For example: `[x]: http://example.com/`

It seems to be fine with unchecked list items, eg: - [ ] Blah.

created time in 9 days

push eventbrendanzab/pikelet

Brendan Zabarauskas

commit sha 55aea6040b59b17682a60a4d25c20da196a72f32

WIP: Move back to using mdBook for documantation mdBook seems somewhat simpler and more lightweight than Docusaurus, so I’m thinking it might just be good to go with it for now! It also has support for [preprocessors](https://rust-lang.github.io/mdBook/for_developers/preprocessors.html) which could be handy if we want to generated some sort of hyperlinked language specification.

view details

push time in 9 days

push eventbrendanzab/pikelet

Brendan Zabarauskas

commit sha 84cff643d627b91e22cc24424bbeaafb9e21f03b

WIP: Move back to using mdBook for documantation mdBook seems somewhat simpler and more lightweight than Docusaurus, so I’m thinking it might just be good to go with it for now! It also has support for [preprocessors](https://rust-lang.github.io/mdBook/for_developers/preprocessors.html) which could be handy if we want to generated some sort of hyperlinked language specification.

view details

push time in 9 days

PR opened pikelet-lang/pikelet

WIP: Move back to using mdBook for documantation

mdBook seems somewhat simpler and more lightweight than Docusaurus, so I’m thinking it might just be good to go with it for now! It also has support for preprocessors which could be handy if we want to generated some sort of hyperlinked language specification.

+561 -528

0 comment

44 changed files

pr created time in 9 days

create barnchbrendanzab/pikelet

branch : mdbook-docs

created branch time in 9 days

startedmsp-strath/ask

started time in 9 days

startedrobrix/silkscreen

started time in 9 days

pull request commentpikelet-lang/pikelet

Allow dependencies between record term elements

So yeah, I think I'm understanding the issue now - it's just I found the previous examples didn't capture this.

The problem is that some annotations in let bindings need to access the contents of a definition in order to be able to be considered valid types. Even before checking the body of the definition. Splitting the definitions from the typing annotations as is done when desugaring let expressions to records means that the typing annotations can no longer access the definitions. This reduces what you can express with let bindings, unless you can figure out some way to expose the definitions of fields in the record types, which is what the linked resources you mentioned in your original comment address.

brendanzab

comment created time in 10 days

pull request commentpikelet-lang/pikelet

Allow dependencies between record term elements

Or maybe I need some example where refl : Id A a true is used in some part of an annotation. So that in order for the annotation to be a valid type, you'd need to know the definition of a?

brendanzab

comment created time in 10 days

pull request commentpikelet-lang/pikelet

Allow dependencies between record term elements

So the Id A a true needs the definition of a in the type, but it's not - it's been split off into the record constructor expression:

(record {
    A = Bool,
    a = true,
    p = refl,
    body = p,
} : Record {
    A : Type,
    a : A,
    p : Id A a true,
    body : Id A a true,
}).body

I guess I'm still a bit confused because even so, by the time you are checking the field p = refl with the goal Id A a true, don't you have the following in the context:

  • A : Type = Bool
  • a : A = true

The same would go for the field body = f with the goal Id A a true, where you have the following in the context:

  • A : Type = Bool
  • a : A = true
  • p : Id A a true = refl

Or should I not be adding the definitions to the context when checking record constructor expressions like this? Sorry for my slowness - still getting to grips with dependent types!

brendanzab

comment created time in 10 days

pull request commentpikelet-lang/pikelet

Allow dependencies between record term elements

Ah yeah, in the original statement I was referring to elaborating to 'record terms' - ie. 'record constructor expressions' - not record types. 😅 Taking into account the extended scoping rules would elaborating let expressions into record constructors + projection be possible? Ie.

let {
    A : Type = Bool
    f : A -> A = not
} in f True

would be elaborated to:

(record {
    A = Bool,
    f = not,
    body = f true,
} : Record {
    A : Type,
    f : A -> A,
    body : Bool,
}).body
brendanzab

comment created time in 10 days

pull request commentpikelet-lang/pikelet

Allow dependencies between record term elements

Ah dang, that's disappointing! Yeah I had remembered that it was an issue for doing it with the function application style, but for some reason had thought I might be able to get away with it for records. Thanks for the pointers to the relevant information!

So should I be concerned if something like this type checks and runs fine in my language?

(record {
    A = Bool,
    f = fun a => a,
    body = f true,
} : Record {
    A : Type,
    f : A -> A,
    body : Bool,
}).body
brendanzab

comment created time in 10 days

pull request commentpikelet-lang/pikelet

Unfold escaping levels when reading back values

Note that the naive patch-job of an escape check in this PR doesn't actually solve the issue when other bindings are in scope, echoing what Andras was talking about before. For example in the prelude.pi example I get:

error: mismatched types
  ┌─ examples/prelude.pi:7:42
  │
7 │     compose = fun A B C => dep-compose A (always B) (always (always C)),
  │                                          ^^^^^^^^^^ expected `Fun (t : dep-compose) -> Type`, found `Fun (B-1 : Type) -> Fun (t : always) -> Fun (t-1 : dep-compose) -> always`

Here the type of always B is misbound due to local bindings being present in the record term. Ie. the input type points to dep-compose, rather than B.

brendanzab

comment created time in 10 days

push eventbrendanzab/pikelet

Brendan Zabarauskas

commit sha 3232101455783cbbef3d079997af8bba6b7f87f7

Allow dependencies between record term elements This allows the elements of record terms to depend on each other. For example, this expression is now valid: ``` record { x = 1, y = x } : Record { x : S32, y : S32 } ``` This has the helpful side-effect of fixing the scoping glued levels in record terms. Before this change we would trigger a runtime panic on rendering the error message for the following term: ``` record { Elem = String, elem = record {}, } : Record { Elem : Type, elem : Elem, } ``` This is because `Elem` is not bound in the record term! Now we render the following error: ``` error: mismatched types ┌─ examples/escaping-local.pi:3:12 │ 3 │ elem = record {}, │ ^^^^^^^^^ expected `String`, found `Record {}` ``` This also paves the way for allowing us to elaborate let-expressions into record terms in the core language, as is done in [1ML]. For example: ``` let { x : S32 = 1, y : S32 = x * 2, } in y - x ``` Could be sugar for: ``` (record { x = 1, y = x * 2, body = y - x } : Record { x : S32, y : S32, body : S32 }) .body ``` [1ML]: http://mpi-sws.org/~rossberg/1ml/ This change also brings the typing rules of record terms closer to that of function terms with labelled parameters, which I think is aesthetically appealing, and could eventually help us bring functions and records much closer together in terms of typing rules and syntax. It does however mean that we no longer allow for out-of order elements in record terms. For example the following is no longer valid: ``` record { y = 1, x = 2 } : Record { x : S32, y : S32 } ``` I'd like to eventually lift this restriction however, but it might require us to do some topological sorting of field elements in the elaborator.

view details

Brendan Zabarauskas

commit sha ef8ae350840a3a64c3a4418ca612180959463b7b

Merge pull request #230 from brendanzab/record-term-bindings Allow dependencies between record term elements

view details

Brendan Zabarauskas

commit sha 19c2aa66de9b97b6d5468c0e62e6e413babf23d0

Improve variant names for Unfold type

view details

Brendan Zabarauskas

commit sha 129adc3d871892fcec34e77f8f9cd9a146658c2b

Improve docs for stuck and unstuck values

view details

Brendan Zabarauskas

commit sha cdd94c11c17e17023432b70c28f901bc400e63dc

Improve function naming

view details

Brendan Zabarauskas

commit sha ac3a977a4460a9c08ddc40d071bf50733ffbe48f

Formatting improvements

view details

Brendan Zabarauskas

commit sha 7498d2df333be12c4eae7a39917d3ded0ddc2e85

Merge pull request #231 from brendanzab/semantics-cleanups Various cleanups to the semantics module

view details

Brendan Zabarauskas

commit sha a019de7e626e4919113a10c51fcb4045498a23f3

Unfold escaping levels when reading back values

view details

push time in 10 days

Pull request review commentpikelet-lang/pikelet

Allow dependencies between record term elements

 record {     id = fun A a => a,     always = fun A B a b => a,-    compose = fun A B C a-b b-c a => b-c (a-b a),+     dep-compose = fun A B C a-b a-b-c a => a-b-c a (a-b a),-    flip = fun A B C a-b-c a b => a-b-c b a,+    compose = fun A B C a-b b-c a => b-c (a-b a),+    -- FIXME: Variable binding bug+    -- compose = fun A B C => dep-compose A (fun a => B) (fun a b => C),+    -- compose = fun A B C => dep-compose A (always B) (always (always C)),

I've posted more details here: https://github.com/pikelet-lang/pikelet/pull/229#issuecomment-706497438

brendanzab

comment created time in 10 days

PullRequestReviewEvent

create barnchbrendanzab/pikelet

branch : unfold-escaping-locals

created branch time in 10 days

pull request commentpikelet-lang/pikelet

Unfold escaping levels when reading back values

Hmm, I'm actually running into escaping locals in the types of function eliminations as well! This seems to be the source of the bug found in https://github.com/pikelet-lang/pikelet/pull/230#discussion_r502153985. For example, given the following function:

(fun A a => a : Fun (A : Type) -> A -> A) S32

I'd expect to synthesize S32 -> S32. But instead I synthesize the following type:

FunctionType(
    Unstuck(
        Local(LocalLevel(0)),
        [],
        LazyValue(OnceCell(
            Stuck(Global("S32", UniverseOffset(0)), []),
        )),
    ),
    Closure {
        universe_offset: UniverseOffset(0),
        values: Locals[
            Stuck(Global("S32", UniverseOffset(0)), []),
        ],
        term: Local(LocalIndex(1)),
    },
)

Note the escaping level, Local(LocalLevel(0)), in the annotation of the function type. This was bound when I applied the S32 to the ⟨[], A -> A⟩ closure, but is now no longer present!

brendanzab

comment created time in 10 days

delete branch brendanzab/pikelet

delete branch : semantics-cleanups

delete time in 10 days

push eventpikelet-lang/pikelet

Brendan Zabarauskas

commit sha 19c2aa66de9b97b6d5468c0e62e6e413babf23d0

Improve variant names for Unfold type

view details

Brendan Zabarauskas

commit sha 129adc3d871892fcec34e77f8f9cd9a146658c2b

Improve docs for stuck and unstuck values

view details

Brendan Zabarauskas

commit sha cdd94c11c17e17023432b70c28f901bc400e63dc

Improve function naming

view details

Brendan Zabarauskas

commit sha ac3a977a4460a9c08ddc40d071bf50733ffbe48f

Formatting improvements

view details

Brendan Zabarauskas

commit sha 7498d2df333be12c4eae7a39917d3ded0ddc2e85

Merge pull request #231 from brendanzab/semantics-cleanups Various cleanups to the semantics module

view details

push time in 10 days

more