The idea is to have a single macro which lets you reflect multiple
implementations. That's provided in this commit. However, there
is a hitch with implementations that have no dependencies: the
reflectedType property did not exist on the Signature type. However,
if you add it, then the Signature type becomes opaque, so we would
have to look up signatures; but that appears to be tricky, as there
doesn't seem to be a way to reflect the full generic type of the
Signatures interface.
So this commit provides three example resolutions:
(A) Export a type RTT and all no-dependency implementations have to
intersect with RTT (see 'add' in number/arithmetic.ts)
(B) Write no-dependency implementations as functions of no arguments
(representing no dependencies passed in) returning the actual
implementation (see 'subtract' in number/arithmetic.ts)
(C) Make a special DSignature<> generic type (short for "Direct Signature"
used only (and always) for implementations with no dependencies, and
a matching $Dreflect!() macro for generating their type info.
Of course, there may be other possibilities I haven't thought of. But we
need to pick one. I don't think it matters _too_ much, since there only
a small fraction of all implementations have no dependencies.
Rather than via some format on the name of the identifier, this commit
changes the construction of Dispatcher to assume that functions are
implementations and other objects are type specifiers.
Also installs all types first, before any implementations.
Resolves#3.
Resolves#12.
Reviewed-on: #15
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Co-committed-by: Glen Whitney <glen@studioinfinity.org>
This commit adds pnpm scripts for compiling and running the
typocomath package, and a convenience script `pnpm go` that does
both in succession. It also configure pnpm to use a shell
emulator so that it should work on Windows as well. Finally,
it changes the directory for object files from obj to build.
Resolves#9.
Reviewed-on: #13
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Co-committed-by: Glen Whitney <glen@studioinfinity.org>
Adds a new subdirectory `interfaces` where standard interfaces
are defined. Additional interfaces for a given operation can
be added with an `AliasOf` type operator. Provides type
operators that give the return type, full function type, and
the type of a dependency on, a given operator.
Resolves#6.
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
Reviewed-on: #8
This PR is an effort to address #1. It removes all boilerplate
from individual implementation files, and moves it into
a small, fixed section in the single `all.ts` module for each
type that collects up all of the implementations relating
to that type.
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Reviewed-on: #2
A first pass at specifying some implementations in TypeScript
that actually compiles. It doesn't do anything, as installing
types and operation specifications are currently dummy operations,
but they are all invoked.