Hacker News new | past | comments | ask | show | jobs | submit login

Isn’t that literally what .d files in typescript are?

Quite possible you might get a similar things for other existing languages as extensions.




Yes, and writing .d.ts files plus .js files sucks compared to just writing a single .ts file.

A better comparison might be ML module signatures. (Though to be fair, IIRC they enable higher-order modules instead of just helping the compiler.)


.d.ts files are produced by Typescript compiler automatically from .ts files (and can be written manually for .js files). ML signature files are much like .h files and I think for the same reason - to make compiler work easier.

Edit: as this is LLM thread - ML is Meta Language as in OCaml and SML.


? What’s a ML module signature?

I’m not sure what you’re imagining, but in this case I would not imagine you would generate js or write .d.ts files?

An LLM pass with a high level goal would generate a file list, then a series of .d.ts files from it.

Then (after perhaps a review of the type definition files, possibly also LLM assisted) a second pass taking the .d.ts files as input would generate a typescript file for every .d.ts file.

You would then discard the .d.ts files and just have a scaffolded .ts code base?

My point was doing the same trick with say, Java, seems like a harder problem to solve, but you could do the above right now with existing LLMs.


It's all a kludge, really. You shouldn't have to make up-front decisions where to put type signatures; you should be able to query for them and see them where and when you need them. We're still stuck in the local minimum of programming directly in the code serialization/storage format. It's a lot like using SQLite database by only ever viewing and editing it in a hex editor.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: