gleam-lang/gleam

Lift literal expressions to top-level constants in JavaScript code generation

Open

#4,090 opened on Dec 17, 2024

View on GitHub
 (7 comments) (0 reactions) (0 assignees)Rust (21,417 stars) (960 forks)batch import
help wanted

Description

  1. make a massive list in gleam

you can use gleam csv package to turn a csv file to gleam list then do io.debug(parssed_csv)

  1. make the list be let list = [ // here will be the long list ]

  2. do some computation to the data for me it was getting a specific element from the list

  3. change the list from let list = to const list

(make sure its a process that would take 1 or more seconds so you can notice the difference visually)

i noticed this in a lustre application i needed to get the element number 34 from list number 77 this took 4 seconds just by changing the list to const it was instant

( the version this happened on was 1.5 iirc it good to test if it still happens now )

Contributor guide