Skip to content

pietroppeter/adventofcode2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adventofcode2023

My solutions for advent of code 2023

day 01 - learning about graphemes

Thanks to gleam, which uses graphemes natively in the stdlib, I have a better understanding of the concept of graphemes. It is pretty cool that gleam has them as the default tool for processing "perceived" characters in the stdlib.

Languages I am used to (Python, Nim) can access graphemes as relatively unknown third party libraries:

I see Rust has theme in a crate:

And Elm also has a nice 3rd party library:

The standard reference for implementation is this Unicode annex: http://www.unicode.org/reports/tr29/

Gleam seems to indeed get this from Erlang: https://www.erlang.org/doc/man/string (I see no mention of Unicode Annex 29 but it seems the implementation is the same). In gleam source code:

See also gl/src/graphemes.gleam for a few examples in gleam.

From further discussion in gleam discord, I was pointed ou that Elixir: