Some of the language changes when TypeScript types become real (with ahead-of-time compilation)

Oct 9, 2026 · 6:18 AM UTC

74
41
944
208,665
Replying to @bunjavascript
2
1
100
11,900
Replying to @bunjavascript
2
1
76
9,556
Replying to @bunjavascript
1
1
66
8,057
RepliesRelevant
Your burger opinions are valid. Mostly. Prove it in a short survey. $5 reward for eligible participants who complete it.
1
0
5
123,305
Replying to @bunjavascript
@bunjavascript @jarredsumner why a runtime behavior change over a compile time error when assertions can't be verified? I mean it's explicit but imo Number(raw) is more explicit and an easy change. Also what does it do to structural types?
2
0
66
4,829
Replying to @bunjavascript
@bunjavascript this feel worse than making a new language because now you need to know which runtime behavior it is. LLMs will get tripped up by this.
0
0
9
683
Replying to @bunjavascript
@bunjavascript how do you check `val as ComplextGenericTypeVar` ?
0
0
4
872
Replying to @bunjavascript
@bunjavascript this is remarkably close to Swift
0
0
2
394
Replying to @bunjavascript
@bunjavascriptespect.

That’s all cool and really improves the logic, but then call it BunScript and use the .bs extension💁‍♂️

By changing how TypeScript works - almost everywhere - you are taking on a lot and only increasing development chaos.

If you want to fix the TS, go through its committee.
4
1
204
4,360
Replying to @bunjavascript
@bunjavascript Rename to BunScript because it isn’t isomorphic.
0
0
1
308
Replying to @bunjavascript
@bunjavascript I am all for types, but "`as` converts" is a mistake.
1
0
84
4,846
The right conversation starts with the right rep. Let Cal make the intro.
26
23
156
249,264
Replying to @bunjavascript
@bunjavascript as a standalone idea, this is fine, but this isn't TypeScript - you've invented a language that looks identical but works entirely differently
0
0
49
2,697
Replying to @bunjavascript
@bunjavascript This is all pretty cool, but I think using `as` for converting types is a mistake, it should just be used for type assertions, like assignments do in this implementation
0
0
16
2,455
Replying to @bunjavascript
@bunjavascript Mostly agree, but not with "as converts".
`as` should assert a value's type, not change it.
Coercing invalid values can hide bad input.
Type mismatches should throw; conversions should be explicit, e.g. `Number()`. Thoughts, @jarredsumner?
1
0
14
1,626
Replying to @bunjavascript
@bunjavascript looks pretty cool but are we still calling it TypeScript or is it BunScript now? 🤔
0
0
9
807
Replying to @bunjavascript
@bunjavascript Impressive, but at this point it's just not TypeScript anymore and this will likely cause chaos and incompatibility issues. Having the same code behave differently on the backend Vs the browser feels like a really big problem to me.
0
0
5
356
Replying to @bunjavascript
@bunjavascript Seems so obvious now, the types are already there, fuck yes they should be real.
0
0
5
1,936
Replying to @bunjavascript
@bunjavascript time to leave node
0
0
4
1,811
The next generation of AI won't be won by model selection alone. It will be won by the teams that can build, manage, and scale proprietary multimodal datasets efficiently.
2
13
76
290,605
Replying to @bunjavascript
@bunjavascript So, bun is turning TypeScript into a real language. What a world we live in.
0
0
3
762
Replying to @bunjavascript
@bunjavascript Call it TypedScript
1
0
4
472
Replying to @bunjavascript
@bunjavascript what breaks when you turn it on
0
0
3
1,175
Replying to @bunjavascript
@bunjavascript Please enable it for SQL as well!

Inspiration: github.com/ilbertt/bun-sq…
1
0
4
1,835
Replying to @bunjavascript
@bunjavascript I don't think it's necessary to alter the TypeScript semantics.. I believe it's better to use the types to guide the AoT.
0
0
2
461
Replying to @bunjavascript
@bunjavascript all the checks are great, but as should never convert, it should check
0
0
2
454
Replying to @bunjavascript
@bunjavascript Oh come guys, this isn't that hard. You could still show the source of a function e.g.

It just blows up your binary.
0
0
3
469
Researchers are conducting a study to understand how to prevent suicide among Black LGBTQ young people. If you qualify, you will be invited to take a 45-minute online survey every 3 months over 18 months. Eligible participants receive $30 gift card for each survey completed.
37
65
1,138
4,544,625
Replying to @bunjavascript
@bunjavascript just call it BunScript with .bs instead of ts anymore
0
0
1
251
Replying to @bunjavascript
@bunjavascript Like the idea behind this in principle, but co-opting TypeScript for this feels wrong when it is entirely new behavior, and I fear it will cause confusion/fragmentation in the ecosystem. Treat it as your own, new language: BunScript, or something.
0
0
1
455
Replying to @bunjavascript
@bunjavascript This isn't TypeScript anymore, call it something else
0
0
1
404
Replying to @bunjavascript
@bunjavascript So it’s not TS anymore then…
0
0
1
224
Replying to @bunjavascript
@bunjavascript How does it work with discriminated unions, does it throw if a runtime value isn’t one of them? & does it allow branded types?
0
0
1
775
Replying to @bunjavascript
@bunjavascript @cirospaciari Awesome! Next... zod like validator built-in 😎
0
0
1
744
Replying to @bunjavascript
@bunjavascript failing ahead-of-the-time is good, but changing javascript specification is questionable
0
0
1
665
Replying to @bunjavascript
@bunjavascript would be nice a few references on this kind of post
0
0
0
12
Replying to @bunjavascript
@bunjavascript The `as any` case is the migration edge: runtime checks catch bad data, but existing TS can start throwing where it used to run. Is there an opt-out?
0
0
0
4
Replying to @bunjavascript
@bunjavascript I think it'll be better to have "converts" be called "casts"? It's a more familiar term.
0
0
0
23
Replying to @bunjavascript
@bunjavascript `as` should never convert, there are existing functions to parse numbers.

Which ones are built time vs runtime errors?

TypeScript is primarily structurally typed so these nominal errors go against that.
0
0
0
50
Replying to @bunjavascript
@bunjavascript It feels like rust here 😂
0
0
0
10