DEV Community

Swastik Baranwal
Swastik Baranwal

Posted on

2

What's the need of rune as a separate type?

Why there is need of rune i.e. Unicode strings as a separate type from string i.e. ASCII strings? Couldn't it just both type of strings have one type i.e. string like how languages have it?

Top comments (3)

Collapse
 
nickholmesde profile image
Nick Holmes

Two things;

A rune represents a single Unicode Code Point (UTF-32 encoded, I assume).

A string represents a sequence of Unicode Code Points, UTF-8 encoded (in Go).

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay