profile
viewpoint
Paul Stansifer paulstansifer Google Cambridge, MA http://ccs.neu.edu/~pauls

paulstansifer/unseemly 61

Macros have types!

bhickey/InfiniteYegge 4

The Infinite Yegge Machine

paulstansifer/tetanus 4

Tools for developing Rust (from the pre-0.1 era)

paulstansifer/end-of-september 3

using machine learning to understand the opinion bubbles we live in, and to gently pierce them

bhickey/yaspl 2

Yet Another Stupid Programming Language

paulstansifer/absent-mind 2

Tools for the absent-minded developer

paulstansifer/dagger 2

Demo of a cave-in physics system for a Dwarf Fortress-like game.

paulstansifer/go-explore 2

GnuGo client for exploring counterfactual moves

paulstansifer/qwantzle_data 2

data for solving the qwantzle

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha b4df9ae0b38e33c8aaebe66a83b5037e72a8b074

Document the syntax for imports and betas.

view details

push time in 19 days

issue openedpaulstansifer/unseemly

Place `dotdotdot` (the quasiquotation construct) once per `Star` node, not once per nonterminal

dotdotdot should be able to go anywhere a repetition can happen. For example, it should be possible to write

'[Expr |  .[  ...[,a, >>  ,[a], : Int ]...   .  <something> ].]'

The only place that core_qq_forms::dotdotdot_form uses its nt argument is in the grammar: (named "body", (call_by_name nt)); that can be replaced by whatever syntax is inside the Star. But there's nothing to call "body"; the Star could potentially contain, say, three Named nodes. What do we do then?

This is a splicing-related can of worms that needs to be opened.

created time in 24 days

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha a42702d421c5cdf8710248b093931b451f3cacb3

Fixed `color-backtrace` dependency version number for cargo.

view details

push time in 24 days

created tagpaulstansifer/unseemly

tagv0.0.0

Macros have types!

created time in 25 days

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 1ca9b92d0d34f8d4d5551a282118ab2fa9029c04

Add "AtomNotInPat", to support interpolation of non-pattern atoms. This is part of a (hackish) way to address issue #37.

view details

Paul Stansifer

commit sha 4fbfd072d5337cf69cc4f3d501359e76adff179b

Add a qualification to `pitch.md`

view details

Paul Stansifer

commit sha 80a3763f1d350e262728bdc3e722b751a58ea523

Update the CHANGELOG.md entry for release.

view details

Paul Stansifer

commit sha e323de4f16ebfed80571b72c97e51a885418e595

Some documentation revisions.

view details

push time in 25 days

issue openedpaulstansifer/unseemly

Allow interpolation of identifiers

We currently allow manipulation of Pat, Expr, and Type syntax; we need to be able to manipulate Atom (or maybe we should call it Ident -- I've never really decided whether VariableReference is a wrapper around Atom or a separate thing) in order to write something like:

'[Expr|  .[ ,[my_var], : Int . (plus ,[my_var], one) ]. ]'

In fact, I don't think it's possible to have n-ary function definition without this feature. (Or allowing functions to take patterns instead of parameters as input).

The trouble is that, if I'm writing (plus ,[my_var], one), how does the parser know whether I'm interpolating an Expr or an Atom? This is a syntactic ambiguity.

One option is to structure nonterminals such that Pat → Atom | ⋯ and AtomNotInPat → Atom; then Pat and AtomNotInPat could both be safely extended with ,[ ],. But then, if the author of a lambda macro forgot to use AtomNotInPat, they've laid an ambiguity trap. I think this strategy only works well enough for a temporary solution, but a temporary solution will do for now.

created time in 25 days

issue commentpaulstansifer/unseemly

Remove `ddd` from `mbe.rs`

Note that match_collapse_reduce (or whatever it is called) is still being called in ast_walk.rs But the DDD-related features aren't needed, and there should be a simpler function to call instead (if not, then one could be made by removing collapse_ from the name and the DDD-related features).

paulstansifer

comment created time in 25 days

issue commentpaulstansifer/unseemly

Fix `pre_match`, somehow

(In ccead10, I restored the old semantics of dotdotdot, but without using pre_match. On the other hand, I introduced something else to ast_walk::walk that is in obvious need of refactoring...)

paulstansifer

comment created time in 25 days

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 104da28f0050bf75b624a5fef7fb0bb26c74f6f4

Apply some fixes (mostly `clone` removals) suggested by `cargo clippy`.

view details

push time in 25 days

issue commentpaulstansifer/unseemly

Language Server

I think that an incremental parser should be possible (I don't know much about how suited an Earley parser is for that), and I definitely want to eventually have an LSP plugin. Macro syntax lives in the language grammar itself, so handling macros wouldn't require much work outside the parser.

Completion of variable names and function invocations is probably not much harder than for any other language (once an incremental parser capable of dynamic syntax extensions exists!), but I'm not sure what full-featured completion for macros would look like, given that macros can be "deeply" varadic. For example, in an LSP completion, a completion can offer a finite list of snippets that the user can tab through, but what about a let macro that has n pairs of names and values? I guess, a lot of the time, having exactly one occurrence of each repeat would be good documentation, even if you can't just tab through the snippets.

...actually, I think the solution to this problem is to complete at the syntax level, not at the macro level. If your context looks like let a = 1; b = 2 and you request completion, I could imagine being able to offer two options: ; {$name} = {$expr}; and ; {$expr}. That sort of thing might be sufficient to document a macro if the user remembers how its invocation begins.

(At some point, I think that macros should be able to hint to the pretty-printer how they want to be auto-formatted. While I'm imagining that unicorn, I think it could guide the snippet formatting as well.)

This is looking way ahead, of course. Building an LSP link at all would be a good first step, and maybe it wouldn't be too hard to build a proof-of-concept.

colelawrence

comment created time in 25 days

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 52164f091ca1edf13a8904b460238fbb6da363bb

Make syntax for type definitions look more like the type constructors.

view details

Paul Stansifer

commit sha 4f9375d60f4491d8d5b4116d6a6e302f08f2b8ab

Update documentation with the new syntax.

view details

push time in a month

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha e91f4dc8480384499efee069221f4bc29cfadfab

Rename the old temporary name and syntax for the ::: type

view details

Paul Stansifer

commit sha f06d032899d6bacd44cdc43725e7fbc5598e87e1

Fix an issue that broke build_a_language.≉ (Need to automate testing of the examples. Need more unit tests.)

view details

push time in a month

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 390f26f49c5eaa660b71087826af9de7ba1107d2

Remove the old dotdotdot Some support infrastructure may still remain. Need to do a good ol' fashioned tree-shaking at some point.

view details

push time in a month

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha c98e9e575dc9e091d83d582f5272a17abf6ee3bc

Allow heterogenous `_with` operations.

view details

Paul Stansifer

commit sha ccead10c73822006bc434192f9a005cd23db3b9e

Reintroduce a generalized dotdotdot (can be used in any type, not just tuples) Undoes db6b4c, but in a different way. Actually using it in `core_macro_forms::macro_invocation` breaks `language_building` though, so it's probably not correct yet.

view details

Paul Stansifer

commit sha b288eb3d0be2b13ba368bc7f65c5d98701db5412

Remove a stray commenting construct from an example. We were treating `%` as if it were whitespace.

view details

Paul Stansifer

commit sha a465b5136ae77f8e3258e9a45a4b70540ea4c7e4

Actually use the new dotdotdot in macro types.

view details

Paul Stansifer

commit sha f45f45cff3beb1f1f635bdff22e9a4e36ae8f2ff

Remove some noise from pretty-printing

view details

push time in a month

issue commentpaulstansifer/unseemly

Info: Implementing compilation targets

I think that this discussion should be merged into issue #12; I'll close this issue as a duplicate (I've added a comment there). Please add any more thoughts you have there!

colelawrence

comment created time in a month

issue closedpaulstansifer/unseemly

Info: Implementing compilation targets

Hi again,

First, thank you for the prompt follow-up to #34. A lot of the syntax is starting to fall into place for me.

One of my favorite things about your approach is that your language comprises of the minimum constructs needed for building a typed language out of macros. Therefore, I would imagine that compared to other languages, the surface area for implementing alternative compile targets becomes a bit easier since most of the language constructs live on macros.

From your perspective, is it any easier to implement other targets because of the current design?

I was wondering what you thought about exploring Cranelift as a backend. Alternatively, I would be interested in exploring the Erlang BEAM as a target since there aren't many typed languages targeting that ecosystem yet.

Perhaps this is just a conversation starter for now.

closed time in a month

colelawrence

issue commentpaulstansifer/unseemly

Add a compiliation phase, as an alternative to evaluation

Now I think that compiling to a high-level language is probably a bit of a false economy. As issue #35 argues, having few core forms makes it easier to write a backend, so why not pick something low-level to get faster compile times, fewer dependencies, and more control?

Backends to consider:

  • LLVM
  • Cranelift
  • BEAM

There's some runtime code that would need to be reimplemented; probably the easiest solution would be to rewrite that code in Unseemly.

paulstansifer

comment created time in a month

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 8e300da8d4c536c0d4b256445c6a3c7a3e27b36f

Prep slice-healing infrastructure for adding a true dotdotdot type.

view details

Paul Stansifer

commit sha 825663b12e8593020ad4845176d1766b583f0df1

Bugfix for splice healing.

view details

Paul Stansifer

commit sha 2c5ca0216c46932200ba657d54c41b008d37305d

Docs: Add examples, and more information about syntax and syntax extensions. Partially addresses issue #34; need to add some stuff to the prelude so that more of the examples work out-of-the-box.

view details

push time in a month

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 92005f889b46b78e512a23f35bbe47b3b011f69e

Allow the function passed to `heal_splices` to produce a `Result`.

view details

Paul Stansifer

commit sha 3504e0f9304616c4a9b633a0365b0d76c1b8a1e0

Allow pass-through of errors in `heal_splices`.

view details

Paul Stansifer

commit sha 2bcc32cb185e9165244a63ed2a1a9041221d8722

Fix Markdown formatting issue in README

view details

push time in a month

push eventunseemly/unseemly.github.io

Paul Stansifer

commit sha 099f5302c251329b280dcd4b9f07f2be4b10bdb6

Tone down an overly-strong claim.

view details

push time in a month

push eventunseemly/unseemly.github.io

Paul Stansifer

commit sha 59da247b4eacce5e57179ac815e65fb95ddc251f

Try out yet another phrasing for the disclaimer at the top.

view details

push time in a month

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 1c0fb5dff339171425060a90c5e2f4f44b305b19

Add a function pipe demo. https://github.com/0x0f0f0f/gobba#function-pipes-reverse-composition-and-composition

view details

push time in a month

issue commentpaulstansifer/unseemly

Implement enum subtyping (maybe)

Implicit in the above is that pattens will be required to be irritable at their types. At the moment, that isn’t a big change, but it does seem to cut off any possibility of, say, patterns containing expressions (for exact matches) or arbitrary conditions, both of which are useful.

One possibility would be to have a separate IrrefutablePat; not sure how to make that work in practice, though, particularly because a type-safe irrefutability-enforcing catchall-free match should be implementable as a macro.

paulstansifer

comment created time in a month

push eventunseemly/unseemly.github.io

Paul Stansifer

commit sha 2bfe1063d7987ad6e194a1129a28e2df1f0474d5

Fix a missing linebreak.

view details

push time in 2 months

push eventunseemly/unseemly.github.io

Paul Stansifer

commit sha e2b4b752b40109de402e57906bc24d14ac614852

Revise syntax in the examples. Also, upgrade Unseemly to "actually works"!

view details

push time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 19ad488d24444e7c9265479d2156e045270fe0b9

No longer require spaces around the commas in `...[,x, >> ]...`

view details

Paul Stansifer

commit sha 55116750aead02fb921345b3f377f2c61bcee5cc

More minor doc revisions.

view details

push time in 2 months

issue openedpaulstansifer/unseemly

Add `Item` nonterminal

Eventually (#4), we should be fully abstract over non-terminals, but that has some complicated design uncertainties. In the mean time, lots of normal languages have Item, a nonterminal that defines a new name (or names) but (unlike Pat) doesn't expect a context element and therefore don't need to be handled in order. It's common to have all the bindings provided in a list of items be bound in all of the items.

created time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 8731d10e38499d301a1f0825c90ce3a04af6aeb8

Remove lingering extra `.vscode` file.

view details

Paul Stansifer

commit sha a471622bbd2d21f5357df736736b242577c904b3

Fix a couple latent `ExtendEnvPhaseless` bugs in `alpha.rs`

view details

Paul Stansifer

commit sha 158aff3f003949adcba2cda54a17ee080a91b802

Fix a bug: binding information from the original macro was being kept around. (a) How did this not come up earlier? (b) How did it not occur to me that I needed to do this?

view details

Paul Stansifer

commit sha 6664a53ca5cc647eb9d4a6188dd3e8f36531560a

Bugfix: don't pointlessly violate hygiene in quasiquotation! So *that's* where those tomatoes were coming from! (Also, in `comments.≉`, fixed accidentally treating commas as whitespace.)

view details

push time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha eab99d91ca87a1953a348b9b92477c7888069cb5

Bugfix: `new_wrapper` and `must_subtype` can't be used mid-walk. (They discard non-phase-0 environments.)

view details

Paul Stansifer

commit sha c1c8dc2371140a26973abca09a4a34270d4bf83c

Collapse a bit of duplicated code.

view details

Paul Stansifer

commit sha 15f251c09e22f38668473170c1e0fe6bfecd2e24

Remove two more cases of LWR-discarding.

view details

Paul Stansifer

commit sha c815be8c3df1988b815822bf71bf3950d0c637d4

We no longer need spaces before colons! Yay!

view details

Paul Stansifer

commit sha 7cd29f7ea72132d0e099bb585ff36afff977590f

Introduce (but don't yet use) `phaseless_env`, a cross-enviroment prelude.

view details

Paul Stansifer

commit sha e6724cb07513155fd4cb38ab938ddd4f1e3cdf62

Add `ExtendEnvPhaseless` as an Ast node. It's not used yet, but it'll help us bind macros.

view details

Paul Stansifer

commit sha 1823628357064894922ae46c30cdf9b0d778d63f

Treat `EEP` like `EE`, and actually use it in syntax extension.

view details

Paul Stansifer

commit sha 5964e2876600d6e48f02928268127807d75951de

Run `cargo update`.

view details

Paul Stansifer

commit sha 61ceca9f23857e603d31bb9a2860d92fb520eb46

Add more metadata.

view details

Paul Stansifer

commit sha ba544881a66f7fb43610e00e34caed41311d4ed7

Add a changelog.

view details

Paul Stansifer

commit sha 8c56c682bfb5fd07cc8b8c93293fe362267c5f43

Finally, provide a runtime way to turn walk-tracing on!

view details

push time in 2 months

issue openedpaulstansifer/unseemly

Introduce `Environment`

Environment (or maybe just Env) will live in util/ and correspond to the env, less_quoted_env, more_quoted_env, and phaseless_env members of LazyWalkRes. It'll resemble (and perhaps replace, though it is more powerful than it needs to be for this) Ren in alpha.rs. Essentially, it's an Assoc that's aware of quotation levels ("phases").

eval(), synth_type(), etc. will all take an Environment instead of an Assoc. We'll have a macro, env_p0!() which will generate an environment with only phase-0 contents.

We'll need to think about whether Clo should contain an Environment instead of an Assoc, but that's not part of this issue. In fact, this change should highlight a number of places which should get TODOs to rexamine whether they should be using an Environment instead of an Assoc.

created time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha f7d8613dccb25ec7ac6e01b53d778ef2d6d8cfb8

Delete extraneous copy of the prelude.

view details

Paul Stansifer

commit sha ac8f19fcf3bb388237af2bef14d96b8605736fba

Update README a little.

view details

Paul Stansifer

commit sha 63ff7b46070ebef4c9fd1110a050f5b66dbd8e2e

Allow whitespace (etc) at the end of a file.

view details

push time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 5f38ad868ab206db3a4943db262ef96be11c9652

Update some stale documentation

view details

Paul Stansifer

commit sha 96a731d60ca562cf99b81888644fa35372cb8593

Add `Pick` to the grammar. It ignores everything but one `Named`.

view details

Paul Stansifer

commit sha 180affce2a0796003c653d568e70b5fedc291664

Restrict variable names; they can't contain most punctuation now.

view details

Paul Stansifer

commit sha 7944ee49020fb517d68712a4bb3b265e0c260318

Replace fish X-ray (`T <[S]<`) with normal generic type syntax (`T<S>`).

view details

Paul Stansifer

commit sha d48f48db0d7f2e46a0480bac948344e2a33db3d4

Improve error messages by excluding low-level grammar forms from errors.

view details

push time in 2 months

push eventunseemly/unseemly.github.io

Paul Stansifer

commit sha d04431da39e0308d7930aec84b5310fa44c79ca0

Update to the new syntax.

view details

push time in 2 months

issue openedpaulstansifer/unseemly

Verify that names are bound at the right type

If one writes a macro that promises to bind a to Int for a particular argument term, soundness requires that this actually takes place.

(This corresponds to the difference between FreshML and Pure FreshML, but the Pure FreshML (and Romeo) solution to this problem is an unacceptable burden to the programmer.)

We must make a conservative approximation; there's no practical way to allow all cases where the programmer could prove that they would do so. In particular, I think we want to take advantage of the fact that macros are usually built by calling other macros, not by calling functions.

I think that the Rust borrow checker is the rough kind of thing this needs (however, this should be a simpler problem).

created time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 11449c727bfcfb6ffb728474862da7e30cca2d2f

Use (and allow use of in macros) the new explict-type-constructing SameAs.

view details

push time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha a73aec3db3298d0bc26a6a1bc191b754b5c77418

Only display one line of code for parse errors.

view details

Paul Stansifer

commit sha 27cffcaae4c288a59f8f5cdfd4ba1f60fe5ba5e8

Make a couple of fixes to prepare for extending `SameAs` In particular, the RHSes of `SameAs` and `Basic` weren't name providers at all.

view details

Paul Stansifer

commit sha 1b5bf8acf847a744b08a65fabbbed734c7e1a576

Allow the use of explicit constructed types (etc.) on the RHS of a beta.

view details

push time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 406bca797ef5670a068fc444d30489d43fb37ac0

Make some documentation revisions.

view details

push time in 2 months

issue commentpaulstansifer/unseemly

Fix `pre_match`, somehow

match_dotdotdot is now gone. I had to change the semantics of dotdotdots (now they are always tuples, rather than working inside any kind of repeated construct) to avoid needing to do a prematch for positive walks as well as negative ones.

paulstansifer

comment created time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 986ef9a82e82c9977c255a25be2be7537e44eb4e

Have the REPL debug-print or pretty-print separately.

view details

push time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 2a83235491a36dd4e8a9f919a9cc3460bb64e14c

Update documentation in a few files.

view details

Paul Stansifer

commit sha 6e88b3d650d1f94a93db076ac1cdde6b4d6e6314

Improve pretty-printing of syntax extensions.

view details

push time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 0f17fd02ac2dbf108c0af09419a34d2be6dffb33

Add some parameter names in preparation for the 2018 edition

view details

Paul Stansifer

commit sha fc73a3e5fc502a148e5423034207befab6b14b53

Upgrade to Rust 2018. Also, add `use` statements to try to eliminate some repeated long paths.

view details

Paul Stansifer

commit sha 43ed697b43c82c8b03d65f5a3efc4c8bb15a9980

Fix typo.

view details

Paul Stansifer

commit sha 14182836696151e2095a46e8cde439b54730825a

Actually use `gensym`, now that we have it.

view details

Paul Stansifer

commit sha 17f7f4b8beeadcf6f9c40022c9b71fee4a1e0a02

Rename "DefaultName" -> "DefaultAtom".

view details

push time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 303a6b336aa18d30cd735236902032a50d030da7

Add an example of an `if` macro.

view details

Paul Stansifer

commit sha 779d076247cb44e489d0d0f9619fe1b122ef98e6

Fix some lingering rustfmt noncompliances.

view details

push time in 2 months

issue closedpaulstansifer/unseemly

Implement typed macros

It should be possible to define a macro, (e.g.):

forall T . '{ (lit if) ,{Expr <[Bool]< | cond},
              (lit then) ,{Expr <[T]< | then_e},
              (lit else) ,{Expr <[T]< | else_e}, }'
 conditional -> .{ '[Expr | match ,[Expr | cond], {
                                +[True]+ => ,[Expr | then_e],
                                +[False]+ => ,[Expr | else_e], } ]' }.

...and then invoke the macro:

if (zero? five) then three else eight

...which should expand to the expected code.

Furthermore, if the macro definition is wrong in a way that would expand to ill-typed syntax, it should fail typechecking in an appropriate fashion. And if the macro invocation is wrong in such a way, the invocation should be a type error that does not expose the implementation of the macro or its expansion.

closed time in 2 months

paulstansifer

issue commentpaulstansifer/unseemly

Implement typed macros

It works!

paulstansifer

comment created time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha c397dd32e1c079cc0cea77f1a797223823fc28e4

Allow syntax extensions to descend into any grammar, not just an NT.

view details

Paul Stansifer

commit sha 51f2321a4b65a9a25e820c7aa6fc6874a36bdae9

.Don't fallback to `Debug` when `Display`ing `Shape` ASTs/

view details

Paul Stansifer

commit sha 9cdae5698421bda99ddacb7dcec8d108922f9a31

Have `SynImport` keep its LHS around.

view details

Paul Stansifer

commit sha 0b3f804e64a5228eacda356548c89e5f2a0fba31

Store the macro name in the AST, rather than capturing it. This way, freshening can access it, so it doesn't get unlinked.

view details

Paul Stansifer

commit sha 6f85dd9a37aaa37184e6bcde8b8f5cccf347c7ff

Remove obsolete comment.

view details

Paul Stansifer

commit sha 44b9b04338f0eac18aef2bcd02bf59e73ec4536b

Add `unhygenic_orig`, which we may need to deal with struct fields.

view details

Paul Stansifer

commit sha 5edb1ac88a15b059d439582d3495faf3593649bc

Add a hack to prevent freshening from messing up struct names.

view details

Paul Stansifer

commit sha 4d8686da13459355cd0b38592258ce7cf77495f5

Subtyping of `...` was backwards! Fixed.

view details

Paul Stansifer

commit sha 1680d668a8875075b588c945ce641fb61324ddc5

Fix generation of tuples to reflect repetition in macro types.

view details

Paul Stansifer

commit sha 82d81f77a8bd074c61827c979cd7a392a55a622a

Don't hold on to meaningless ExtendEnvs when building a closure.

view details

Paul Stansifer

commit sha e6a1e2148582add92caee9c4ec1737162cf3a41f

IT WORKS IT WORKS IT WORKS IT WORKS Make the drivers in dotdotdot splices actually live in unquoted, so that renaming renames them at the right time. Now the end-to-end test of a typed macro with binding works! It works! Closes bug #1.

view details

push time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 8a49902950a4b252ba72511bc4cc750354d87b93

Allow `...[]...` to be used in both positive and negative positions. This is tested in an end-to-end test that isn't checked in because it's broken in another way. A lot of things could use actual unit testing.

view details

Paul Stansifer

commit sha 08c5728ec30369a46a04dbf2edbf0c6b44d37043

Allow the `ld` macro to count evaluation steps.

view details

Paul Stansifer

commit sha d20832311085c31c8cf86d25299981f217bfc0cc

Add "DefaultReference" for variable references. "DefaultName" should probably be "DefaultAtom" instead

view details

Paul Stansifer

commit sha 1736ce2cadec2f6596366ba6bd38412a53006da0

Always use `.print()` for `Name` The tomato-based debugging notation should only be needed if there are problems with the interner.

view details

Paul Stansifer

commit sha 8e897c86969d8aa0288ed185f74191a61888960b

Allow `env_from_beta` to run either positively or negatively This required introducing `AsPositive` and `AsNegative` to `WalkMode`.

view details

Paul Stansifer

commit sha a86f7cbed448ac533f7332115760bb5ea8873640

Incorrect macro invocations are type errors!

view details

push time in 2 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha e723a2ddd153e4f1d159dba9ad0fb0482b316156

Bare literals in `lit` were confusing and couldn't be already-reserved words.

view details

Paul Stansifer

commit sha 75e9e154e6a17fab2e2767d8972430b68aa3d76c

Syntax syntax: use tuples, rather than sequences for syntax repeat types.

view details

Paul Stansifer

commit sha 0550bb588723fa7fd832bc30b0736e91adc33cb9

Pretty-print type errors, add some docs.

view details

Paul Stansifer

commit sha 666be6ce9ba568fd6eb3b3774011f85c0a441fcc

Revise docs a little, add an issue number to some TODOs.

view details

Paul Stansifer

commit sha db6b4ceb471866058c31f65d75cb46c7e51ebb56

Make `...[]...` actually be a tuple, instead of a complex splicy thing.

view details

Paul Stansifer

commit sha 134b52c3c67062a5d7f9ec9fc3ac905fe5bb4ca8

Version-control `Cargo.lock`. I don't know why I wasn't doing that before.

view details

Paul Stansifer

commit sha 210c223d7e7ae8ced5138ed95e101f12b3098b61

Reference issue number in `MISTAKES.md`

view details

push time in 3 months

issue openedpaulstansifer/unseemly

Remove `Ty`

It was originally something else (don't really remember what), but now it's just a thin wrapper around Ast, and it does nothing but get in the way. There's a lot of random converting back and forth between Ty and Ast currently that would get deleted in the process.

created time in 3 months

issue commentpaulstansifer/unseemly

Disentangle two meanings of "parts"

(also, walk_ctxt is sometimes used for LazyWalkResess, but I think that is probably confuseable with context_elt)

paulstansifer

comment created time in 3 months

issue openedpaulstansifer/unseemly

Disentangle two meanings of "parts"

parts is a commonly-used variable name (or variable name suffix) for both EnvMBEs and for LazyWalkResess. This is confusing! We should use it only to refer to EnvMBEs, and change all occurrences of parts referring to LazyWalkReses to something else. Doesn't really matter what. Maybe lwrs. Maybe walker.

(Also, LazyWalkReses is kinda ... a big pile of stuff. Maybe it should be refactored apart somehow, but it seems to work pretty well as a unit, so maybe not.)

created time in 3 months

push eventunseemly/unseemly.github.io

Paul Stansifer

commit sha 0801fe85df1d9ed4aadc42ecea6415da582b49ce

Revise the pitch a little bit.

view details

push time in 4 months

issue openedpaulstansifer/unseemly

Merge `ty_compare::Canonicalize` and `ty::SynthType`

I think that ty_compare::Canonicalize and ty::SynthType are actually doing the same thing to types (though SynthType also operates on expressions); if so, we should remove Canonicalize (making sure not to call it, of course). If it winds up being the case that ast_walk forces us to keep it around to be paired with Subtype, we should still change get_walk_rule to force them to behave the same way.

Also, ty_compare::resolve is not the same thing, because it needs to deal with underdetermined types... but adding underdetermined type handling to ty::SynthType wouldn't cause any harm, and might let us merge that, too.

created time in 4 months

issue openedpaulstansifer/unseemly

Pass `Assoc` by reference to functions

It’s cheap to clone, but probably not that cheap, and it’s getting cloned all over the place. Also, I suspect that it could simplify some closures to only need a reference.

created time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha f781dcc14ba33b80e9160cc8a8946fa8692c1dea

Bugfixes for `u!` macros There was an extra semicolon that caused a really hard-to-debug type error. Too bad I couldn't typecheck macros before expansion...

view details

Paul Stansifer

commit sha 9b7543b319fefa1fb19508b0a95541f66b4ace85

Handle dotdotdoted arguments to macro expansion.

view details

push time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 40888f23c3a86193bc2412cbb69e92bbaa00414b

Implement tuple patterns. Closes #16. Turns out that I wanted tuple patterns for macro testing, too.

view details

push time in 5 months

issue closedpaulstansifer/unseemly

Implement tuples

Tuple types already exist, but they can only be constructed and destructed by parsing and syntax quotation respectively. There should be an actual literal, and an actual pattern for them, respectively. Tuples are stored as a Sequence, and the literal and pattern can be modeled after those for structs.

closed time in 5 months

paulstansifer

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha a539c84f631c02519dc78a4e5b190a00f22b1e1c

Provide error messages for missing quotation type annotations. Important because the rules for when you need them are *so confusing*.

view details

Paul Stansifer

commit sha 9ace80e689d5e71206243839bb9b3d6aea7c2614

Allow unquotation to omit the NT when annotation is unnecessary. It makes the syntax rules more complex, sadly. Now, the forms are: ``` '[NT <[Type]< | ...]' '[NT | ...]' ,[NT <[Type]< | ...], ,[...], ``` But there's no way around having an NT annotation on quotation, and unquotation doesn't need it.

view details

push time in 5 months

push eventunseemly/unseemly.github.io

Paul Stansifer

commit sha 23f8558975a3b004f5ba518d05ca9fa6e5dc94f3

Add more (currently hypothetical) examples. Revise "first" claim to avoid Scala, whose blackbox macros are more limited, but do seem typesafe.

view details

push time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha a6190a0bbb4bdd2d32fd078e5491378c725a4760

Follow some clippy suggestions and other misc cleanup.

view details

Paul Stansifer

commit sha f6286fe098524857bf05ac2e1f9f9d6f3be54504

Remove `Token`. Fix some tests that had spaces inside of tokens, which this broke. How on earth did they work in the first place? They've been being flattened to plain strings ever since the parser went scannerless.

view details

Paul Stansifer

commit sha 77b119ad2d3e63f6b60360368e343f550f14bbfe

Add tuple construction, improve `u!` a bit more. Partially addresses #16 (still need to destructure tuples.)

view details

push time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha b1c4d6ea5151a9b54316e8c47f160b441ebeb4f4

Test expansion of more complex macros! Also, improve flimsy syntax a bit, by letting it handle `Alt` hackishly, and having it skip over `Named` `Anyways`es.

view details

push time in 5 months

issue commentpaulstansifer/unseemly

Remove the `quasiquote:` field from `Form`.

This is the same thing as what the MuProtect walk currently does.

paulstansifer

comment created time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 504049333cd96bbb00fe50e6fbffb35507621291

Include macro expansion in end-to-end execution! (Not tested for actual macros yet.)

view details

push time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 8052bd30ce0465ecf1176a8cdb70b4091ab98f87

Mention issue #25 where it's relevant.

view details

Paul Stansifer

commit sha baeca569c6504db31617b04dbf0923b168f97c59

Macro expansion works now! Decided to put macro implementations in `Form.eval`, instead of the `Ast` itself, because it made more sense. (Note that having a separate field from `eval` would be neater, but I couldn't bear to add yet another field.) This turns out to be a simpler way of handling the macro implementation hygeine problem, too. Closes #25.

view details

push time in 5 months

issue closedpaulstansifer/unseemly

Hygiene problem in macro invocations

This probably won't hit very often, but any hygiene violation is a soundness problem.

The implementation in a macro_invocation is separated from its environment at the time of Scope's syntax_syntax!, and then reunited at macro expansion time. Instead:

  • the Expand walk needs to be over Elts and have an environment that gets set by extend_syntax (so I guess that extend_syntax needs to invoke Expand? Or it needs to reify the environment and store it in the Ast?) from negative evaluation of the Syntaxes.
  • evaluating Syntax needs to produce an environment binding macros to closures that capture their environment. The current function (generating a FormPat) would need to be handled by binding a special name in the environment, it seems.

closed time in 5 months

paulstansifer

issue openedpaulstansifer/unseemly

Remove the `quasiquote:` field from `Form`.

Instead, just use form.name == n("unquote") (and "dotdotdot"), since those are the only two forms with unusual treatment.

(We should also get a better notion of Form identity!)

created time in 5 months

issue openedpaulstansifer/unseemly

Hygiene problem in macro invocations

This probably won't hit very often, but any hygiene violation is a soundness problem.

The implementation in a macro_invocation is separated from its environment at the time of Scope's syntax_syntax!, and then reunited at macro expansion time. Instead:

  • the Expand walk needs to be over Elts and have an environment that gets set by extend_syntax (so I guess that extend_syntax needs to invoke Expand? Or it needs to reify the environment and store it in the Ast?) from negative evaluation of the Syntaxes.
  • evaluating Syntax needs to produce an environment binding macros to closures that capture their environment. The current function (generating a FormPat) would need to be handled by binding a special name in the environment, it seems.

created time in 5 months

issue openedpaulstansifer/unseemly

Build a "reification shortcut" for `FormPat`

Just like how Ast has AbstractSyntax, and a special-case implementation of Reifiable, FormPat should get something analogous so that the constant reification and reflection in core_macro_forms.rs doesn't have to do as much work.

This should be very similar to what commit ea2a0d9 did for Ast.

created time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha ea2a0d9b2a718b8f0bcca36d2a1b3e699b3f4677

Actually use the shortcut in `Value` instead of unrolling `Ast`s reification. I had never noticed that `AbstractSyntax` (a) was not required, because of `Ast` was already `Reifiable`, and (b) was not actually being used for its intended purpose. I think this would probably be a significant performance improvement for complex syntax manipulation.

view details

push time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 003084ab4e2793b72fd0df2ffcca16b9b0b4a71b

Simplify the environment check in Beta (and make it always happen).

view details

Paul Stansifer

commit sha c3f6e00c306bf42b48859380fd47f7c3d728e581

Test macro definition. Expansion is going to need a bit of rethinking of how macro types make it out of their definitions.

view details

Paul Stansifer

commit sha 151a45d1b62988f41a5ef95ee0bd6f35fba26380

Have `extend_syntax` take a BNF extension directly, not a function on `SynEnv`s. For typechecking reasons, `extend_syntax` needs to be able to reach into each `Syntax` (i.e. a RHS of the BNF) and get the type environment it produces. So this means that general `SynEnv`-to-`SynEnv` functions won't work, unless they ... also returned a reified version of the resulting type environment (or enough stuff to compute it)? Ew! Anyways, I think there's rarely going to be a need to programmatically decide which NTs to add to the syntax, so this should be fine. This undoes the work for #23, though. Now it's more of a WONTFIX, I guess. Also, fix a couple of bugs in core_macro_forms.rs.

view details

push time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 30b28c898045543710712c0dea6c7acf3ccc0497

Use flimsy macros to simplify some tests.

view details

Paul Stansifer

commit sha 3da2afd352a1b7cb7079ee4f42fc7dd77bd12cd9

Modify flimsy syntax so it's only necessary to specify the NT when it changes.

view details

Paul Stansifer

commit sha 4f70e76ede40c4c01837387646f082f2a5326930

Remove an unnecessary sequence node from `type_apply`.

view details

Paul Stansifer

commit sha 3e341cebfa336f5f11bd28d08562c05d25905993

Oops, fix `import`/`named` inversion (found by flimsy syntax!).

view details

Paul Stansifer

commit sha d781c8257c1eaa2405cb32aeccc401c5a17d5c8e

Simplify some syntax syntax with `u!`.

view details

Paul Stansifer

commit sha 903f73538cb56f79ce9fe1328fe84f244c262fe3

Hook up BNF notation, add end-to-end test of adding comments to the language.

view details

Paul Stansifer

commit sha 92ab5de20a81745a7bf1c8a6093d1476938f817e

Mention MBE and Scala in the README.

view details

push time in 5 months

issue commentpaulstansifer/unseemly

Remove first-person language from comments

I think it's fine to say "We don't know... " or "TODO: figure out why ..." or "Why doesn't ... ?"

paulstansifer

comment created time in 5 months

issue closedpaulstansifer/unseemly

Fully-general syntax extension form

For the sake of complete flexibility, we want a way to say "Apply this SynEnv-to-SynEnv function to the current language", not just an "Extend the grammar like this" form.

closed time in 5 months

paulstansifer

issue commentpaulstansifer/unseemly

Fully-general syntax extension form

I would up making extend_syntax fully general, and adding bnf[ ]bnf to handle the normal case.

paulstansifer

comment created time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 47f71257cdace98640cd93d705a0761082f522f2

Pull out `expand.rs` and revise documentation.

view details

Paul Stansifer

commit sha 1e1ba3295cddfd691452a0175fee459f9418c5ce

Make canonicalization support `forall`

view details

Paul Stansifer

commit sha 9acb6c4c40add7c92dc027f9cf5415426f9757e0

Add a convenience form for defining grammars by BNF. Revise syntax syntax.

view details

push time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha d281d8048e3e592a8f5531451d6154a8263d2b85

Remove unneccesary trait bound.

view details

Paul Stansifer

commit sha 2034952d42259f2ae0e5f99c8965bcb68df13232

Make an error message clearer.

view details

Paul Stansifer

commit sha 2e3f0fee514af55c188fdc8963bf13eb52f12e73

Use `ty_invocation()` instead of `ty()` (confusing name!)

view details

Paul Stansifer

commit sha d7417ac5c0ebad353f24f684bbc0b00da3a7ca06

Set up a core environment containing enough types for `SynEnv` to work.

view details

Paul Stansifer

commit sha fcdc2851a3cf70abc349481fd06510133ceb6260

Reify pairs.

view details

Paul Stansifer

commit sha 737431522a24bbc71541fbf6277599f76aba1c2a

Use HAMTs, rather than linked lists, to back `Assoc`. Performance improvement! Running all of the tests (including `perform_syntax_extension`, which isn't checked in in its final form yet) now takes ~15 seconds, not ~43 seconds.

view details

Paul Stansifer

commit sha e60f3cb3d99ad9285c5e2fb203d39dc9b6f60d10

Syntax extension now works! Removed a extra attempted typecheck step that doesn't work, and write a test for syntax extension!

view details

push time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 5df6c7df8db73de6251741dc81e2ebccee071e4c

Use the existing primitive mechanism for reification.

view details

Paul Stansifer

commit sha cc58d148e0b877410291ccee4f514a2f26d69452

Have manual reifiers override `concrete_arguments()`, not `ty_invocation()`.

view details

Paul Stansifer

commit sha de8d08be15dba4b12d43f9031939ccac9f28ce74

Have the reification macros override the right function.

view details

Paul Stansifer

commit sha d3281fa4f63e42300a8f500f76df6ba9d0794820

Introduce `Irr`, which `impl`s everything, but can't be created. Used for invoking `::ty()` and `::ty_name()`.

view details

Paul Stansifer

commit sha e53c1e7fdfe456609d580011c0583eda8bc2e2c7

Improve pretty-printing (unsure why recurring into `Scan` didn't work, though)

view details

Paul Stansifer

commit sha 36b787a72f1d620e77114f2d0227bfaa318e7b80

Minor cleanup.

view details

Paul Stansifer

commit sha 6ddaf8431f3d8d8ceae74cb044b3c34fa27bab7a

Make type reification ignore the concrete arguments to generic types.

view details

push time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 7df8e15a42322f2e4d65d59cbee11bb82ca7f74f

Fix a compiler warning. How the heck does this compile? Well, it makes the warning go away, so I won't worry about it.

view details

Paul Stansifer

commit sha fb3fb90cc25b0dfce12ee6e39042136fdc6bed51

Revise comments on `::ty()` `::ty_name()` and `::ty_invocation()`. Turns out the existing code actually did make sense!

view details

Paul Stansifer

commit sha 1c5eaf364d071755ca840994302aeea0a86e0cda

Rename `abstract_parametric_type` to `primitive_type` for correctness. (and concision!)

view details

push time in 5 months

push eventpaulstansifer/unseemly

Paul Stansifer

commit sha 8d1875ce6a776298d553871c2f9627b0d7d21ae9

Set up environments for typesynth/eval during parsing. Not tested, because it needs us to set up a proper reified environment, which in turn requires working out how reification of generics will work.

view details

push time in 5 months

more