Skip to content

Commit

Permalink
Add HN link to fast exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
purplesyringa committed Dec 19, 2024
1 parent 7d790e8 commit fc10421
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion blog/bringing-faster-exceptions-to-rust/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctypehtml><html prefix="og: http://ogp.me/ns#"lang=en_US><meta charset=utf-8><meta content=width=device-width,initial-scale=1 name=viewport><title>Bringing faster exceptions to Rust | purplesyringa's blog</title><link href=../../all.css rel=stylesheet><link href=../../blog.css rel=stylesheet><link href=../../vendor/Temml-Local.css rel=stylesheet><link crossorigin href=https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,400;0,700;1,400;1,700&family=Slabo+27px&display=swap rel=stylesheet><link href=../../fonts/webfont.css rel=stylesheet><link media="screen and (prefers-color-scheme: dark"href=../../vendor/atom-one-dark.min.css rel=stylesheet><link media="screen and (prefers-color-scheme: light"href=../../vendor/a11y-light.min.css rel=stylesheet><link title="Blog posts"href=../../blog/feed.rss rel=alternate type=application/rss+xml><meta content="Bringing faster exceptions to Rust"property=og:title><meta content=article property=og:type><meta content=https://purplesyringa.moe/blog/bringing-faster-exceptions-to-rust/og.png property=og:image><meta content=https://purplesyringa.moe/blog/bringing-faster-exceptions-to-rust/ property=og:url><meta content="Three months ago, I wrote about why you might want to use panics for error handling. Even though it’s a catchy title, panics are hardly suited for this goal, even if you try to hack around with macros and libraries. The real star is the unwinding mechanism, which powers panics. This post is the first in a series exploring what unwinding is, how to speed it up, and how it can benefit Rust and C++ programmers."property=og:description><meta content=en_US property=og:locale><meta content="purplesyringa's blog"property=og:site_name><meta content=summary_large_image name=twitter:card><meta content=https://purplesyringa.moe/blog/bringing-faster-exceptions-to-rust/og.png name=twitter:image><script data-website-id=0da1961d-43f2-45cc-a8e2-75679eefbb69 defer src=https://zond.tei.su/script.js></script><body><header><div class=viewport-container><div class=media><a href=https://github.com/purplesyringa><img alt=GitHub src=../../images/github-mark-white.svg></a></div><h1><a href=/>purplesyringa</a></h1><nav><a href=../..>about</a><a class=current href=../../blog/>blog</a><a href=../../sink/>kitchen sink</a></nav></div></header><section><div class=viewport-container><h2>Bringing faster exceptions to Rust</h2><time>November 6, 2024</time><a class=discussion href=https://www.reddit.com/r/rust/comments/1gl050z/bringing_faster_exceptions_to_rust/><i class="nf nf-md-comment"title=Comment></i> Reddit</a><p>Three months ago, I wrote about why <a href=../you-might-want-to-use-panics-for-error-handling/>you might want to use panics for error handling</a>. Even though it’s a catchy title, panics are hardly suited for this goal, even if you try to hack around with macros and libraries. The real star is <em>the unwinding mechanism</em>, which powers panics. This post is the first in a series exploring what unwinding is, how to speed it up, and how it can benefit Rust and C++ programmers.<p class=next-group><span aria-level=3 class=side-header role=heading><span>TL;DR</span></span>Check out the <a href=https://lib.rs/lithium>Lithium</a> crate for faster exceptions and unwinding in Rust.<p class=next-group><span aria-level=3 class=side-header role=heading><span>Alternate returns</span></span>Typically, a function returns to the statement immediately following the call:<pre><code class=language-rust><span class=hljs-keyword>fn</span> <span class="hljs-title function_">f</span>() {
<!doctypehtml><html prefix="og: http://ogp.me/ns#"lang=en_US><meta charset=utf-8><meta content=width=device-width,initial-scale=1 name=viewport><title>Bringing faster exceptions to Rust | purplesyringa's blog</title><link href=../../favicon.ico?v=2 rel=icon><link href=../../all.css rel=stylesheet><link href=../../blog.css rel=stylesheet><link href=../../vendor/Temml-Local.css rel=stylesheet><link crossorigin href=https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,400;0,700;1,400;1,700&family=Slabo+27px&display=swap rel=stylesheet><link href=../../fonts/webfont.css rel=stylesheet><link media="screen and (prefers-color-scheme: dark"href=../../vendor/atom-one-dark.min.css rel=stylesheet><link media="screen and (prefers-color-scheme: light"href=../../vendor/a11y-light.min.css rel=stylesheet><link title="Blog posts"href=../../blog/feed.rss rel=alternate type=application/rss+xml><meta content="Bringing faster exceptions to Rust"property=og:title><meta content=article property=og:type><meta content=https://purplesyringa.moe/blog/bringing-faster-exceptions-to-rust/og.png property=og:image><meta content=https://purplesyringa.moe/blog/bringing-faster-exceptions-to-rust/ property=og:url><meta content="Three months ago, I wrote about why you might want to use panics for error handling. Even though it’s a catchy title, panics are hardly suited for this goal, even if you try to hack around with macros and libraries. The real star is the unwinding mechanism, which powers panics. This post is the first in a series exploring what unwinding is, how to speed it up, and how it can benefit Rust and C++ programmers."property=og:description><meta content=en_US property=og:locale><meta content="purplesyringa's blog"property=og:site_name><meta content=summary_large_image name=twitter:card><meta content=https://purplesyringa.moe/blog/bringing-faster-exceptions-to-rust/og.png name=twitter:image><script data-website-id=0da1961d-43f2-45cc-a8e2-75679eefbb69 defer src=https://zond.tei.su/script.js></script><body><header><div class=viewport-container><div class=media><a href=https://github.com/purplesyringa><img alt=GitHub src=../../images/github-mark-white.svg></a></div><h1><a href=/>purplesyringa</a></h1><nav><a href=../..>about</a><a class=current href=../../blog/>blog</a><a href=../../sink/>kitchen sink</a></nav></div></header><section><div class=viewport-container><h2>Bringing faster exceptions to Rust</h2><time>November 6, 2024</time><a class=discussion href=https://www.reddit.com/r/rust/comments/1gl050z/bringing_faster_exceptions_to_rust/><i class="nf nf-md-comment"title=Comment></i> Reddit</a><a class=discussion href=https://news.ycombinator.com/item?id=42072750><i class="nf nf-md-comment"title=Comment></i> Hacker News</a><p>Three months ago, I wrote about why <a href=../you-might-want-to-use-panics-for-error-handling/>you might want to use panics for error handling</a>. Even though it’s a catchy title, panics are hardly suited for this goal, even if you try to hack around with macros and libraries. The real star is <em>the unwinding mechanism</em>, which powers panics. This post is the first in a series exploring what unwinding is, how to speed it up, and how it can benefit Rust and C++ programmers.<p class=next-group><span aria-level=3 class=side-header role=heading><span>TL;DR</span></span>Check out the <a href=https://lib.rs/lithium>Lithium</a> crate for faster exceptions and unwinding in Rust.<p class=next-group><span aria-level=3 class=side-header role=heading><span>Alternate returns</span></span>Typically, a function returns to the statement immediately following the call:<pre><code class=language-rust><span class=hljs-keyword>fn</span> <span class="hljs-title function_">f</span>() {
<span class=hljs-keyword>let</span> <span class=hljs-variable>x</span> = <span class="hljs-title function_ invoke__">g</span>();
dbg!(x); <span class=hljs-comment>// x = 123</span>
}
Expand Down
4 changes: 3 additions & 1 deletion blog/bringing-faster-exceptions-to-rust/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: Bringing faster exceptions to Rust
time: November 6, 2024
discussion: https://www.reddit.com/r/rust/comments/1gl050z/bringing_faster_exceptions_to_rust/
discussion:
- https://www.reddit.com/r/rust/comments/1gl050z/bringing_faster_exceptions_to_rust/
- https://news.ycombinator.com/item?id=42072750
intro: |
Three months ago, I wrote about why [you might want to use panics for error handling](../you-might-want-to-use-panics-for-error-handling/). Even though it's a catchy title, panics are hardly suited for this goal, even if you try to hack around with macros and libraries. The real star is *the unwinding mechanism*, which powers panics. This post is the first in a series exploring what unwinding is, how to speed it up, and how it can benefit Rust and C++ programmers.
---
Expand Down
2 changes: 1 addition & 1 deletion blog/feed.rss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<copyright>Alisa Sireneva, CC BY</copyright>
<managingEditor>[email protected] (Alisa Sireneva)</managingEditor>
<webMaster>[email protected] (Alisa Sireneva)</webMaster>
<lastBuildDate>Thu, 19 Dec 2024 02:44:40 GMT</lastBuildDate>
<lastBuildDate>Thu, 19 Dec 2024 04:36:16 GMT</lastBuildDate>
<docs>https://www.rssboard.org/rss-specification</docs>
<ttl>60</ttl>
<atom:link href="https://purplesyringa.moe/blog/feed.rss" rel="self" type="application/rss+xml" />
Expand Down
Loading

0 comments on commit fc10421

Please sign in to comment.