Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 0/2] impl specialization and lookup changes


On Sat, 1 Jul 2017 23:43:09 +0000, Quentin Carbonneaux <quentin@xxxxxx> wrote:

> Hey,
> 
> I like the general idea!

Agreed -- It makes things that feel like they should be
possible into things that are possible.

> On Sat, Jul 01, 2017 at 02:43:20PM -0700, Michael Forney wrote:
> > The first patch adds new syntax
> > 
> > 	impl(name, type)
> 
> I think impl(x, y) is ugly, though.  What you want
> for this is "semantic type hints" to the typechecker.
> I can't really remember if Myrddin has those.

Nope. The closest I think I have are casts, which
aren't the same.

But, tagging on to this, it would also be nice if the
syntax was general enough to allow specifying the type
of generic functions, and not just implementations on
traits. For example, with deliberately unworkable
syntax:

	std.mk<int#>(123)

But that might be pushing it a bit far.

> If not, that seems like the thing to implement.
> Hints should trigger type errors when they cannot be
> satisfied.  Otherwise, they can be misleading.

I can probably make very close guesses by the name, but
I'm not 100% sure what you have in mind here. Any chance
you can elaborate?

The interesting part in this example is that the type
of the expression here might have no relation to the
type that the trait is specialized over.

> Finally, what is libwl?  Where is it?

A wayland binding.

https://github.com/michaelforney/libwl

> 
> Happy hacking!
> 


-- 
    Ori Bernstein

Follow-Ups:
Re: [RFC PATCH 0/2] impl specialization and lookup changesQuentin Carbonneaux <quentin@xxxxxx>
References:
[RFC PATCH 0/2] impl specialization and lookup changesMichael Forney <mforney@xxxxxxxxxxx>
Re: [RFC PATCH 0/2] impl specialization and lookup changesQuentin Carbonneaux <quentin@xxxxxx>