Earlier quoted context omitted.
my thoughts as well. compile-time checked arbitrary sql would defeat the purpose of so many abominable ORMs. make it work with DDL instead of sample data and you've really got something nice!
This project does exactly that (TypeScript/PostgreSQL): https://github.com/MedFlyt/mfsqlchecker
Show HN: A SQL database implemented purely in TypeScript type annotations
191–196 of 196 posts
Re: Show HN: A SQL database implemented purely in TypeScript type annotations
#192Re: Show HN: A SQL database implemented purely in TypeScript type annotations
#193JavaScript is such a cool language, and I really love it, especially the FP subcommunity, but the AI community for Python is way bigger, I wish there were more options for neural nets, differentiable programming, and data frame type things in JS. The interoperability with WASM is hugely valuable, and so is the ability to easily publish results on the web. It feels like it’s way easier to make an AI system in python,…
I think you're talking about two different systems and two different problems. First, there's the core service code, the AI system in Python you're talking about. Then, there's the web platform or service that you monetize. But there's no reason why you wouldn't just use both. Write the core AI code in Python because that's what's practical to do. Write the app code in JS because that's what's practical to do. Sell t…
If backend changes frontend has to change as well or compiler will yell. Same for machine learning input and output.
Re: Show HN: A SQL database implemented purely in TypeScript type annotations
#194Earlier quoted context omitted.
From years of real-world experience, it's rare to run into types that are too complex to easily understand. The syntax is pretty easy to read, and the compiler and language service make it easy to navigate types, even if you haven't looked at the source for them yet.
FWIW I find that TypeScript types can sometimes be overwhelming or hard to decipher, especially some third-party library type definitions. The connect function from react-redux is one example: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d07d... Since types can get really complex, I feel a need to be conscious of avoiding complexity when writing types myself, unless the value is enough to justify a hard-to…
Re: Show HN: A SQL database implemented purely in TypeScript type annotations
#195Earlier quoted context omitted.
I was thinking about this the other day i would love for TS flag that would turn an interface into an assert const shout = (message: string) => console.log(message) into something like const assert = require('assert'); const shout = (message) => { assert(typeof message === "string"); console.log(message); } of course this doesn't work for more complicated types
You should checkout myzod, which is very close to this experience.
Re: Show HN: A SQL database implemented purely in TypeScript type annotations
#196Earlier quoted context omitted.
Another potential benefit - runtime metaprogramming. All types are erased when converted to JS, but I can imagine a lot of utility for runtime types in Typescript.
Obligated mention of runtypes ( https://github.com/pelotom/runtypes ) that bridges the gap between type-land and runtime-land. It's not seamless at all but if you have a serious need for this sort of thing, it's great