bartblast

bartblast

Creator of Hologram

Hologram v0.11 is out! Two headline features this release. First, Elixir regexes now run in the browser. They were server-only until now, and handing patterns to JavaScript’s RegExp doesn’t hold up, so v0.11 ships a PCRE2 parser, translator and interpreter of Hologram’s own, and what comes back is what the BEAM would have given you. Second, client errors now read like server errors, same messages and same stacktraces, so __STACKTRACE__ finally holds real Elixir frames. The release also brings dynamic component and element tags, attribute and prop spread, umbrella project support, and a fix for a DOM identity bug that could knock focus out of an input mid-typing.

Thanks to everyone who reported issues and opened feature requests along the way.

Thanks to our sponsors for making sustained development possible: Curiosum (Main Sponsor), Erlang Ecosystem Foundation (Milestone Sponsor), and our GitHub sponsors - Innovation Partner: @sheharyarn, Framework Visionaries: @absowoot, Oban, @robertu, Moss Piglet, and all other GitHub sponsors.

Full details in the blog post:

Showing Posts 1 to 2

lpil

lpil

Creator of Gleam

Wow, that’s impressive! Are you compiling them into JavaScript regexes? How does the performance compare to regexes written in regular JavaScript?

bartblast

bartblast OP

Creator of Hologram

Thanks Louis!

Where it’s safe, yes. Hologram parses the pattern into an AST, then checks whether every construct in it maps onto JS RegExp with the same semantics. When it does, the AST gets translated and compiled with new RegExp, so matching runs on the browser’s own engine. When it doesn’t, it falls back to a backtracking matcher of Hologram’s own. That’s \K, atomic groups, possessive quantifiers, conditionals, subroutines, backrefs to a group that might not have participated, and a few caseless Unicode corners where JS folds characters that PCRE2 doesn’t. Better to be slower there than to quietly match differently.

Compiled patterns sit in a registry in the client runtime, keyed by ref. They can’t travel, so what actually crosses the boundary is the source plus the options, recompiled on the other side and registered under the same ref. Keeps an opaque {:re_pattern, ...} term working after the trip.

The other nice thing about riding the browser’s engine is that there are no Unicode tables to ship. \p{Greek} resolves against the engine’s own data even on the interpreted path. Go the WASM way and you’re compiling a whole regex engine and hauling its tables along with it.

Most app patterns end up native, so it’s a JS regex plus a one-off parse. The interpreted tail is slower for sure, and I haven’t measured it properly yet, but it’s not the kind of thing people usually write.

— All posts loaded —

Where Next? Top

Trending in News & Updates Top

kip
I’m a bit excited to announce that Localize and friends are now at release 1.0. Even though it’s a 1.0 release, it stands on 8 years of w...
New
bartblast
After building Hologram and sharing updates across various places, I’ve realized there’s a lot happening that doesn’t always make it to t...
New
bartblast
Hologram v0.11 is out! Two headline features this release. First, Elixir regexes now run in the browser. They were server-only until now,...
New
nseaSeb
Just published search_ash 0.5.0 (with search_core 0.4.0) on Hex. What’s new: synonyms You can now declare a synonym dictionary per lang...
New
mudasobwa
After years of struggling I made StreamData dependency optional. Finitomata.ExUnit got testing primitives for Persistence. Full back co...
New
mudasobwa
MdexMultilineCells is an MDEx plugin enabling multi-line cells in Markdown tables with full inline/block Markdown rendering and automati...
New
sullyMusty
ActiveMemory 0.8.0 — in-memory tables that speak Ecto ActiveMemory 0.8.0 is now on Hex. ActiveMemory is an in-memory store built on ETS ...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews