Advertisement ยท 728 ร— 90

Posts by Brian Terlson

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.

2 months ago 103 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.

4 months ago 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?

4 months ago 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?)

6 months ago 1 0 0 0

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

6 months ago 1 0 0 0

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

6 months ago 0 0 2 0

Oh const fields! Yes would be nice.

6 months ago 1 0 0 0
Advertisement

Yes very embarrassing omission ๐Ÿ˜ญ

6 months ago 1 0 0 0
typespec.io

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

6 months ago 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.

6 months ago 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.

6 months ago 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

6 months ago 353 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?

6 months ago 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.

11 months ago 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.

11 months ago 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.

11 months ago 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...

1 year ago 3 1 1 0
Advertisement

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

1 year ago 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...

1 year ago 1 0 1 0

No plans that I'm aware of.

1 year ago 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...

1 year ago 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 ๐Ÿ˜‚

1 year ago 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).

1 year ago 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.

1 year ago 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.

1 year ago 0 0 1 0
Advertisement

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.

1 year ago 1 0 1 0

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

1 year ago 2 0 1 0

Wow way to go!

1 year ago 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.

1 year ago 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.

1 year ago 1 0 1 0