DEV Community

Discussion on: A crazy idea and a proof of concept

Collapse
 
gillchristian profile image
Christian Gill • Edited

Thanks for the comments! Very useful suggestions!

I haven't made up my mind yet about the query language. A "DSL" could be much simpler than the actual definition. For simple signatures there's no much change:

(type: string, id: string) => string
// vs
string, string => string

But for more complex ones it could become easier to type:

<A, B>(array: A[], fn: ((a: A) => B)) => B[]
// vs
<A, B> A[], (A => B) => B[]

But I did not consider the fact that it would mean learning something new. That is a strong argument.

Yeah a ML/NPL solution could also be the case. But I guess it makes more sense your your idea (which, btw, is really cool).

Yeah, I will definitely take a look at how other languages do and even how TS itself does the type resolution. Now I implemented something pretty naive. Will write a bit more in the coming week/s.