Scriptc by Vercel: TypeScript-to-Native compiler, no JavaScript engine in binary
Posted by maxloh 19 hours ago
Comments
Comment by pmkary 5 minutes ago
Comment by JoeDohn 10 hours ago
I can't think of any serious company or project that would use this thing.
P.S: I just checked the contributors list, I have the utmost respect to them (notably simonw), but clearly this code is claude'ish but it is not among the contributor which makes it even more suspect.
Comment by piterrro 10 hours ago
Comment by bilalq 4 hours ago
Comment by ljm 17 minutes ago
I've had trouble unpacking some of the copy it generates because its default tone of voice is fairly unintuitive. It's almost like it's designed to induce psychosis because it makes you feel like you've discovered something novel.
Comment by Fredkin 2 hours ago
But I can get around this by first having it write a prompt for itself discussing the problem followed by a rousing speech about never giving in and admitting defeat, but pressing on towards results regardless of how hard matching SOTA results is.
Comment by podviaznikov 1 hour ago
I checked my history and mapped how often it started to use "honest" and it's too much https://x.com/podviaznikov/status/2067231875068768447
Comment by vessenes 4 hours ago
Comment by yard2010 9 hours ago
Comment by andytratt 10 hours ago
Comment by themgt 9 hours ago
Comment by embedding-shape 8 hours ago
Comment by pacoWebConsult 3 hours ago
Comment by embedding-shape 1 hour ago
I don't think so, I literally think it's fun to see. Sharing projects regardless of how done, mature, reliable, correct or not they are, feels like a net positive for humanity.
Comment by simlevesque 1 hour ago
Comment by tom1337 7 hours ago
seems like simon only changed the readme and wasn't really involved in the project.
https://github.com/vercel-labs/scriptc/commits/main/?author=...
Comment by simonw 2 hours ago
I deleted two words from the README.
Comment by risyachka 10 hours ago
Edit: typo
Comment by pas 9 hours ago
Comment by kaoD 8 hours ago
Comment by trueno 6 hours ago
the only group i noddingly approve of being that programmatically bigoted are the clojure-or-i'm-setting-myself-on-fire guys. they've earned it
Comment by risyachka 7 hours ago
tests don't mean much if you are not an expert on the subject
Comment by andsoitis 2 hours ago
> tests don't mean much if you are not an expert on the subject
I think the bet is that the AI is an expert, given the vast literature and open source around compilers.
Comment by pjmlp 9 hours ago
Comment by reactordev 5 hours ago
Comment by pjmlp 5 hours ago
Not works in some of the cases and you have to implement fetch calls yourself, or some iframe boilerplate and JS glue, everything they expose in React is fully available in Angular, including field extensions, inline previews, sidebar extensions, the whole lot.
Comment by mattstir 4 hours ago
Comment by pjmlp 4 hours ago
Invalidating the remark "I can't think of any serious company or project that would use this thing."
Where's the example?
Comment by shimman 1 hour ago
Comment by pjmlp 1 hour ago
Comment by reactordev 3 hours ago
Comment by pjmlp 3 hours ago
React is designed with Next.js needs in mind nowadays.
Comment by kristiandupont 50 minutes ago
Comment by bubble_niter 10 hours ago
Comment by JoeDohn 9 hours ago
Comment by andytratt 10 hours ago
Comment by psychoslave 10 hours ago
And let’s imagine if LLM bots could do that as well, without any human caring to type the actual messages, just orchestrating the bot fleet. What trust could be we put in such a brainless peace of publications?
Comment by petesergeant 10 hours ago
Comment by Perz1val 9 hours ago
Comment by TeMPOraL 9 hours ago
Why do you care?
It's a stranger from the Internet. Same as with any other software you're using. In particular, same as with any OSS tool you're using.
Comment by andsoitis 2 hours ago
> Why do you care?
> It's a stranger from the Internet. Same as with any other software you're using. In particular, same as with any OSS tool you're using.
Don't you think that even if you don't know someone personally, you can calibrate your trust in their ability based on reputation, track record.
Comment by TeMPOraL 2 hours ago
Comment by petesergeant 46 minutes ago
rarely. How many of the libraries you pull from package managers do you actually know the authors of?
Comment by geraldwhen 8 hours ago
Going in to a project hoping to make a change and seeing no tests and spaghetti used to be soul crushing. These days I’d have Claude go refactor and add tests and make pull requests for me to look at to fix it.
Comment by bakugo 7 hours ago
Comment by andytratt 10 hours ago
Comment by acmnrs 15 hours ago
Comment by simonw 15 hours ago
Coding agents. They landed 918,000 lines of code in a single week: https://github.com/vercel-labs/scriptc/graphs/contributors?s...
Comment by homebrewer 11 hours ago
I vibeslopped thousands of pages of blueprints, nobody reviewed them, but another team of digital monkeys with the intellect of an ant have already built the bridge, and it seems to not have collapsed yet, so we're already directing traffic there.
I can't imagine actual engineers feeling anything but deepest contempt for this industry.
Comment by satvikpendem 11 hours ago
Comment by leansensei 10 hours ago
Comment by daishi55 6 hours ago
But it is indeed engineering, and that’s OK.
Comment by zaphirplane 4 hours ago
Comment by daishi55 2 hours ago
Do you have some other definition of engineering that excludes SWE?
Comment by satvikpendem 1 hour ago
Comment by igleria 7 hours ago
Comment by antonvs 11 hours ago
“Actual” engineering went through a phase where bridges and other structures did collapse due to structural flaws - it’s not like they magically figured out ahead of time how to avoid that.
Now, they can build structures that are some specified tolerance away from collapsing, but that’s only the case because the edges of what was possible were explored.
Comment by themgt 9 hours ago
Comment by badatnames 6 hours ago
Comment by acmnrs 15 hours ago
Comment by rixed 11 hours ago
Comment by mi_lk 11 hours ago
Comment by queenkjuul 8 hours ago
Comment by pizlonator 14 hours ago
- the architecture is idiotic.
- they have zero credible perf numbers.
I plan to benchmark it using generally accepted methods.
Porffor makes careful trade offs that make sense and is benchmarked in a way that I can believe.
(Source: I make dynamic languages fast for a living)
Comment by bbor 14 hours ago
Can you clarify what about the architecture is ‘idiotic’? Not trying to catch you or demand a defense, just looking for a vague description. I don’t even know how to start examining the architecture of something like this.
Comment by pizlonator 14 hours ago
- using quickjs at all in a thing that needs perf. Quickjs is hilariously slow. Midwits use it because it has “quick” in the name.
- using floats for numbers and deferring int optimizations for later. Inferring ints is like half the problem of fast JS.
- rejecting inadequately annotated or too dynamic code without a whole heck of a lot of self-reflection about how unlikely that is to work out.
The observation that languages that are even slightly dynamic need dynamic JIT opts is very old; folks figured that out in the 80s.
This project reeks of weapons grade AI psychosis
Comment by simonw 14 hours ago
Comment by pizlonator 14 hours ago
Note that “untyped dependency” means any code that says `any`.
Comment by simonw 14 hours ago
Being able to build small, fast binaries without writing them in C or Rust - if you're already fluent in TypeScript - seems like a valuable capability.
Comment by pizlonator 13 hours ago
CanadaHonk has gotten further than the rest of us. It’s surprising and impressive.
You’re only replying to the quickjs issue I raised, but it’s not the only issue. Their approach to numbers is broken. Their approach to measurement is broken. The quickjs thing raises another red flag: it suggests to me that they are using reference counting, not GC. That’s guaranteed to make them too slow to be useful. (If they weren’t using RC, then they’d have a hard time on the boundary to quickjs.)
As to the `any` issue, let me explain it in a way you’ll appreciate. I asked Claude how likely it is that TS code uses any, and it found:
- 79.5% of TS repos use any explicitly. So, about 4/5 chance that newly written dep-free TS code will use it.
- the explicit any type is about as common as Boolean and void.
- a third of inferred types are any. That’s huge.
So, if you don’t believe me, then at least believe Claude: any is a super common type, so they will be falling off into quickjs a lot.
Oh, and in case it isn’t clear, quickjs-ng is no better than quickjs. They’re the same thing for the purpose of perf
Comment by simonw 13 hours ago
If I was using this project for something I'd expect to write custom TypeScript for it.
The floats rather than integers thing does look bad though. I tried compiling their fibonacci example to C (--backend c) and got this:
static double sc_f_fib(double sc_l_n_0) { /* /private/tmp/fib.ts:1 */
double sc_t0 = sc_l_n_0;
double sc_t1 = 2.0;
bool sc_t2 = sc_t0 < sc_t1;
double sc_t3;
if (sc_t2) {
double sc_t4 = sc_l_n_0;
sc_t3 = sc_t4;
} else {
double sc_t5 = sc_l_n_0;
double sc_t6 = 1.0;
double sc_t7 = sc_t5 - sc_t6;
double sc_t8 = sc_f_fib(sc_t7);
double sc_t9 = sc_l_n_0;
double sc_t10 = 2.0;
double sc_t11 = sc_t9 - sc_t10;
double sc_t12 = sc_f_fib(sc_t11);
double sc_t13 = sc_t8 + sc_t12;
sc_t3 = sc_t13;
}
return sc_t3; /* /private/tmp/fib.ts:2 */
}Comment by slopinthebag 13 hours ago
Comment by timcobb 11 hours ago
Comment by queenkjuul 8 hours ago
I've just been teaching myself Go, also a single binary but without the overhead. But in Go i miss the expressiveness of the TS type system sometimes.
Comment by skeledrew 13 hours ago
I had to do a triple take on this.
Comment by sroussey 12 hours ago
Comment by slopinthebag 13 hours ago
Comment by vips7L 13 hours ago
Comment by torginus 9 hours ago
Comment by piker 8 hours ago
This phrase I think highlights the fundamental issue for a lot of folks that would otherwise consider adopting a project like this written by humans.
Comment by anematode 14 hours ago
This part made me laugh out loud
Comment by Altern4tiveAcc 6 hours ago
For a project like this, isn't it worth introducing a TS type for Ints? Since they are trying to leverage TypeScript anyway...
Comment by drunkenmagician 10 hours ago
Comment by Tadpole9181 14 hours ago
Comment by jeswin 6 hours ago
1. TS only has a "number" type. But what type of number is it? This is doable safely via keywords (or known markers), or sometimes via analysis, but I couldn't find it in the README.
2. A compiler that works only on macOS?
Comment by h1fra 2 hours ago
Comment by piterrro 8 hours ago
Heads up, in 12 months from now, 90% of open source projects will be vibecoded, without actual users - only looking "interesting" (if not already?).
Its easy to vibe code a full blown compiler these days, the question is: will it be maintained? A catchy title is not enough to get sticky users, long term maintenance, community around the project is (or at least used to be).
Having said that, the only viable reason for these kind of projects I see is getting attention for a moment, boosting reach of Vercel logo across the web and then disappearing (or stop development).
If Vercel would think seriously about this project: they would show skin in the game - for example implement it as their own experimental runtime.
Comment by sheept 14 hours ago
But if you're starting from scratch and know you won't be using any npm packages, you might as well use AssemblyScript.[2]
[0]: Publishing packages in TypeScript is explicitly discouraged by Node[1]. TypeScript isn't backwards compatible even in minor releases, and its compiler settings aren't portable for packages.
[1]: https://github.com/nodejs/node/blob/main/doc/api/typescript....
Comment by simonw 14 hours ago
Looks like Scriptc's solution to that problem is that it can optionally bundle a 620KB quickjs-ng JavaScript engine if you have dependencies that need to be executed that way.
Comment by skybrian 9 hours ago
Comment by bbor 14 hours ago
Comment by sroussey 13 hours ago
I’ve seen people want to publish TS libs but there are issues: TS will type check the libs as well as your project. You can’t tell it to stop just because it’s going inside node modules. And the app may have tighter settings than the library and you will get type errors if your configs were setup differently. It would be interesting to standardize publishing real typescript libs but I haven’t seen it. Maybe deno tried? I haven’t looked.
Comment by skybrian 9 hours ago
Deno doesn’t type-check external dependencies unless you ask.
Comment by sroussey 1 hour ago
Comment by skybrian 58 minutes ago
There's a way to download JSR packages and use them with npm too. I don't know what it does in that case.
Comment by daveidol 8 hours ago
Comment by gajus 3 hours ago
Related problem: Using AI to write compilers that optimize runtime code. I did this for Zod.
https://github.com/gajus/zod-compiler
Zod schemas, compiled at build time into raw boolean chains. 2-74x faster. No code changes. The plugin swaps Zod with compiled parse.
I wrote almost none of the optimizations. Claude did, in a loop, over 100+ iterations.
It works because the compiled version can be diffed against real Zod. Correctness isn't a judgment call. Same as scriptc.
This applies to every program with a reference implementation and a benchmark. Compilers, serializers, formatters, query planners, etc.
Excited for faster Internet.
Comment by jjice 3 hours ago
As we see more and more heavily AI built open source projects, I wonder how the perception of them becomes. There's a huge spectrum of AI developed code, the same way there is with human code, except a human at least had to think a bit about what they wrote. If you generate code with an LLM to the standards that you'd write it yourself (which is the only way I'd consider for anything important) and you review every bit that's written, I think that's wonderful. Even if you don't, I don't think that's bad, but I will have more friction to adopt that project as there's likely lower quality code and less personal investment into it.
I find that a lot of online discussion has gone either "AI generate everything" or "never AI generate anything", with the middle ground being mostly silent. That's probably just because it's the internet and most people I talk to IRL have a reasonable middle ground take. I'm all for it if it accelerates a person making thoughtful decisions. If not, more power to you, but I'm less inclined to use the software out of fear of using something of poor quality or something that'll be abandonware.
Comment by weinzierl 10 hours ago
Having followed the story for this in Java over the decades I'm skeptical about the practicality. GCJ existed in the 90s and the technology was good, but there was no ecosystem support.
After many small steps between GraalVM Native finally tackled the problem more holistically and the ecosystem followed. All the major libraries and frameworks put effort into being GraalVM compatible.
And, still it's a major pain to make even simple existing applications run flawlessly natively.
I'm glad something like scriptc exists but I'm afraid until this is of practical use it will be s long thorny way.
Comment by pjmlp 9 hours ago
Anyone serious would be paying for Excelsior JET, BEA JRockit, or the myriad of other commercial JDKs wihth AOT tooling.
In fact most likely one reasons why Excelsior is not more, is that now GraalVM and OpenJ9 exist as free bear.
PTC and Aicas still have it good, because few care about their embedded and real time customers.
Comment by elendilm 10 hours ago
We are increasingly using a subset of typescript in our backend so as to be amenable to a tool, in the long run, which can convert the ts subset to rust source code.
This project will enable an alternative of that vision earlier - except of course without the parallelism.
Also I am curious as to whether this will compile to a static lib which can be linked to an existing cpp app to be run on android/ios targets. In theory it should be able to. The docs mention ffi, but I didn't dig deep.
Comment by aluxian 6 hours ago
Comment by luciana1u 20 minutes ago
Comment by notsylver 10 hours ago
Comment by satvikpendem 15 hours ago
Comment by chilipepperhott 14 hours ago
Comment by simonw 14 hours ago
Comment by localhoster 12 hours ago
Comment by MrDrMcCoy 10 hours ago
Also, does "Linux and Windows binaries build by cross-compilation" mean that you can't run it on non-MacOS? If so, that's pretty lame...
Comment by bLorax 2 hours ago
I might be wrong here. What's the use case?
Comment by mapcars 2 hours ago
Comment by davexunit 2 hours ago
Comment by aabhay 15 hours ago
Comment by SkiFire13 11 hours ago
Comment by iansmith_hn 8 hours ago
Comment by pdantix 12 hours ago
Comment by Twirrim 12 hours ago
Now people can have these ideas, slop together an awful solution that works at a surface level, maybe, but will never really go places because the foundation is slopped with no party involved actually capable of thinking thing through. But hey we launched something so let's make lots of noise! Oh look, a banana ... Sorry, what were we talking about?
There's an engineer on a team at work that I routinely engage with who slops together stuff so fast his team is basically exhausted all the time. They're stuck picking up a whole stream of pieces of crap because the engineer is incapable of actually doing the hard work of getting things to production because there's more "ohh, shiny" stuff they can spend tokens on, and their leadership aren't stepping in because it all looks terribly productive (it really isn't)
Comment by anta40 8 hours ago
Comment by queenkjuul 7 hours ago
This is more equivalent to Go, with a single static native binary that does not include the whole Node runtime
Comment by ianberdin 7 hours ago
Take Bun, for example. Nobody is actually running it in production as a runtime. Why? Memory leaks and a whole bunch of other issues. I've personally tried it multiple times, and something always breaks. Come on, it's just not that simple.
Sure, you can build something that has similar interfaces and even works to some degree. But making a production-ready solution is a completely different level of complexity. There's that well-known chart where the first 90% of implementation happens almost instantly, and the remaining 10% takes forever to polish out all the rough edges.
On one hand, I really like the idea, and I've always wondered why TypeScript doesn't compile to native code. On the other hand, I'm quite skeptical that Vercel can actually pull this off. I'd be happy to be proven wrong, but I have very little faith in it.
Either way, good luck to them, but honestly, even if they succeed, I probably won't use it. Knowing their track record with vendor lock-in and Next.js, where they do everything possible to push you onto Vercel Cloud — no thanks.
Comment by mdavid626 6 hours ago
Comment by xiaodai 14 hours ago
Comment by panzi 14 hours ago
Comment by lpribis 7 hours ago
Comment by queenkjuul 10 hours ago
Comment by CarpeNecopinus 10 hours ago
Comment by hnsmomdpvp 6 hours ago
Comment by truth_seeker 10 hours ago
I have forked Fabrice Bellards QuickJS and extended it heavily to adopt anti-npm/node stance.
all of the essential standard lib and top npm packages will be built natively in C17 with every build and minor release focred through CPU, IO and memory profiling.
Currently it supports MacOS and Linux, FreeBSD and Windows in future.
https://github.com/corporatepiyush/dynascript
API reference : https://github.com/corporatepiyush/dynascript/blob/master/do...
Comment by casper14 15 hours ago
Comment by techpression 10 hours ago
Comment by relug 9 hours ago
Comment by khalic 7 hours ago
Comment by simonw 2 hours ago
Otherwise it looks like it compiles to LLVM.
Comment by zuzululu 11 hours ago
whats the use case for this , make it hard to reverse engineer my node projects?
Comment by repeekad 10 hours ago
Comment by lpribis 7 hours ago
Comment by jonasdoesthings 10 hours ago
other projects like claude code use something like `bun build --compile`[^1] for that, which instead of producing a small native binary just bundle the JS runtime into the executable.
Comment by isaachinman 10 hours ago
Comment by jorisw 10 hours ago
Comment by nkmnz 8 hours ago
Comment by queenkjuul 7 hours ago
Deno is building a less-wasteful Electron style framework for native desktop apps