josdejong
  • Joined on 2022-10-05
josdejong commented on issue glen/typocomath#20 2023-10-27 07:13:22 +00:00
Planned minimal path to operable Dispatcher

Thanks Glen for writing out this plan👍

josdejong commented on issue glen/typocomath#19 2023-10-24 08:21:29 +00:00
Change Dispatcher into a builder function that returns a plain object (of lots of function properties)

I feel we need a solution that will automatically allow <T>add(Complex<T>, T) via the automatic conversion

Yes, totally agree!

Options (2/2b) still look feasible, although yes, they…

josdejong commented on issue glen/typocomath#19 2023-10-23 18:41:40 +00:00
Change Dispatcher into a builder function that returns a plain object (of lots of function properties)

Having to specify whether to $reflect generic or not is indeed not ideal but acceptable at least for now. I agree on parking $$typeMetadata! for now, it's not a magic solution.

My idea is…

josdejong commented on issue glen/typocomath#19 2023-10-20 14:25:02 +00:00
Change Dispatcher into a builder function that returns a plain object (of lots of function properties)

Hmm, all these new TS issues suck, we definitely don't want that.

The $$typeMetadata! sounds promising!

In my head, Typocomath is an extension on top of Pocomath. I think the step to…

josdejong commented on issue glen/typocomath#10 2023-10-20 13:56:49 +00:00
Trajectory for Typocomath

Yes, I'm reading all of it right now :)

josdejong commented on issue glen/typocomath#10 2023-10-20 12:22:22 +00:00
Trajectory for Typocomath

Ok I'll look into the .reflectedType issue next week. And indeed it may not be an issue in practice since it's an under the hood thing, I'll keep that in mind.

The lazy approach of the…

josdejong commented on issue glen/typocomath#18 2023-10-18 13:23:45 +00:00
feat: Capture generic parameter of an implementation, if there is one

In 6bfd06cafb I've added code to extract the generic parameter from the reflectedType.

josdejong pushed to main at glen/typocomath 2023-10-18 13:22:28 +00:00
6bfd06cafb feat: extract generic parameter from the reflectedType (see #18)
josdejong commented on issue glen/typocomath#10 2023-10-18 13:13:04 +00:00
Trajectory for Typocomath

That's good news!

I've checked out the latest version of main, and can successfully run pnpm go. There was one typo export type FunctionDef {, I've changed that to `export type…

josdejong pushed to main at glen/typocomath 2023-10-18 13:12:01 +00:00
0cdc9aba78 chore: fix typo in type definition of `FunctionDef`
josdejong commented on issue glen/typocomath#19 2023-10-18 12:44:51 +00:00
Change Dispatcher into a builder function that returns a plain object (of lots of function properties)

If we implement the Dispatcher as a class, we should not attach functions to itself, then we mix things up.

However, the end user is probably not interested in a verbose `const math = new…

josdejong commented on pull request glen/typocomath#17 2023-10-18 12:18:26 +00:00
feat: Runtime type reflection

🎉

josdejong commented on issue glen/typocomath#10 2023-10-16 10:35:30 +00:00
Trajectory for Typocomath

Thanks for checking out https://docs.rttist.org/. I expect that a different library can possibly only improve on syntax or compile-time performance of ts-macros. The main question we want to…

josdejong commented on issue glen/typocomath#10 2023-10-11 08:38:31 +00:00
Trajectory for Typocomath

😂 $reflecTypes. I expect it will lead to confusion though, it looks like a typo, so we have to change it to $reflectTypes in the end I think. But totally fine with me to keep it in for now…

josdejong commented on issue glen/typocomath#10 2023-10-04 14:54:13 +00:00
Trajectory for Typocomath

I say let's continue with your latest approach:

export const sqrt = ...
$reflect!(sqrt)

I'll see if I can add this & { reflectedType: string } type information somehow, but…

josdejong commented on issue glen/typocomath#10 2023-10-04 13:31:28 +00:00
Trajectory for Typocomath

I really like to separate the $reflect from the "clean" TS function. I also like your idea of invoking $reflect with multiple functions in one go, that will be very handy and compact in files…

josdejong commented on issue glen/typocomath#10 2023-09-29 13:42:49 +00:00
Trajectory for Typocomath

I did two small steps:

  1. upgrade to ts-macros@2.5.0 instead of using the git source. Ok if I merge ts-macros-issues into main and then delete ts-macros-issues and ts-macros?
  2. I…
josdejong pushed to ts-macros-issues at glen/typocomath 2023-09-29 13:36:32 +00:00
20236355c1 feat: do not generate export via macro but keep the export in TS for better DX
josdejong commented on issue glen/typocomath#7 2023-09-29 12:17:39 +00:00
Approach6: infer TS from JS template literal

I'll close this issue again, we're not actively working on this approach and not planning for that either.

josdejong closed issue glen/typocomath#7 2023-09-29 12:17:39 +00:00
Approach6: infer TS from JS template literal