Brian Terlson's Avatar

Brian Terlson

@b.trl.sn

Working at Microsoft on TypeSpec, JavaScript, TypeScript, Azure, etc. when I find time between wrangling two tiny children.

1,634
Followers
528
Following
56
Posts
29.04.2023
Joined
Posts Following

Latest posts by Brian Terlson @b.trl.sn

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.

13.01.2026 20:27 ๐Ÿ‘ 102 ๐Ÿ” 25 ๐Ÿ’ฌ 3 ๐Ÿ“Œ 4

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.

04.12.2025 18:59 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

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?

04.12.2025 18:56 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
typespec.io

We use backticks for escaping keywords like swift does: typespec.io/playground/?... Template literals use 3+ quotes (also like swift I think?)

09.10.2025 03:29 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Yeah I agree. Just imagining the parser work ๐Ÿ˜‚

09.10.2025 03:22 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

How sad would you be if there were some sort of sigil for custom "keywords" like :record Foo { }

09.10.2025 03:16 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

Oh const fields! Yes would be nice.

09.10.2025 03:13 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Yes very embarrassing omission ๐Ÿ˜ญ

09.10.2025 03:06 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
typespec.io

There is! typespec.io/playground/?...

09.10.2025 02:59 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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.

09.10.2025 02:54 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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.

09.10.2025 02:51 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
typelex โ€“ An experimental TypeSpec syntax for Lexicon An experimental TypeSpec syntax for AT Protocol Lexicons. Write Lexicons in a more readable syntax using TypeSpec.

may i present to you, my weekend project

06.10.2025 01:41 ๐Ÿ‘ 355 ๐Ÿ” 37 ๐Ÿ’ฌ 12 ๐Ÿ“Œ 2

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?

09.10.2025 02:31 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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.

12.04.2025 23:55 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

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.

12.04.2025 23:52 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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.

10.04.2025 23:00 ๐Ÿ‘ 5 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Sample of a TypeSpec document and the output as JSON

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...

06.04.2025 07:57 ๐Ÿ‘ 3 ๐Ÿ” 1 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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...

24.03.2025 17:21 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
tsp-mcp/packages/typespec-ts-data-server/src/index.tsx at main ยท bterlson/tsp-mcp Contribute to bterlson/tsp-mcp development by creating an account on GitHub.

It's a complete rewrite unfortunately. You can see what it looks like here: github.com/bterlson/tsp...

24.03.2025 16:48 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

No plans that I'm aware of.

08.02.2025 01:13 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

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...

07.02.2025 23:18 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

! 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 ๐Ÿ˜‚

07.02.2025 23:05 ๐Ÿ‘ 11 ๐Ÿ” 1 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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).

30.01.2025 22:40 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

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.

16.01.2025 03:55 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

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.

06.01.2025 06:29 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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.

06.01.2025 06:25 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Sir how do we know you aren't playing steel guitar or the marimba?

12.12.2024 23:43 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Wow way to go!

12.12.2024 22:18 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

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.

10.12.2024 19:43 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Etsy is just temu with more steps. I have to believe it's working for them otherwise they'd fix it, which is sad.

26.11.2024 18:37 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0