
Husband, father and JS software developer. π§
Argentina
Joined March 2016
- Tweets120
- Following2.2K
- Followers202
- Likes1.5K
Daniel Broder π¦π· retweeted
Este artΓculo permite que cualquiera, con conocimientos tΓ©cnicos o no, entienda cΓ³mo funcionan las redes. QuΓ© pasa exactamente cuando hacΓ©is clic en un enlace.
Tiene un currazo impresionante.
fazamhd.com/mental-models/neβ¦
Time to update TS!!!
π£ The moment is here. π£
TypeScript 7 is officially released! 7οΈβ£
devblogs.microsoft.com/typesβ¦
101
Daniel Broder π¦π· retweeted
40 Functional Programming concepts to learn.
Bookmark for later.
1. Algebraic Data Types (ADTs)
2. Pattern-matching
3. Higher-Order Functions (HOFs)
4. Closures
5. Immutability
6. Totality
7. Streams
8. Lazy streams
9. Stream fusion
10. Deforestation
11. Functor
12. Applicative
13. Monad
14. Parser Combinators
15. Applicative Validation
16. Semigroup
17. Monoid
18. Parametric Polymorphism vs Ad-hoc Polymorphism
19. Type Inference
20. Endomorphism
21. Isomorphism
22. Contravariant
23. Profunctor
24. Lens
25. Prism
26. fold
27. traverse
28. Recursion Schemes
29. Tagless Final
30. Recursion
31. Free Monad
32. Hash-Consing
33. Lambda Calculus
34. De Bruijn index
35. Expression problem
36. Functional Core, Imperative Shell
37. Smart Constructor
38. Make Illegal States Unrepresentative
39. Errors as values
40. Parse, Don't Validate
Typescript native compiler, vamos carajo!!!
Thrilled to announce... devblogs.microsoft.com/typesβ¦
87
Bun, bun, bun.
Bun v1.2.3
- Fixes 128 bugs (addressing 349 π)
- Incredibly fast frontend dev server with hot reloading
- Builtin routes in Bun.serve
- Many Bun.SQL fixes
- Wasm gets faster
- Node compatibility improvements for napi & Buffer
Thanks to 23 contributors!
bun.sh/blog/release-notes/buβ¦
1
81
Daniel Broder π¦π· retweeted
In the next version of Bun
Bun.serve() gets a simple builtin router. It supports params.
![import { serve, sql } from "bun"; import App from "./myReactSPA.html"; serve({ routes: { "/*": App, "/api/users/:id": async (req) => { const id = req.params.id; const [user] = await sql`SELECT * FROM users WHERE id = ${id} LIMIT 1`; return Response.json(user); }, "/api/users": { POST: async (req) => { // ... }, }, }, fetch: () => new Response("Not Found", { status: 404 }), });](https://pbs.twimg.com/media/Gj05utSagAAV14Q.jpg?name=small&format=webp)
ALT import { serve, sql } from "bun"; import App from "./myReactSPA.html"; serve({ routes: { "/*": App, "/api/users/:id": async (req) => { const id = req.params.id; const [user] = await sql`SELECT * FROM users WHERE id = ${id} LIMIT 1`; return Response.json(user); }, "/api/users": { POST: async (req) => { // ... }, }, }, fetch: () => new Response("Not Found", { status: 404 }), });
Daniel Broder π¦π· retweeted
Bun v1.2 is here
bun.sh/blog/bun-v1.2
Daniel Broder π¦π· retweeted
Replying to @EffectTS_
@EffectTS_ Beginners Complete Getting Started course is out now π
From zero to building complete apps with effect
Type-safe, maintainable, testable apps, and it's just typescript π―
Here is what you'll learn ππ§΅
typeonce.dev/course/effect-bβ¦
Daniel Broder π¦π· retweeted
π BEGIN EXCLUSIVE appreciation thread π
SQLite transactions are lazy by default -- they only take a write lock when necessary.
If your transactions start readonly and then upgrade to writes:
```
BEGIN
SELECT ...
INSERT ...
COMMIT
```
, it may be better to just declare it a write transaction from the start:
```
BEGIN EXCLUSIVE
SELECT ...
INSERT ...
COMMIT
```
Otherwise you risk the following:
1. Transaction A takes a read lock
2. Transaction B takes a read lock
3. Transaction A tries to upgrade to a write lock, but can't, B holds a read lock
4. Transaction B tries to upgrade to a write lock, but can't, A holds a read lock
5. Both transactions time out. No profit
If you expect the contention to be high -- lots of transactions trying to write at the same time -- BEGIN EXCLUSIVE is your friend.
With BEGIN EXCLUSIVE, the flow is:
1. Transaction A takes a write lock first
2. Transaction A commits, transaction B takes its write lock
3. Transaction B commits
What about WAL mode (write-ahead log journaling)?
Well, it gets subtly worse. WAL journaling mode gives you a great concurrency boost, because instead of allowing one writer or N readers, it allows one writer and N readers to execute concurrently.
There's a consistency price here though. WAL guarantees you snapshot isolation, which means that each transaction will see some consistent state of the database, and will only commit if there isn't going to be any conflict.
In particular, if we were to run transactions A and B in WAL mode, it can end as follows:
1. Transaction A takes a read lock
2. Transaction B takes a read lock
3. Transaction A upgrades to write lock
4. Transaction A writes some data
5. Transaction A releases the write lock
6. Transaction B upgrades to write lock
7. Transaction B tries to write data and gets a SQLITE_BUSY_SNAPSHOT error, because transaction A already changed the database, so there's a potential conflict.
That's optimistic concurrency -- we assume everything is going to be alright and proceed, and worst case we get an error and need to roll back.
Again, BEGIN EXCLUSIVE lets you opt-out of optimistic concurrency, if you know your workload has high contention.
There's also another flavor of transactions in SQLite - BEGIN IMMEDIATE, almost identical to EXCLUSIVE, and in fact totally identical in WAL mode. More details in official docs: sqlite.org/lang_transaction.β¦
Daniel Broder π¦π· retweeted
If you go to chrome://settings/adPrivacy you can turn off the spyware that got inserted into the latest version of Chrome.
Daniel Broder π¦π· retweeted
Introducing Bun v1.0 - a fast, all-in-one toolkit for running, building, and testing JavaScript and TypeScript
bun.sh/blog/bun-v1.0























