Skip to content

Commit 407bdb8

Browse files
committed
A few more changes based on feedback
1 parent f1ff7fd commit 407bdb8

File tree

3 files changed

+74
-40
lines changed

3 files changed

+74
-40
lines changed

blog/authors.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
boa-dev:
22
name: Boa Developers
33
url: https://github.com/boa-dev
4+
temporal-dev:
5+
name: Temporal_rs Developers
6+
url: https://github.com/boa-dev/temporal
8.81 KB
Loading

blog/temporal-release/index.md

Lines changed: 71 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
1-
# Temporal_rs release v0.1
1+
---
2+
layout: post
3+
tags: [post]
4+
title: "Temporal_rs v0.1 release"
5+
description:
6+
Powering the new date/time API in Boa, Kiesel, V8, and any Rust
7+
projects near you!
8+
authors: temporal-dev
9+
---
210

311
After almost 2+ years of development, we're pleased to announce the 0.1
412
release of `temporal_rs`. A calendar and time zone aware Rust date/time
5-
library based on ECMAScript's Temporal API.
13+
library based on ECMAScript's [Temporal API][mdn].
614

715
`temporal_rs` is a highly conformant implementation of the Temporal API
816
in Rust that can be used in native Rust code or embedded into ECMAScript
9-
engines / interpreters to support their implementations.
17+
engines / interpreters to support their implementations, which we first
18+
announced in our first
19+
[Temporal blog post](../2025-06-15-temporal-impl-1.md), if you're
20+
interested in learning more about small implementation details.
1021

11-
Currently, `temporal_rs` is being used by Boa, Kiesel, V8, and Yavashark
12-
for their Temporal implementations (but more on that later).
22+
Currently, `temporal_rs` is being used by Boa, [Kiesel][kiesel-site],
23+
[V8][v8-site], and [Yavashark][yavashark-repo] for their Temporal
24+
implementations (more on that later) and will soon being
25+
[shipping in Chrome](https://chromestatus.com/feature/5668291307634688).
1326

1427
To celebrate the 0.1 release of `temporal_rs`, we'll cover a short
1528
background of the Temporal implementation in Boa and why `temporal_rs`
16-
was split into it's own crate, we'll go over the libraries general
17-
design, then we'll walk through a couple brief examples of using
18-
`temporal_rs`, and finally we'll talk about the FFI and engine adoption.
29+
was split into it's own crate, we'll go over the library's general
30+
design, and then we'll walk through a couple brief examples of using
31+
`temporal_rs` before finally talking about the FFI and engine adoption.
1932

2033
## Some background and history
2134

@@ -119,7 +132,8 @@ its not interesting.
119132

120133
The Temporal API focuses on a group of 8 date and time types, each of
121134
which corresponds to a different aspect of date and time with varying
122-
support for `Calendar`s and `TimeZone`s.
135+
support for calendars and time zones, which are, unsurprisingly,
136+
represented in `temporal_rs` by the `Calendar` and `TimeZone` types.
123137

124138
| Temporal type | Category | Calendar support | Time zone support |
125139
| -------------- | --------------------------------- | ---------------- | ----------------- |
@@ -143,6 +157,9 @@ date accessors. The exception being PlainYearMonth and PlainMonthDay
143157
which are missing their day and year, respectively ... for all intents
144158
and purposes.
145159

160+
For a full view of the API, we recommend checking our
161+
[documentation](https://docs.rs/temporal_rs/latest/temporal_rs/).
162+
146163
## `temporal_rs` design overview
147164

148165
`temporal_rs` in general implements large portions of the specification
@@ -239,7 +256,7 @@ features.
239256
use temporal_rs::Temporal;
240257

241258
// Get today's date
242-
let today = Temporal::now().to_plain_date_iso(None).unwrap()
259+
let today = Temporal::now().plain_date_iso(None).unwrap()
243260
```
244261

245262
#### Date operation's available
@@ -306,21 +323,19 @@ println!("{today_coptic}");
306323
```
307324

308325
While we can extend these examples further, a more fun exercise for the
309-
reader would be taking a look at the
310-
[Temporal cookbook](https://tc39.es/proposal-temporal/docs/cookbook.html)
311-
as it displays the utility of the Temporal API using JavaScript and all
312-
of these examples are now usable from Rust as well.
326+
reader would be taking a look at the [Temporal cookbook][cookbook] as it
327+
displays the utility of the Temporal API using JavaScript and all of
328+
these examples are now usable from Rust as well.
313329

314330
## FFI and engine adoption
315331

316332
As previously stated, `temporal_rs` is used in Boa, Kiesel, and V8.
317333
There's just one thing, the latter of the two are ECMAScript
318334
implementations written in Zig and C++, respectively, not Rust. This was
319-
made possible through `temporal_rs`'s sister crate `temporal_capi`, a
320-
FFI library that provides C and C++ bindings to `temporal_rs`.
335+
made possible through `temporal_rs`'s FFI crate `temporal_capi`, which
336+
provides C and C++ bindings to `temporal_rs`.
321337

322-
The bindings are autogenerated via
323-
[Diplomat](https://github.com/rust-diplomat/diplomat), which is a
338+
The bindings are autogenerated via [Diplomat][diplomat-repo], which is a
324339
project for generating FFI definitions for Rust libraries. In general,
325340
it's a really cool project and would definitely recommend checking it
326341
out if you're looking to generate FFI bindings for other languages for
@@ -329,10 +344,10 @@ your Rust library.
329344
There is some added benefits to offering C and C++ bindings beyond the
330345
classic: oh, let's (re)write it in Rust.
331346

332-
First, this allows other languages and engines to benefit from Rust's
333-
type system and memory safety guarantees without having to rewrite
334-
everything in Rust. It's a more modular and incremental approach that
335-
provides some level of flexibility.
347+
First, this approach allows other languages and engines to benefit from
348+
Rust's type system and memory safety guarantees without having to
349+
rewrite everything in Rust. It's a more modular and incremental approach
350+
that provides some level of flexibility.
336351

337352
Secondly, with how large the API is, `temporal_rs` streamlines the
338353
ability to adopt the Temporal API for any current and future
@@ -341,45 +356,61 @@ be done primarily in one place and then released downstream. While it's
341356
easy to say: "just use our library" to promote adoption. Seriously, just
342357
use the library. The Temporal API is massive from an implementation
343358
perspective and the glue code plus `temporal_rs` is relatively trivial
344-
in comparison to a fresh implementation.
359+
in comparison to a fresh, from scratch implementation.
345360

346361
Third, with adoption from multiple engines, `temporal_rs` benefits via
347-
further test coverage beyond the native unit tests. For instance, of the
348-
engines that offer conformance numbers (Boa, Kiesel, and V8), all of
349-
them are currently north of 95% conformance with V8 reaching the highest
350-
at around 99% conformance. The conformance difference between the
351-
engines being due to the current implementation state of other features,
352-
i.e. Boa still hasn't completed its `Intl.DateTimeFormat` implementation
353-
yet so it fails all ECMA402 `toLocaleString` tests. As a result though,
354-
we can be fairly confident in the general correctness of `temporal_rs`,
355-
and any potential bugs will ideally be found and addressed fairly
356-
quickly.
362+
further test coverage beyond the native Rust unit tests. For instance,
363+
of the engines that offer conformance numbers (Boa, Kiesel, and V8), all
364+
of them are currently north of 95% conformance with V8 reaching the
365+
highest at around 99% conformance. The conformance difference between
366+
the engines being due to the current implementation state of other
367+
features, i.e. Boa still hasn't completed its `Intl.DateTimeFormat`
368+
implementation yet so it fails all ECMA402 `toLocaleString` tests. As a
369+
result though, we can be fairly confident in the general correctness of
370+
`temporal_rs`, and any potential bugs will ideally be found and
371+
addressed fairly quickly.
357372

358373
In general, `temporal_rs` is a pretty good test case with reference code
359-
for setting up a Rust library over FFI with usage in a C++ and Zig
360-
codebase, so that's really cool.
374+
for setting up a Rust library over FFI with usage in both a C++ and Zig
375+
codebase.
361376

362377
## Conclusion
363378

364-
The 0.1 release of `temporal_rs` is out. We expected the general API to
379+
The 0.1 release of `temporal_rs` is out. We expect the general API to
365380
remain fairly stable moving forward, with any non-patch bumps being for
366381
added features. Feel free to try it out, and provide feedback / file any
367-
issues you come across.
382+
issues you come across. Although, we will make changes and semantic
383+
versioning bumps based on feedback or the Temporal specification.
384+
385+
Our current plan is that we hope have any remaining issues addressed and
386+
the API fully stable for when Temporal is accepted by tc39 and moved to
387+
stage 4. Once Temporal is stage 4, we will move forward with a 1.0
388+
release.
368389

369390
`temporal_rs` started as an interesting experiment in creating an engine
370391
agnostic library of the Temporal API that could also be usable as a
371392
date/time library in native Rust code. We've seen pretty successful
372393
results from other engines adopting the library for use. And with any
373-
luck, it will also be useful for the Rust ecosystem as a whole.
394+
luck, we hope this library will also be useful for the Rust ecosystem as
395+
a whole as well.
374396

375397
## Special thanks
376398

377-
We'd like to thank all the contributors to `temporal_rs` for helping it
378-
get to 0.1.
399+
We'd like to thank all the [contributors] to `temporal_rs` for helping
400+
it get to v0.1.
379401

380402
Thanks to the University of Bergen students who helped drive some of the
381403
major conformance push earlier this year.
382404

383405
Also, a huge thanks to all the Temporal champions for all their work on
384406
the specification as well as the ICU4X project for their incredible
385407
ongoing work on calendars and all things i18n datetime related.
408+
409+
[mdn]:
410+
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal
411+
[v8-site]: https://v8.dev/
412+
[kiesel-site]: https://kiesel.dev/
413+
[yavashark-repo]: https://github.com/Sharktheone/yavashark
414+
[cookbook]: https://tc39.es/proposal-temporal/docs/cookbook.html
415+
[diplomat-repo]: https://github.com/rust-diplomat/diplomat
416+
[contributors]: https://github.com/boa-dev/temporal/graphs/contributors

0 commit comments

Comments
 (0)