Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Is quasiquotation in Core a good idea? #358

Closed
@patrickt

Description

@patrickt

Today @robrix and I found ourselves attempting to implement an record.?key operator in core that would return Church-encoded Maybe values (since Core lacks data types) corresponding to the presence in key in record (aka Map.lookup). We ran into an implementation difficulty: the querying operation returns a Maybe address value, purposely kept abstract, and as such there’s no way to promote that to the concrete term type (Term (Ann Span :+: Core), which is what lambda abstractions (via abstract) require as a parameter.

Rob suggested adding some sort of quasiquotation support, one that let us promote address values into this context, to support this. This is really exciting—one application that springs to mind is to add syntactic support for this, letting us write Core quasiquoters in core. I’m relatively inexperienced wrt such shenanigans, but I’m sure there are myriad applications.

What gives me pause is the fact that this is a big feature. What’s the cognitive footprint required to add quasiquotation support? I know the Lisp community has a rich heritage of adding syntactic abstraction of this nature, but I’m not a Lisper. (Perhaps a Lisper will see this thread and chime in.) Core is a pretty minimal lambda calculus: is it appropriate to add this kind of abstraction? Can we get away with something simpler (for now we’re going with ?. returning a boolean, which is ugly but workable for my purposes).

Metadata

Metadata

Assignees

Labels

compilerCompilers targeting the Semantic core language.enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions