# StaticStrings.jl v0.3, move to JuliaStrings

**URL:** <https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648>\
**Category:** Package Announcements\
**Tags:** strings, ntuple\
**Created:** [September 24, 2026, 7:24pm UTC](https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648 "2026-09-24T19:24:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [September 24, 2026, 7:24pm UTC](https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648/1 "2026-09-24T19:24:45Z")

</div>

# **StaticStrings v0.3.0**

[StaticStrings.jl](https://github.com/JuliaStrings/StaticStrings.jl) v0.3 was just released and has joined the JuliaStrings Github organization. Special thanks to @PatrickHaecker for major contributions to this release.

StaticStrings.jl contains several string types which wrap a `NTuple{N, UInt8}` for strings of fixed length strings similar to InlineStrings.jl. The main difference is that StaticStrings.jl uses an `NTuple` whereas InlineStrings.jl uses integer types as a backing store.

Here are the release notes for version 0.3:

## Release Notes

[Diff since v0.2.6](https://github.com/mkitti/StaticStrings.jl/compare/v0.2.6...v0.3.0)

- Breaking changes for `CStaticString`
- Use of `unsafe_string` and `unsafe_write` for performance
- Deprecate `StaticStrings.data` in favor of `Tuple`
- Many contributions by **[@PatrickHaecker](https://github.com/PatrickHaecker)**

**Merged pull requests:**

- fix: remove convert for AbstractStaticString{N} which causes invalidation ([#21](https://github.com/JuliaStrings/StaticStrings.jl/pull/21)) (**[@Beforerr](https://github.com/Beforerr)**)
- Throw in `SubStaticString` constructor without making it slower ([#22](https://github.com/JuliaStrings/StaticStrings.jl/pull/22)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)
- Implement a more efficient `codeunit` for `SubStaticString` ([#23](https://github.com/JuliaStrings/StaticStrings.jl/pull/23)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)
- Allocation-free `write` and `print` for `PaddedStaticString` ([#24](https://github.com/JuliaStrings/StaticStrings.jl/pull/24)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)
- Copy only relevant parts of a `SubStaticString` when generating a `String` ([#25](https://github.com/JuliaStrings/StaticStrings.jl/pull/25)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)
- Fix `cmp` ([#26](https://github.com/JuliaStrings/StaticStrings.jl/pull/26)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)
- Avoid allocations in SubStaticString equality ([#27](https://github.com/JuliaStrings/StaticStrings.jl/pull/27)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)
- Optimize `SubStaticString` by directly writing bytes ([#28](https://github.com/JuliaStrings/StaticStrings.jl/pull/28)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)
- Use the optimized `write` to optimize `print` for `SubStaticString` ([#29](https://github.com/JuliaStrings/StaticStrings.jl/pull/29)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)
- Unify `write` and `print` methods to have all types accelerated ([#30](https://github.com/JuliaStrings/StaticStrings.jl/pull/30)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)
- Restrict `SubStaticString` to `Integer` `AbstractUnitRange`s ([#31](https://github.com/JuliaStrings/StaticStrings.jl/pull/31)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)
- Make types consistent ([#32](https://github.com/JuliaStrings/StaticStrings.jl/pull/32)) (**[@PatrickHaecker](https://github.com/PatrickHaecker)**)

**Closed issues:**

- StaticStrings on GPU, code\_warntype on StaticString generation ([#20](https://github.com/JuliaStrings/StaticStrings.jl/issues/20))

## Upstream issue for JuliaLang/Julia

In reviewing Patrick’s work, I realized that Julia is missing facilities to populate a `Vector{UInt8}` or `Memory{UInt8}` from a `NTuple{N,UInt8}` efficiently. I created an issue documenting the lack of autovectorization for this route and potential new methods for `copyto!`.

- [Copying from an NTuple into an Array/Memory neither vectorizes nor forms a memcpy · Issue #63335 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/63335)

## Future Plans

- I was originally inspired to create this package to address fixed length strings coming from I/O libraries such as HDF5.jl. I never finished actually integrating this with I/O packages, so I hope to pursue that.
- I also noticed that an `AbstractString` that wraps an existing `Memory{UInt8}` may be useful. I am unsure whether to add this to StaticStrings or if I should start a new package.
- Your pull requests are welcome.

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [September 24, 2026, 7:33pm UTC](https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648/2 "2026-09-24T19:33:17Z")

</div>

> [@mkitti](#):
>
> - I also noticed that an `AbstractString` that wraps an existing `Memory{UInt8}` may be useful.

I think the new `StringView` type in 1.14 or in StringViews.jl can do this.

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [September 24, 2026, 7:38pm UTC](https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648/3 "2026-09-24T19:38:44Z")

</div>

Interesting. An alternative implementation of a StaticString could be a StringView of a StaticVector from StaticArrays.jl.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 25, 2026, 12:42am UTC](https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648/4 "2026-09-25T00:42:44Z")

</div>

Split this topic on September 25, 2026, 12:42am UTC

3 posts were split to a new topic: [Documentation for suffixes of string macros?](https://discourse.julialang.org/t/documentation-for-suffixes-of-string-macros/139658)

---

<div class="post-metadata">

**Author:** ![PatrickHaecker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patrickhaecker/32/222891_2.png) [@PatrickHaecker](https://discourse.julialang.org/u/PatrickHaecker)\
**Post date:** [September 25, 2026, 3:21am UTC](https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648/5 "2026-09-25T03:21:44Z")

</div>

> [@mkitti](#):
>
> An alternative implementation of a StaticString could be a StringView of a StaticVector from [StaticArrays.jl](https://juliaregistries.github.io/General/packages/redirect_to_repo/StaticArrays).

Technically definitely interesting. However, from an ecosystem point-of-view it will probably take quite some time until `StringView` is available in Julia lts. While Julia 1.13 has the potential to be the next lts, an lts with `StringView` could still be 3 to 4 years away.

So in order to be useful _now_, this probably would need to be behind an interface with a fallback to a different implementation for older Julia versions with the same functionality only being slower.

---

<div class="post-metadata">

**Author:** ![jakobnissen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jakobnissen/32/13477_2.png) [@jakobnissen](https://discourse.julialang.org/u/jakobnissen)\
**Post date:** [September 25, 2026, 5:35am UTC](https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648/6 "2026-09-25T05:35:27Z")

</div>

I believe the core devs are aiming for 1.14 as the new LTS, but, like previous LTS releases, this will only be decided when 1.15 is released (as then can then retroactively judge if 1.14 was good enough to become LTS). So we’ll probably have `StringView` in the next LTS.

Indeed, @mkitti and @PatrickHaecker is it one of the design goals of `StringView` strings could be implemented in terms of them. If you want to use string views on Julia versions \< 1.14, you should use StringViews.jl. This is an established package, and is the implementation that has been ported to Base. On Julia version 1.14 and newer, StringViews.jl is a stub package that simply re-exports the Base type and does nothing else. StringViews.jl is compatible with Julia 1.6.

I recommend you move the implementation to using string views, and then upstream PRs to any issues. Other than it being slightly annoying to have to upstream issues to Base, in theory there should be no downside, and adhering to one underlying implementation would help consolidate the semantics around strings-versus-codeunits in Julia.

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [September 25, 2026, 8:26am UTC](https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648/7 "2026-09-25T08:26:59Z")

</div>

I tried this package for the first time. FWIW, compile-time parsing works:

```julia-repl
julia> using StaticStrings

julia> const s = static"123";

julia> function sum_digits()
           sum(convert(Int, c-UInt8('0')) for c in codeunits(s))
       end
sum_digits (generic function with 1 method)

julia> sum_digits()
6

julia> @code_typed sum_digits() # the compiled code is a trivial return
CodeInfo(
1 ─ return 6
) => Int64

```

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 25, 2026, 8:44am UTC](https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648/8 "2026-09-25T08:44:19Z")

</div>

> [@PatrickHaecker](#):
>
> So in order to be useful _now_, this probably would need to be behind an interface with a fallback to a different implementation for older Julia versions with the same functionality only being slower.

Realize that the `StringView` type in Juia 1.14 is essentially just the code from StringViews.jl (which supports Julia 1.6+) ported into `Base` (with a little bit of code de-duplication). Performance-wise, there should be essentially no difference.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 25, 2026, 8:54am UTC](https://discourse.julialang.org/t/staticstrings-jl-v0-3-move-to-juliastrings/139648/9 "2026-09-25T08:54:42Z")

</div>

> [@jakobnissen](#):
>
> I recommend you move the implementation to using string views

An implementation using StringViews and StaticArrays seems like it could be pretty minimal. If you do:

```julia-auto
using StringViews, StaticArrays

const StaticString{N} = StringView{SVector{N, UInt8}} # type alias

macro static_str(s)
    bytes = tuple(codeunits(s)...)
    return :(StringView(SVector($bytes)))
end

```

then a lot of things just work:

```julia-auto
julia> s = static"🚀"
"🚀"

julia> typeof(s)
StringView{SVector{4, UInt8}}

julia> s isa StaticString{4}
true

julia> s[1]
'🚀': Unicode U+1F680 (category So: Symbol, other), input as \:rocket:<tab>

julia> codeunits(s)
4-element SVector{4, UInt8} with indices SOneTo(4):
 0xf0
 0x9f
 0x9a
 0x80

```

However, if you want to define custom operations, like static concatenation of two static strings, then seems like it will be tricky right now to avoid type piracy unless you define a wrapper type and forward a lot of methods, or use a different function name (rather than overloading a `Base` function like `*`), or push the implementation into StaticArrays.jl.

I guess it depends on what kind of use-case you have in mind. If you just want to _store_ them efficiently (e.g. in an array or an HDF5 file), then it’s not clear whether you need much more than the type above.

(If the implementation becomes small enough, it’s not crazy to me to simply make `SString` a type defined in StaticArrays.jl … then you can write whatever custom methods you want and it won’t be type piracy.)
