ECMAScript excitement ๐
๐จ๐จ๐จ IT'S ABOUT TIME! ๐จ๐จ๐จ
Congrats to @manishearth.bsky.social on shipping the Temporal API in Chrome 144 stable today ๐
developer.chrome.com/blog/new-in-...
Temporal is the replacement for the Date API.
Posts by Brian Terlson
Inferprocess communication. Can basically talk to it like vscode does for the extension, or the reverse if you want to have e.g. an emitter that calls into some other language.
You really want to evaluate TypeSpec rather than parse it since a lot goes in to building the type graph from the raw syntax. Talking to typespec over ipc is probably a better option depending on what you're trying to do?
We use backticks for escaping keywords like swift does: typespec.io/playground/?... Template literals use 3+ quotes (also like swift I think?)
Yeah I agree. Just imagining the parser work ๐
How sad would you be if there were some sort of sigil for custom "keywords" like :record Foo { }
Oh const fields! Yes would be nice.
Yes very embarrassing omission ๐ญ
You can use jsdoc style comments instead of @doc if you like (tho same restrictions). But if you mean return value of an operation, you might use jsdoc returns as usual, else @returnsDoc. I believe that metadata is attached to the operation.
We could probably relax the grammar for decorators to allow reserved words, I thought we did that already.
I also want custom keywords! It was in some of my original sketches. I think actually important for swiss army knife DSL langs.
This is so cool! TSP was basically born of a distaste for reading another massive json file, it's kind of a niche ๐
If you have typespec thoughts I'd love to hear them, feel free to reach out directly if you like. Also I wonder if you looked at the new emitter framework?
This type isn't super popular but it also isn't widely available. I've seen a lot of cases where 32bits isn't large enough but approx 53 bits is. In such cases today people generally use int64 and pray no precision loss happens in JS. Something like `z.safeint()` might make more people reach for it.
Oh is that new Zod 4 behavior? That's not bad. Right now it's `z.number().int().safe()` which isn't super friendly.
The name is somewhat confusing, but doubleint is an integer which fits in the safe range of a double.
Nice to see the new number types! Consider adding `doubleint` (OpenAPI Format) or `safeint` (TypeSpec type)? Especially with the JSON Schema conversion throwing by default for int64, this type is super convenient when 32 bits isn't enough but 53 bits is.
Sample of a TypeSpec document and the output as JSON
Just released v1 of my @typespec.bsky.social JSON samples emitter. ๐
A handy tool to create samples based on the decorators in your #TypeSpec code.
Please give it a try and let me know if you have any feedback or feature requests! ๐
www.npmjs.com/package/@wic...
I'm confident the rewrite would be much less work if the base library (Alloy) had Go language components, but unfortunately we do not yet. If you are interested you can find the base framework here: github.com/alloy-framew...
It's a complete rewrite unfortunately. You can see what it looks like here: github.com/bterlson/tsp...
No plans that I'm aware of.
All I'll say is that we have a lot of documentation to update so nobody should be surprised if something falls through the cracks...
! Caution
@deprecated deprecation documentation is itself deprecated and will be removed prior to 1.0-preview. Which is coming up!
Hoping we can keep it as an easter egg, though ๐
Thanks for the kind words ๐
Regarding direct code generators, we're working on them! Should have both client and server generators in a few languages soon for you to try (or you could even try now depending on your tolerance for roughness, if so let me know).
For fun I thought to ask chatgpt for tips on night roofing with no experience, expecting "don't". Even after telling it my ladder is rickety, I have no safety equipment or lights, it's raining, I'm drunk and on meds that make me dizzy, it still gave me tips. It did at least suggest I reconsider tho.
Also recipes just outright lie about how long things take ("cook onions until caramelized, about 5 minutes") or are wildly unrealistic about tasks which can be done in parallel if you only have two hands.
Just spent 3.5 hours on a 1.5 hour recipe, here. Everyone cooks at their own pace, are faster or (more often) slower at certain tasks. I think recipe websites are motivated to make them sound easy so they tend to under-account time.
Sir how do we know you aren't playing steel guitar or the marimba?
Wow way to go!
Maybe I'm wrong but it often feels correct to tie the lifetime of state to the instantiation of the module? I do this a lot even for non-tiny things. Things like weakmaps tracking metadata about seen types feel correct up there. Very different from days-of-yore `window.SOME_STATE` I guess.
Etsy is just temu with more steps. I have to believe it's working for them otherwise they'd fix it, which is sad.