| > It's not the compile time text processing that's interesting You've talked right past me. Metaprogramming is not compile time text processing. > Honestly even if some of this were possible with metaprogramming, my intuition is that it would be much more verbose and complex. No. It's probably even how the Microsoft team are achieving the typing you're talking about. The special sauce here isn't as special as you think. > I think we're reaching a bit of an impasse Not really. I was just saying that what you're talking about is totally possible with metaprogramming. Not making some rhetorical play. > José Valim's blog post on static typing ended with an announcement that they've sponsored a PhD student to work on these problems. That's specifically because strict static typing with guards^ is at least difficult, but maybe impossible, and that's what the PhDs are trying to figure out. However, dialyzer isn't as hobbled as you imagine/purport it to be – the crux of my counterargument – and actual experience trumps speculation or casual reading on the topic. FYI, guards and pattern matching are one of the reasons why Elixir is so damn expressive, and this kind of function typing isn't available/possible in most non-functional languages ^ https://hexdocs.pm/elixir/guards.html |
I'm not talking past you. I never said metaprogramming is compile time text processing. You said "Elixir can already accomplish compile time text processing with metaprogramming", and I was just pointing out that the text processing itself is not the most interesting part of the example, it's the resultant types.
> No. It's probably even how the Microsoft team are achieving the typing you're talking about. The special sauce here isn't as special as you think.
But I don't have to reimplement any of this, because Microsoft has already written it. With enough time maybe you could implement dependent typing using metaprogramming for example, but would you then say that Elixir is just as good at dependent typing as Idris, which has that feature built in?
> I was just saying that what you're talking about is totally possible with metaprogramming.
You've graduated from saying "I think someone more savvy with Elixir would know more." to "totally possible"[1]. This does not sound like an argument from experience.
> That's specifically because strict static typing with guards^ is at least difficult, but maybe impossible, and that's what the PhDs are trying to figure out.
A lot of what you're talking about has already been implemented in other languages. This is not untrodden ground. There's no syntactic sugar for guards in JS (which TS just adds type annotations to), but semantically it's very similar to type narrowing in TS [2], which I use daily. This is not something I've read about casually on the internet.
[1] https://news.ycombinator.com/item?id=35944988
[2]https://www.typescriptlang.org/docs/handbook/2/narrowing.htm...