Live data from Hacker News

Show HN: A SQL database implemented purely in TypeScript type annotations

github.com

1–10 of 196 posts

Re: Show HN: A SQL database implemented purely in TypeScript type annotations

#3

Pretty interesting, but it doesn't seem to be possible to use the resulting values? Except as type declarations of course. Also, the playground link either fails (there are several errors) or doesn't produce any output.

hover over the type annotations to see results in the playground, that's the output :)

The errors aren't really errors, just warnings about unused types

Re: Show HN: A SQL database implemented purely in TypeScript type annotations

#5
The implementation isn't even that horrible. Ignoring the integer list. That workaround is still hillarious to me.

Anyway, it seems both impressive that someone did this and that it actually works. Weird how typescript has the nicest typelevel programming I know, even nicer than some dependent ones. It probably is the only language one where autocompletion properly works with computed types?

Re: Show HN: A SQL database implemented purely in TypeScript type annotations

#7

Pretty interesting, but it doesn't seem to be possible to use the resulting values? Except as type declarations of course. Also, the playground link either fails (there are several errors) or doesn't produce any output.

yeah Typescript is compile-time-only type system, you can only use it as a type. still cool though

Re: Show HN: A SQL database implemented purely in TypeScript type annotations

#8
I’m impressed/fascinated/horrified by the way it parses a string into a type with a variant of template literal syntax—though it looks like the parsing is probably very fragile. I’m curious why that functionality was added to the language.

The end result is actually pretty approachable.

Re: Show HN: A SQL database implemented purely in TypeScript type annotations

#9
post #5

The implementation isn't even that horrible. Ignoring the integer list. That workaround is still hillarious to me. Anyway, it seems both impressive that someone did this and that it actually works. Weird how typescript has the nicest typelevel programming I know, even nicer than some dependent ones. It probably is the only language one where autocompletion properly works with computed types?

> The implementation isn't even that horrible

You're making me blush!

The list of integers could be replaced by using tuples and reading their lengths to do basic arithmetic. Might run into recursion limits though.

Post reply on HN