Software engineer hooked into functional programming with OCaml and
@reasonml
. Working at
@ahrefs
in OSS (styled-ppx, server-reason-react, Reason & Melange)
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
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:
@_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.
@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.
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 🥰
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 🤯🤯🤯
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!
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".
@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
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 🔥
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
Reason (via Melange) is the only language that can compete with JavaScript towards React Server components.
Not Rust, neither Go, neither C++, OCaml baby!
@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.
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.
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
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
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
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 🔥
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
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
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)
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
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
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)
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
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)
🧵 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 🔥
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).
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
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 ;)
🎊 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`.
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
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:
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.
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_
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:
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
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 💣
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.
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...
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
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.
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
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.
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.
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).
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.
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:
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
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