David Sancho Profile Banner
David Sancho Profile
David Sancho

@davesnx

Followers
2,057
Following
778
Media
263
Statuses
3,909

Software engineer hooked into functional programming with OCaml and @reasonml . Working at @ahrefs in OSS (styled-ppx, server-reason-react, Reason & Melange)

Barcelona, Spain
Joined October 2011
Don't wanna be here? Send us removal request.
Explore trending content on Musk Viewer
Pinned Tweet
@davesnx
David Sancho
1 year
Here is `server-reason-react`, the OCaml implementation of React I have been working on:
6
28
93
@davesnx
David Sancho
4 years
How to explain prettier: JavaScript devs ruby devs
Tweet media one
Tweet media two
1
41
386
@davesnx
David Sancho
4 years
I had to do it...
Tweet media one
9
58
385
@davesnx
David Sancho
4 years
Proud to announce (in Twitter) what I have been working as a side-project for a few weeks. Fully type-checked CSS in Reason and OCaml and now it supports dynamic styling. Check it out here or see an example in
Tweet media one
12
66
371
@davesnx
David Sancho
2 years
If you read my tweets enough and you haven't tried OCaml yet, it's just a matter of time. I'm creating (still WIP) an unorganised guide on how to learn it in 2023:
Tweet media one
11
53
291
@davesnx
David Sancho
8 months
really based
Tweet media one
5
28
272
@davesnx
David Sancho
3 years
@insertefrase @davidbroncano Que ganas de que Twitter implemente el botón del dislike, la madre...
2
1
227
@davesnx
David Sancho
5 years
@_HarshilShah @ProductHunt It's a "famous" love quote. Don't know if comes from any song/poem. It's more like: I would love to be your tears, so I could be born in your eyes, live in your cheek and die in your mouth.
2
17
201
@davesnx
David Sancho
1 year
OCaml is beautiful. > React's node as a variant
Tweet media one
3
20
171
@davesnx
David Sancho
2 years
OCaml developer be like:
Tweet media one
5
16
155
@davesnx
David Sancho
1 year
@steveruizok I do the exact same thing, but I do those in separate commits. Sometimes those little fixes are big/important so before pushing the PR, I cherry pick them (and often rollback them) and open a new PR with those on top of the first PR, so those can be "reviewed" separately.
4
2
141
@davesnx
David Sancho
1 year
@BrioEnfurecida Gracias por equivocarte de nombre, Pedroche.
6
2
110
@davesnx
David Sancho
3 years
Took me a little long, but I wrote a blog post about Tailwind and Design systems. Comes from respect and admire for @adamwathan and his work, but I explain why Tailwind shouldn't be used to build your Design system. Hope you like it 🥰
Tweet media one
12
14
88
@davesnx
David Sancho
11 months
Tweet media one
5
12
87
@davesnx
David Sancho
10 months
3
3
85
@davesnx
David Sancho
10 months
One of my slides to explain what's Reason to TypeScript people Seems fair, isn't it?
Tweet media one
4
10
79
@davesnx
David Sancho
2 years
Yes, leaked: I have an implementation of React and ReactDOM in OCaml. It has the same react jsx ppx, so you can compile with Melange and ocamlc the same file 🤯🤯🤯
@davesnx
David Sancho
2 years
This is a preview of the tests of emotion written in OCaml, running all the logic for CSS-in-JS in native. (and a preview of SSR React ^^)
Tweet media one
1
2
32
7
18
69
@davesnx
David Sancho
3 years
I'm very excited to announce I'm starting a new show with @fakenickels to bring OCaml, Reason and ReScript community best brains to casually talk. Our first guest @___zth___ 🤩 We go live on next Wednesday. Subscribe to not miss it!
Tweet media one
7
25
71
@davesnx
David Sancho
3 years
OCaml is a little salty, sometimes.
Tweet media one
0
14
67
@davesnx
David Sancho
1 year
OCaml on the backend, ReScript on the frontend
9
3
67
@davesnx
David Sancho
2 years
Have you seen a better contribution graph than Xavier Leroy in ocaml/ocaml? His surname is literally "The king" in French.
Tweet media one
1
2
65
@davesnx
David Sancho
4 years
Happy to share a project I did to learn how to create a lexer, parser and compiler. Re-implemented jq, I call it "q" and it's between 2x and 5x faster than jq and tries to have better error messages! Try it out, , I even have a "logo".
Tweet media one
4
12
63
@davesnx
David Sancho
1 year
@ThePrimeagen TypeScript is made to sell, not to shine. - Easy and cheap to adopt. - Best quality for the price. - Created by MS to sell Azure and make MS good looking. - Viral, once a package uses types adding types feels "required". - A bunch of unnecessary features, that compete to each
3
7
60
@davesnx
David Sancho
9 months
Chad PR - Documentation-only pull request - Explains opam/dune/melange under Reason (de-prio esy) - Fixes 20+ issues - Improves current pages (jsx, what and why) - Creates pages I wish I had when I started (refmt, rtop) - Links to melange playground 🔥
Tweet media one
1
5
63
@davesnx
David Sancho
7 months
Talking mostly about OCaml/Reason and frontend stuff I got 1 million impressions. Not bad for being just a nerd. Thanks for reading, appreciate you!
Tweet media one
4
1
60
@davesnx
David Sancho
3 years
Excited for the opportunity to work on styled-ppx and Frontend Infra at @ahrefs , spending time working on my Open Source project it's a dream, and working with @javierwchavarri facing big challenges sounds amazing If you don't know styled-ppx check it out
5
7
59
@davesnx
David Sancho
9 months
Reason (via Melange) is the only language that can compete with JavaScript towards React Server components. Not Rust, neither Go, neither C++, OCaml baby!
14
6
59
@davesnx
David Sancho
10 months
@ematipico What can you do? Convince the backend team that they are wrong. A 200 response is often cached by the browser, caching a 404 request is madness.
6
0
57
@davesnx
David Sancho
10 months
The rebrand was BuckleScript to ReScript. Reason was affected, because it was integrated with BuckleScript. Really hard to calculate, but the harm made by a poor announcement and a long story of bad explanations of the tools are insane.
@PraveenPerera
Praveen Perera
10 months
@davesnx I thought it was ReScript now?
1
0
1
6
1
55
@davesnx
David Sancho
11 months
Pragmatic programmers: You shouldn't get too attached to your tech, it's just a tool. You should swap them with the best choice, each time. Have you seen a wood worker be passionate about a screwdriver? Mechanical keyboard industry: Hold my beer
6
3
59
@davesnx
David Sancho
9 months
The video from my talk at @ReactAlicante is up: Server side rendering React natively with Reason / OCaml (literally same thing)
7
16
57
@davesnx
David Sancho
1 year
OCaml Eio is almost the best - Brings the ecosystem together - Code is more simple and accessible to beginners - Faster than lwt/async - It's f* multicore
4
4
55
@davesnx
David Sancho
3 years
In #reasonml , If you are tired of `{React.string("foo")}`, don't create util like `str`, instead, create a component that always expects a string.
Tweet media one
6
7
57
@davesnx
David Sancho
8 months
Came back from vacations and deployed this beast just before AoC 2023 Updated documentation for reasonml - Recommends melange - Installation with opam and dune - Fixes 20+ issues - Explains what and why Reason - refmt & rtop pages
@davesnx
David Sancho
9 months
Chad PR - Documentation-only pull request - Explains opam/dune/melange under Reason (de-prio esy) - Fixes 20+ issues - Improves current pages (jsx, what and why) - Creates pages I wish I had when I started (refmt, rtop) - Links to melange playground 🔥
Tweet media one
1
5
63
3
7
55
@davesnx
David Sancho
10 months
This is what happens when you let a Frontend dev work on a type-checker
@jaredforsyth
Jared Forsyth
10 months
Hindley Milner type inference (algorithm-j) visualized 🎉
8
72
379
1
5
52
@davesnx
David Sancho
4 years
Tailwind claims to be component-driven, which is totally false.
12
8
53
@davesnx
David Sancho
1 year
Linguist from github got a new release, which updates the OCaml's color on Github: It's orange!
Tweet media one
2
3
51
@davesnx
David Sancho
2 years
Got the invite to collaborate on @reasonml . Started by doing a bit of triage on refmt bugs and honestly, most of them are a little nasty. I want to tackle the printing first since it needs a lot of love
Tweet media one
4
2
52
@davesnx
David Sancho
2 years
The greatest thing about @elmlang is that it became a gold reference. Many languages refer to their error messages and many libraries get inspired by their APIs. Complete copies of some of their standard libs. Some of the most used JS libs, platforms (SwiftUI) and even languages
3
10
49
@davesnx
David Sancho
2 years
There's no logo, but that's probably a good one.
Tweet media one
3
0
50
@davesnx
David Sancho
1 year
A few people have asked me about how to contribute to cool projects in OCaml. My answer so far: - Help web dev around Dream - Get involved with ReScript and explode at maximum the v11 features to improve bindings with libs, improve patterns that will be obsolete (1/n)
5
6
47
@davesnx
David Sancho
11 months
Some people on here wonder why OCaml is getting more attention, but I wonder... why wasn't getting more before? This kind of content (omfg @talex5 ) from 2014 is a solid resource to choose pragmatically over programming languages
2
4
46
@davesnx
David Sancho
3 years
Tweet media one
0
4
43
@davesnx
David Sancho
5 years
Hey @reasonml 🥳, finally the Chrome's Webstore published "ReasonML Formatter" an extension that makes ReasonML types more readable when they are logged to the console. - Works only with Lists, for now :) - It can be installed in your app
1
6
42
@davesnx
David Sancho
1 year
When someone from another language rants about OCaml saying "I won't use OCaml for anything", it means we are getting mainstream
@_osa1
sinan
1 year
New blog post: "My thoughts on OCaml"
10
8
38
3
2
44
@davesnx
David Sancho
1 year
Are you a ReScript user that wants to learn a little about Native development? One of the tools you need to get familiar with is dune. It's the de-facto build tool for OCaml development, it's a layer on top of the OCaml tooling and it's powerful and fast. (1/n)
1
4
41
@davesnx
David Sancho
3 years
The beauty of `map` in bash, crazy useful.
Tweet media one
0
4
39
@davesnx
David Sancho
10 months
Getting ready for my talk about server rendering React in OCaml. This saturday at @ReactAlicante . I will miss @ken_wheeler and will do my best
@ChShersh
Dmitrii Kovanikov
10 months
Lots of people ask why OCaml is suddenly trending. So quick recap according to my understanding. 1. @teej_dv learns about OCaml from cool folks and decides to solve Adventure of Code with it. Being an influencer, he shares his experience with lots of people. 2. @davesnx
26
60
425
3
6
41
@davesnx
David Sancho
11 months
Hi, is there anyone here that: 1. knows OCaml and JavaScript well 2. loves low-level & algorithmic puzzles 3. has patience to talk with me 4. and like to jump on a call with me to talk? Could you RT or share? If more calls/sessions, it will be payed (50$/h)
8
16
40
@davesnx
David Sancho
1 year
Hot take: by default TypeScript is not a type-system.
@mattpocockuk
Matt Pocock
1 year
Turns out that tuples can receive a .push method. u ok TypeScript?
Tweet media one
27
28
631
7
6
38
@davesnx
David Sancho
1 year
We made it into React Weekly!
@sebastienlorber
Seb ⚛️ ThisWeekInReact.com
1 year
🧵 Server-side rendering React in OCaml - @davesnx The Ahrefs team reimplemented ReactDOMServer.renderToString in OCaml 🤯 They now run SSR natively, much faster than Node or Bun 🔥
Tweet media one
2
10
55
1
5
37
@davesnx
David Sancho
7 months
New blog post to start great this new year. "What's possible with Melange" a tour of the features that Melange and dune enable from my previous stack (BuckleScript).
1
11
38
@davesnx
David Sancho
9 months
It's a talk about: - Whats and Why Reason - What were the problems at my company (ahrefs) - How did we implemented SSR in OCaml to run the rendering of React natively - A small performance graph outperforming Bun x6
Tweet media one
@davesnx
David Sancho
9 months
The video from my talk at @ReactAlicante is up: Server side rendering React natively with Reason / OCaml (literally same thing)
7
16
57
1
15
35
@davesnx
David Sancho
1 year
If you are a TypeScript developer that prefers sound types, avoids any, enjoys a safe refactor, uses zod in all projects, etc... You would enjoy a lot a language that it's designed with all of this from the start. Try Reason ;)
5
7
37
@davesnx
David Sancho
3 years
🎊 Released a new version of styled-ppx where interpolation is type-safe and it's huge. This ensures that runtime values will be valid in your CSS declarations, Thanks to bs-css types. You will never have to debug `height: undefinedpx`.
3
11
38
@davesnx
David Sancho
2 years
The new melange version with dune integration is going to be the best thing that happened to ReasonML, since BuckleScript.
4
2
38
@davesnx
David Sancho
1 year
Let gooo, after one week... got React Suspense and React.use hook working with rendering to stream on the server: This demo doesn't use any client-side code 🤯🤯🤯. The Suspense "approach" is between a hack and extremely cool
1
8
38
@davesnx
David Sancho
2 years
I merged my first decent-size PR into reason 🥳. It's one of the few PR after a long time of maintenance by @_anmonteiro updating to the newest OCaml versions and its patches. It's a fix on refmt: improves the printing of attributes and extensions. An example that was annoying:
Tweet media one
Tweet media two
1
1
36
@davesnx
David Sancho
2 years
Oh no, my article about Tailwind got into Hacker News. Here we go again...
Tweet media one
Tweet media two
4
1
36
@davesnx
David Sancho
1 year
Just because I put my energy and passion into ReasonML it doesn't mean I don't appreciate and love @rescriptlang . I have huge respect for @ryyppy @bobzhang1988 @___zth___ @cknitt @_chenglou .
3
2
36
@davesnx
David Sancho
8 months
savage by @getsentry
Tweet media one
2
4
37
@davesnx
David Sancho
8 months
ReScript vs Melange Some people see "competition" when there's none, in fact, there's only benefit. More people learning, using, deploying ReScript... makes Melange bigger, and viceversa. Onboarding developers to write functional code it's a win for all of those communities.
2
4
36
@davesnx
David Sancho
1 year
TypeScript is the capitalist of the type-systems. That's the tweet, love u, bye.
5
2
35
@davesnx
David Sancho
1 year
Imagine, just imagine...
Tweet media one
4
6
35
@davesnx
David Sancho
1 year
There are some good takes on LinkedIn
Tweet media one
2
0
32
@davesnx
David Sancho
1 year
A few months ago I wished there was a "Compiler guide" in OCaml... and today I found out some efforts on bringing this to life: Thanks Nick Barnes from @tarides_
0
3
36
@davesnx
David Sancho
10 months
Do you want to use Tailwind with any OCaml derived languages? That includes ReScript, Reason, OCaml itself (obbv) and Melange (not a language, but you get it!) I wrote a gist that recollects some interesting projects:
2
3
34
@davesnx
David Sancho
3 years
🌕 work 🚀 another side-project . . . . . . . . 💥 🌎 me
0
1
34
@davesnx
David Sancho
1 year
ReScript is a gateway to Reason, which is a gateway to OCaml, which... is the last gate.
2
1
34
@davesnx
David Sancho
8 months
a) compile to optimal js b) run natively and fast reason with melange:
Tweet media one
1
4
31
@davesnx
David Sancho
2 years
Margin is considered evil in components... true. But, not only margin? The list is bigger: align-items: flex-end position: absolute z-index: xxx overflow: scroll That's why If you abstract those Layout problems to specific components, you are going to create UIs like a beast
5
7
31
@davesnx
David Sancho
3 years
Let's meet @TheEduardoRFS better. He's the OCaml Streamer of the year, the youngest person who writes compilers and fintech code, and probably a great friend. Join us, will be massive 💣
@fakenickels
fakenickels
3 years
👋 Help us welcome @TheEduardoRFS tomorrow in EmelleTV! Eduardo is a streamer and a tech lead at @Marigold_Dev 🎙️ Join us to casually talk about @OCamlLang ( @OCam_l ), @tezos and maybe compilers! Get your questions ready! 📅 👉
Tweet media one
2
10
49
1
7
32
@davesnx
David Sancho
1 year
Thanks OCaml @OCamlLang
Tweet media one
0
1
33
@davesnx
David Sancho
7 months
2
1
31
@davesnx
David Sancho
9 months
I match the bet, $10k but needs to be in OCaml
@Vjeux
vjeux ✪
9 months
There's lot of excitement around faster pretty printers using Rust. The main issue is that none of them match the long tail of formatting logic of prettier. I'm putting up a $10k bounty for any project written in Rust that passes > 95% of the prettier JavaScript tests.
Tweet media one
71
174
1K
5
3
32
@davesnx
David Sancho
2 years
This is a preview of the tests of emotion written in OCaml, running all the logic for CSS-in-JS in native. (and a preview of SSR React ^^)
Tweet media one
1
2
32
@davesnx
David Sancho
11 months
Literally, 0 times. switch (listOfThings) { | [] => React.null | _ => <YourList /> }
@trashh_dev
trash
11 months
you've made this mistake at least once.
Tweet media one
248
74
2K
1
2
31
@davesnx
David Sancho
11 months
Jane Street agrees
@floydophone
Pete Hunt 🚁
11 months
@richardiii you might not like it, but this is what peak performance looks like
Tweet media one
4
8
65
1
0
32
@davesnx
David Sancho
8 months
Do not build URLs with string concatenation. Use URL module or a better abstraction, it can cost you big $. From someone who learned the hard way 😖
@jamesqquick
James Q Quick
8 months
This bug may have cost me MONTHS of newsletter subscribes 😢 Can you find it? 👀
Tweet media one
486
54
1K
4
2
30
@davesnx
David Sancho
2 years
Unpopular opinion: Makefiles are great. Despite their "weird" syntax and hidden features. It's actually an expressive, efficient and powerful way to build programs, or at least x10 better than your messy npm scripts. Let me change your opinion...
4
1
30
@davesnx
David Sancho
3 years
Life is short, don't spend it trying to convince people on Twitter to use @rescriptlang or @reasonml or @OCamlLang
5
3
31
@davesnx
David Sancho
1 year
I'm late to the party, but the new **ppxlib's user manual** is crazy good. Huge congrats to the ppxlib team, this enables a much clearer path for curious developers
Tweet media one
1
5
30
@davesnx
David Sancho
9 months
I finished a fun weekend project that can be useful for rendering HTML Write JSX, render HTML Most features from JSX and a few improvements (lowercase components and no annotations). No React idioms, and type-safe. It works with Reason syntax and MLX.
2
7
29
@davesnx
David Sancho
11 months
OCaml
@historyinmemes
Historic Vids
11 months
Without Googling, name something invented by the French
Tweet media one
11K
180
6K
1
4
30
@davesnx
David Sancho
1 year
This is what it looks like to server-side render a Reason React application, with hydration. Note that emotion runs on the server and on the client without no SSR miss-match issues, and it's crazy fast. Deployed to Thanks to @melange_re
1
7
30
@davesnx
David Sancho
2 years
Why call yourself an OCaml developer when you can be an **Objective Categorical Abstract Machine Language** developer
2
4
29
@davesnx
David Sancho
1 year
I honestly don't understand the desire to let React down. I appreciate signals, Qwick, Solidjs, and other solutions, but going on and hate React? No matter what, the principles of a pure function that returns a piece of UI are still untouched.
2
0
29
@davesnx
David Sancho
11 months
Also, styled-ppx v0.40 comes with Melange support, and I believe is the first library with Melange, OCaml native and ReScript support available. All the machinery to do so, are dune rules to generate stuff for ReScript. Sharing code between Melange and OCaml is too simple.
Tweet media one
@davesnx
David Sancho
11 months
Released a new version of styled-ppx which embeds bs-css and bs-css-emotion for full CSS compatibility, faster development and (someday near zero runtime).
Tweet media one
0
2
15
3
0
28
@davesnx
David Sancho
1 year
Migrate ReasonML's infra from to Github actions and cram tests. One of the last PRs was to remove the old CI and old test infrastructure. -35.132 lines removed. Merci @_anmonteiro for letting me do the commit.
Tweet media one
0
1
29
@davesnx
David Sancho
2 years
TypeScript is slow even more in big projects. It's not a problem. Solution: - Don't run the type checker - Don't have a big project
@TkDodo
Dominik 🔮
2 years
The #TypeScript compiler might not be the fastest - but why is that such a big problem? "We have a large project" - I get that, but there are other things you can do that will impact development speed and DX:
21
32
312
2
1
29
@davesnx
David Sancho
2 years
After the blog post "React server-side rendering with OCaml" by @javierwchavarri I wanted to try a simple idea: SSR in Reason with JSX but with the same interface as reason-react Given the same component tree that's used for JS compilation, should render on the server with OCaml
1
9
27
@davesnx
David Sancho
10 months
@garybernhardt Japan websites: hold my beer
0
2
27
@davesnx
David Sancho
3 years
I decided to sadly leave @draftbit , they are a great team and I wish them the best @peterpme @0xPCK @DonaldHruska @adnelson @gduverger @nickselman @tmgrace I'm excited to announce what I would do next, since I've accepted a dream job 🥳
4
0
26
@davesnx
David Sancho
2 years
A nice tip I wasn't aware of until today for VSCode and ocaml-lsp You can see the preprocessed file and the AST explorer! of the current file right in your editor. Both features are insane! CMD + P > OCaml: Open AST Explorer CMD + P > OCaml: Show preprocessed document
Tweet media one
3
5
27