An unofficial, read-only Hacker News reader.

Lua for data representation (2025) (opens external site)

104 points by vinhnx 4 days ago | citrons.xyz | 61 comments on HN

View full thread · View on Hacker News

Comment thread (6)

  1. In my experience, tying your data format to a programming language is a mistake you most likely will pay for later. For example, when you need access to that data from a different programming language.
    Replies (1)
    1. I agree, but Lua is the singular language that might just maaaybe be the exception to that sometimes.

      If you need to access the data from a different language, you just load Lua in the other language.

      Replies (2)
      1. Many non-Lua folks don't understand this point: once you've got it in Lua you can put it in anything, anywhere.
        Replies (1)
        1. One nice thing about Lua is that there are Lua implementations in Rust, C, C#, Go, Javascript, Kotlin, and there’s even a compiler which converts Lua scripts in to native machine code.
      2. While I am even doing that in a project if mine, I'd rather not load Lua and instead just run `serde_json::from_str()` or similar.
        Replies (1)
        1. using json is an option (which is mentioned in the article). But lua gives you some features that json cannot match - it's powerful, may be too powerful tbh.