Sign in

Oliver Medhurst

@honk.foo
2.7K followers 587 following 302 posts

compiling javascript: porffor.dev + browser security

PostsRepliesMedia
Oliver Medhurst @honk.foo · 26/09/2026
oh! this is for SSR yeah
110
Oliver Medhurst @honk.foo · 26/09/2026
with bugs it can :)
120
Oliver Medhurst @honk.foo · 25/09/2026
this also introduces incremental compilation which can speedup builds by up to 30x versus last release!
warm compilation
react  17.45s → 0.56s (31x)
svelte  7.23s → 0.29s (25x)
preact  5.22s → 0.19s (27x)
solid   9.90s → 0.33s (30x)
0170
Oliver Medhurst @honk.foo · 25/09/2026
the latest version of Porffor features ESM support! it not only removes needing a bundler beforehand but also makes compilation much faster as we can split C across modules
compilation time, selfhosted
react  17.31s → 4.16s (4.2x)
svelte  7.30s → 2.21s (3.3x)
preact  5.17s → 1.63s (3.2x)
solid   9.95s → 2.80s (3.6x)
4574
Oliver Medhurst @honk.foo · 20/09/2026
6.x 😅
000
Oliver Medhurst @honk.foo · 18/09/2026
to be transparent: this *is* real TSC fully ahead-of-time! it isn't good (buggy, not as fast, requires minor changes) but I hope gets you excited for the future :)
1260
Oliver Medhurst @honk.foo · 18/09/2026
for fun: TSC compiled to native with Porffor! 25MB, starts in <5ms
honk@gosling tsc % bat -p demo.ts
type Config = { port: number };
const cfg: Config = { port: "8080" };
honk@gosling tsc % tsc --noEmit demo.ts
demo.ts:2:23 - error TS2322: Type 'string' is not assignable to type 'number'.

2 const cfg: Config = { port: "8080" };
                        ~~~~

  demo.ts:1:17
    1 type Config = { port: number };
                      ~~~~
    The expected type comes from property 'port' which is declared here on type 'Config'


Found 1 error in demo.ts:2

honk@gosling tsc % du -h out/release/tsc
 25M    out/release/tsc
honk@gosling tsc % ./out/release/tsc --noEmit demo.ts
demo.ts:2:23 - error TS2322: Type 'string' is not assignable to type 'number'.

2 const cfg: Config = { port: "8080" };
                        ~~~~

  demo.ts:1:17
    1 type Config = { port: number };
                      ~~~~
    The expected type comes from property 'port' which is declared here on type 'Config'


Found 1 error in demo.ts:2
7946
Oliver Medhurst @honk.foo · 25/08/2026
forgot to post about this before 😅 busy times :)
0120
Oliver Medhurst @honk.foo · 25/08/2026
Porffor alpha is out! It represents a new phase of the project where real-world dependencies are beginning to work and Node compatibility is the main bottleneck. To be clear, it still likely won't work with your app yet, but it is much closer than before. Recap here: honk.foo/porffor-alpha/
honk.foo
Porffor goes alpha August 11th
A self-hosting and rewritten Porffor launches in SF next month!
37320
Reposted by Oliver Medhurst
Alexander Lichter @thealexlichter.com · 05/08/2026
And we are live now with @honk.foo youtube.com/live/L8Edgas...
youtube.com
e18e & friends E004 - Oliver Medhurst
What if you could compile JavaScript to Native but ahead of time? W...
2226
Reposted by Oliver Medhurst
Willow (GHOST) @willow.sh · 31/07/2026
Alright, I didn't so much learn @gleam.run as I did play around with Porffor (JS to native code compiler by @honk.foo) 🧵
2292
Reposted by Oliver Medhurst
Alexander Lichter @thealexlichter.com · 28/07/2026
Summer break is over: The @e18e.dev & friends show is coming back next week 🎉 And we got nobody else than the one and only @honk.foo talking about Porforr and how a future for natively compiled JavaScript could look like! Swing by at 7pm CEST / 1pm EDT on August 4th 👌 youtube.com/live/L8Edgas...
youtube.com
e18e & friends E004 - Oliver Medhurst
What if you could compile JavaScript to Native but ahead of time? W...
14812
Oliver Medhurst @honk.foo · 27/07/2026
Porffor officially goes alpha on August 11th with an in-person in San Francisco! It brings self-hosting and a complete rewrite, plus more: honk.foo/porffor-alpha/
honk.foo
Porffor goes alpha August 11th
A self-hosting and rewritten Porffor launches in SF next month!
37614
Oliver Medhurst @honk.foo · 27/07/2026
whoops completely forgot to post this lol
010
Oliver Medhurst @honk.foo · 19/07/2026
enjoy tangled.org/honk.foo/por...
tangled.org
honk.foo/porffor
[READ-ONLY] Mirror of https://github.com/CanadaHonk/porffor. An ahead-of-time JavaScript compiler
0451
Oliver Medhurst @honk.foo · 19/07/2026
saw that but didn't know it was daniel, sweet! ty
0110
Oliver Medhurst @honk.foo · 19/07/2026
what's the best way to mirror a gh repo to tangled? 👀
2180
Oliver Medhurst @honk.foo · 15/07/2026
now state of the art btw because why not :)
A table:

method	median error	mean error	words ≤300ms off ↓
autolrc + line anchors	32 ms	70 ms	97.2%
autolrc	34 ms	190 ms	95.8%
dafx (2025)	41 ms	216 ms	95.2%
kglw (2025)	—	200 ms	94%
gupta et al. (2020)	50 ms	220 ms	94%
huang et al. (2022)	—	230 ms	94%
hx-ih (2023)	43 ms	160 ms	93%
mstre-net (2021)	—	310 ms	93%
spotify (2023)	—	150 ms	92%
vaglio et al. (2020)	—	370 ms	92%
hx-d (2023)	43 ms	420 ms	89%
stoller et al. (2019)	—	820 ms	85%
0150
Oliver Medhurst @honk.foo · 08/07/2026
ty! me neither, somewhat surprised. mostly some ml magic
040
Oliver Medhurst @honk.foo · 08/07/2026
uses ~1mb memory btw ;)
"autolrc.honk.foo 1 - 1.14 MiB"
080
Oliver Medhurst @honk.foo · 08/07/2026
also a fun side project I've been hacking on and off for about half a year: autolrc.honk.foo totally didn't just make a landing site to test porffor rewrite in "prod". nope, nuh uh, no way
5291
Oliver Medhurst @honk.foo · 08/07/2026
ty!!
030
Oliver Medhurst @honk.foo · 08/07/2026
thanks!
000
Oliver Medhurst @honk.foo · 08/07/2026
Porffor is now self-hosted, meaning it compiles itself with itself! This is made possible by Porffor's new rewrite, reducing its lines of code by >50% and making C output up to 5x more efficient! Here you can see the stats before and after the rewrite for Porffor itself:
Porffor selfhost rewrite graphs, before vs after.

bundle lines 40.4K→24.7K (1.6x smaller)
bundle size 2.4MB→2.0MB (1.2x smaller)

C lines 1.6M→289.0K (5.5x smaller)
C size 70.4MB→12.3MB (5.7x smaller)

debug compile time 5.0s→1.2s (4.1x faster)
release compile time 143.2s→37.1s (3.9x faster)

debug binary size 52.4MB→13.6MB (3.8x smaller)
release binary size 14.1MB→4.6MB (3.1x smaller).
48910
Oliver Medhurst @honk.foo · 08/07/2026
even smaller btw ;)
  bundle    24.57K lines (+0.00%)   2.04MB  (+0.01%)
  c         288.52K lines (+0.01%)  12.29MB (+0.02%)
  binary    4.56MB (+0.00%)
010
Oliver Medhurst @honk.foo · 08/07/2026
javascript is cool
1361
Oliver Medhurst @honk.foo · 08/07/2026
before lol
110
Oliver Medhurst @honk.foo · 07/07/2026
size unmaxxing
  selfhosted now vs 2.1h ago
  bundle    24.49K lines (-5.18%)    2.00MB  (-9.22%)
  c         387.65K lines (-24.33%)  15.09MB (-40.88%)
  binary    4.86MB (-48.60%)
1291
Oliver Medhurst @honk.foo · 03/07/2026
I will be in SF ~mid August, DM if you want to hangout and/or talk about how Porffor could help your company in the future :)
030
Oliver Medhurst @honk.foo · 29/06/2026
new domain 👀 goose.icu -> honk.foo
4300
Oliver Medhurst @honk.foo · 28/06/2026
don't worry only 3 more
000
Oliver Medhurst @honk.foo · 28/06/2026
doubling my domain count in one day 😭
1120
Oliver Medhurst @honk.foo · 27/06/2026
generators and await both use the same suspension mechanism so depending on how an engine is setup it can be quite tricky. I implemented generators with async generator support in mind so wasn't much of an issue for me in the end
010
Oliver Medhurst @honk.foo · 27/06/2026
generators
> function* foo() { console.log('pre yield 1'); yield 1; console.log('pre yield 2'); yield 2; console.log('end'); }
> let x = foo()
> x.next()
pre yield 1
{
  value: 1,
  done: false
}
> x.next()
pre yield 2
{
  value: 2,
  done: false
}
> x.next()
end
{
  value: undefined,
  done: true
}
1222
Oliver Medhurst @honk.foo · 25/06/2026
oops (#vagueposting)
Description
compiling javascript: https://porffor.dev + occasional browser security
0130
Oliver Medhurst @honk.foo · 21/06/2026
was talking to @danielroe.dev about this a few days ago 👀
1160
Oliver Medhurst @honk.foo · 16/06/2026
but nan boxing wins for in-memory stuff! hence hybrid ;)

Scenario	Nanbox	Struct	Winner
Sequential write numbers	0.031199 s	0.061291 s	Nanbox, 1.96x faster
Sequential read numbers	0.125784 s	0.148851 s	Nanbox, 1.18x faster
Sequential read + write numbers	0.030615 s	0.061146 s	Nanbox, 2.00x faster
Sequential write mixed values	0.073787 s	0.108784 s	Nanbox, 1.47x faster
Sequential read mixed values	0.151721 s	0.156975 s	Nanbox, 1.03x faster
Type scan mixed values	0.039022 s	0.057213 s	Nanbox, 1.47x faster
Copy array	0.045452 s	0.093518 s	Nanbox, 2.06x faster
Random read numbers	0.774604 s	0.908102 s	Nanbox, 1.17x faster
Random read mixed values	0.934132 s	1.299783 s	Nanbox, 1.39x faster
Random read + write numbers	0.811805 s	0.914708 s	Nanbox, 1.13x faster
020
Oliver Medhurst @honk.foo · 16/06/2026
Short name	Mean time	Delta
NaN box	779.8 ms	1.00x
struct	126.0 ms	6.19x faster
130
Oliver Medhurst @honk.foo · 16/06/2026
will include in the rewrite blog post ;)
020
Oliver Medhurst @honk.foo · 16/06/2026
took an interesting route for data structures for rewrite and looks like it is good. hybrid C struct and nanboxing because just nanboxing is far too slow :(
290
Oliver Medhurst @honk.foo · 16/06/2026
London friends! I will be around later this week if you want to hangout :) secret demos if I finish my rewrite in time?
5170
Reposted by Oliver Medhurst
npmx @npmx.dev · 12/06/2026
We'll be in London next week! Come hang out with us 🤍
guild.host
npmx london #2 | Guild
Jun 19th 6:00PM: Come join us at our first proper npmx meetup in London! A huge thanks to AG Grid who are hosting us and providing food Schedule: 18:00 - 19:00 -> Socialising & Food 19:00 - 19:15 -...
2337
Oliver Medhurst @honk.foo · 13/06/2026
rewriting almost the entire compiler
040
Oliver Medhurst @honk.foo · 12/06/2026
doing huge architecture changes and scope reduction is both so depressing and so exciting
1160
Oliver Medhurst @honk.foo · 12/06/2026
agree, most likely will go for that
040
Oliver Medhurst @honk.foo · 12/06/2026
good question. changing from test262%/automated to manual to reflect changes better and be more stable. ideal would be 0.1.0 but already on 0.6x so not possible
000
Oliver Medhurst @honk.foo · 12/06/2026
want to change my versioning scheme but screwed myself as npm can't rewind versions. my options are: 1. bypassing this restriction somehow 2. going to 0.1xx.0 3. going to 1.0.0-alpha.x any opinions/ideas?
420
Oliver Medhurst @honk.foo · 11/06/2026
update: writing a borrow checker 🥴
0400
Oliver Medhurst @honk.foo · 11/06/2026
any js (library/runtime) folks want to help/give feedback on an api design? :)
010
Oliver Medhurst @honk.foo · 11/06/2026
Speedup column with values: 2.2×, 1.4×, 2.6×, 1.6×, 2.8×, 3.2×, 3.0×, 2.2×, 3.2×, 1.1×, 1.4×
010