λlain.bit (@lainbit) header
λlain.bit (@lainbit) profile picture

trying to be a christian + study notes + v8 + osdev + linux internals + sharing my several random thoughts + i'm practicing english + i hate web views

Joined April 2022
Photo by λlain.bit (@lainbit)Photo by λlain.bit (@lainbit)Photo by λlain.bit (@lainbit)Photo by λlain.bit (@lainbit)Photo by λlain.bit (@lainbit)Photo by λlain.bit (@lainbit)Photo by λlain.bit (@lainbit)Photo by λlain.bit (@lainbit)Photo by λlain.bit (@lainbit)Photo by λlain.bit (@lainbit)
λlain.bit retweeted
regra número um do design gráfico não faça uma suástica!!
41
431
79
7,655
107,191
Mano, imagine no calor insuportável do Afeganistão e a pessoa viver a vida toda vestida assim. Quanta crueldade!
Mulher muçulmana afegã chora ao descobrir que não terá mais direito a um NOME. Ela sabe o que isso significa! SEM ROSTO, SEM NOME: ELA NÃO EXISTE
1
8
54
1,323
Níveis de ponteiros em C
6
17
229
11,131
λlain.bit retweeted
`git worktree` is eating your disk (especially with agents). `git coworktree` is a drop-in replacement that uses copy-on-write on APFS/btrfs/XFS. linux: 1.65 GB → 39 MB (98%) rust: 459 MB → 31 MB (93%) next.js: 298 MB → 21 MB (93%) paste this to your agent: ``` Do these in order: 1. Install git-coworktree, a copy-on-write drop-in for git worktree: github.com/dwisiswant0/git-c… 2. Set up its hooks, so that the worktrees you create share disk blocks with the repo. 3. Add global instructions about it so it's used across all repos. ```
27
35
2
522
36,843
λlain.bit retweeted
uma comunidade sempre, moço
E ai rapaziada, ja sabem qual profissão seguir quando a IA substituir todos nós de dev/sec/ti?
1
7
251
λlain.bit retweeted
minha mãe tá com suspeita de cancer no útero foi no médico e ele perguntou se ela tinha casa carro filhos família etc ela disse que sim e ele respondeu "então pronto vc tem tudo, se não tá feliz pula de uma ponte" pqp que porra é essa
175
532
123
21,129
395,056
λlain.bit retweeted
Replying to @fuckhunger
Médico devia fazer um teste psicológico a cada 6 meses pra saber se ta apto a lidar com as pessoas de forma humana, pq o tanto de medico sociopata q ja encontrei é brincadeira
21
1
656
13,839
λlain.bit retweeted
想把一台不用的笔记本完全改造成 Lisp machine 完全一体化的 Lisp 操作系统,窗口管理器、图形界面、编辑器、编译器、网络协议、各种应用服务全部用 Lisp 编写 #Lisp
8
8
61
8,516
Sabe esse monte de jovens saudáveis caindo mortos por aí desde 2022? É stress, diz "a ciência". E dane-se o que dizem os estudos. Luto Gabriel Félix: médica explica como alguém saudável pode ter uma morte súbita terra.com.br/diversao/gente/…
10
31
2
195
4,970
Node.js got faster in September 🧵 The Node.js team and external collaborators have been working overtime to make Node.js as fast as possible. Node is fast and it will be the fastest place to run the huge ecosystem built for it All of it ships in Node.js 26 and some on Node 24
Node.js saw more love in August 🧵 UTF-8 decoding up to 12× faster (!), with significant speedups across URLs, Web Streams, fs, and HTTP All of it landed in Node 24 & 26
1
2
1
43
3,162
λlain.bit retweeted
And here we go into the dense forest of trees. And that also takes us past 300 pages of the book.
Making a Swift JavaScript lexer as fast as QuickJS's, with no unsafe code I'm building Origami, a web engine in Swift, one small step at a time. This week's step: make its JavaScript lexer as fast as the lexer of QuickJS-ng, a small, well-tuned JS engine in C. What a lexer does A lexer is the first stage of a JS engine. It turns source text into tokens: names, numbers, strings, +, {, and so on. Every script on a page passes through it. First: are the tokens right? Before measuring speed, I checked that both lexers give exactly the same output. I ran all of test262, the official JavaScript test suite: 47,072 files, 73 MB. Every token from Origami was compared with the tokens of acorn (a JS parser) and of QuickJS: its kind, its position, and its value. Result: 7,005,043 tokens, and not one differs. How I measured speed I wanted a fair, same-work comparison: - Same input: the same 47,072 files, read into memory first. - Same goals: JS has two readings of / (divide, or start a regex). Both lexers were told the same answer at each place, taken from acorn's parser. - Same conditions: one thread, on the same Mac (M4 Max). - The lexer only: the clock wraps only the lexing, not reading the files. QuickJS's lexer is internal to its C code, so a small C program includes quickjs.c and calls the lexer directly. The first run - Origami: 275 ms, about 39 ns per token - QuickJS: 198 ms, about 28 ns per token QuickJS was about 1.4× faster. Finding where the time went I profiled both with macOS sample, running the lexer over all the files many times. - QuickJS: almost all of its time is in one big function, next_token, where everything is inlined. - Origami: the time was spread over many small functions, plus some reference counting that didn't need to happen. The steps (each one measured on the same files): 1. 277 → 262 ms. Strings added each character by building a small UTF-16 view and copying it. Now they append the code units directly. Punctuators also stopped using a generic starts(with:) and compare bytes in a simple loop. 2. 262 → 237 ms. The function that reads one character had a long path for non-ASCII characters, which made it too big for the compiler to inline. I moved the long path into its own function. The short ASCII path now gets inlined everywhere. This was the best gain for the smallest change. 3. 237 → 211 ms. Each punctuator in the lookup table kept its bytes in an array, and arrays are reference-counted. Now the bytes sit in one plain integer, so a lookup does no retain or release. 4. 211 → 199 ms. 55% of test262 is comments. Once a comment has a line break, the only thing left to find is */, so it now runs a tighter loop. Two ideas that didn't help - Putting the common white-space characters first in a switch: no gain. - A reserved-word table without arrays: slower or no gain. Both were removed. A change that looks faster is not always faster, so I measured every one. Final result (same files, same rules): - Origami: ~200 ms, ~29 ns per token - QuickJS: ~200 ms, ~29 ns per token The tokens are still identical. QuickJS also does some extra work per token (it interns names as atoms), so this is a fair match on tokens, not on every detail. The Swift code has no unsafe pointers. It's still the readable version, with a clear reference version next to each fast path and tests that compare the two. Everything is written up step by step in the Origami book, with the tables.
1
15
988
resolvi meu primeiro problema da IMO! grande momento individual para nós amantes da matemática imo p6 1988 demorei 5 horas e 47 minutos... estourei o limite de tempo mas pelo menos resolvi, to muito feliz
81
121
40
4,107
212,353
λlain.bit retweeted
I wrote about who contributed to Postgres 19. theconsensus.dev/p/2026/11/2…
1
4
34
2,245
λlain.bit retweeted
JavaScript engines are the most widely used language runtimes on the planet. Reading a compact C implementation like QuickJS is one of the best ways to see how they actually work. And ofc, Origami in just a while. github.com/bellard/quickjs
8
3
72
3,594
Ponteiros em C (Piloto) 🎞️ Estou experimentando uma forma diferente de editar, e fiz esse piloto só pra experimentar. Gostei de algumas coisas, nem tanto de outras, mas esperem vídeos de qualidade nas próximas semanas!
4
3
68
1,526
λlain.bit retweeted
Ninguém te avisa que ter vizinhos silenciosos e educados é um dos maiores luxos da vida adulta.
202
1,998
244
20,412
386,645
λlain.bit retweeted
Imagina quanta propaganda na cabeça pra pessoa chamar isso de fardo ou de destruição da sua vida
Se acaba la siesta y empieza la fiesta. Brazos arriba, sonrisas enormes, cero preocupaciones. Que nadie te diga que los hijos son una carga: son la mayor alegría que puede tener una casa.
32
93
3
1,267
12,708
Replying to @studentholic
Não precisa se sentir culpada. Eu vou te dar um acesso a minha plataforma. Me manda uma DM.
80
124
164
3,974
253,687
λlain.bit retweeted
vi esse alerta hj. dois starters populares de laravel vêm com um APP_KEY que parece de verdade no .env.example. e se essa chave é pública, um bug antigo do laravel (CVE-2018-15133) vira execução remota de código. o bizu é simples: começou projeto de starter, roda php artisan key:generate mesmo que já tenha chave lá. eu n sei quais são os starters, ele não falou. mas não custa nada rodar. xitter.gq/phpwarden/status/21266…
If you deployed a Laravel starter template, run this even if .env.example already has a key: php artisan key:generate Two popular starters ship a real-looking APP_KEY. With a public key, an old Laravel bug (CVE-2018-15133) becomes remote code execution. #Laravel #PHP
1
1
13
2,048