this post was submitted on 12 Feb 2026
65 points (100.0% liked)

Programming

25522 readers
328 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] lime@feddit.nu 1 points 13 hours ago (1 children)

yeah that's probably when you should drop down to C.

[–] SlurpingPus@lemmy.world 3 points 11 hours ago (1 children)

Eh, dkjson implements null as an object with a metatable function that encodes it back as "null". Hopefully it's considered equal to itself in comparisons.

Dkjson is fast enough for most scripting purposes. OTOH cjson's userdata null is supported by some other libraries that deal with data structures.

Of course, there's a problem then that various libs may have their own nulls, not equal to each other. There's even a lib that tries to marry some of them.

[–] lime@feddit.nu 1 points 9 hours ago (1 children)

interesting! it should be equal since it's always just a pointer to that same table.

[–] SlurpingPus@lemmy.world 1 points 9 hours ago (1 children)

I just never tried, so amn't entirely sure.

Iirc I needed a json lib on Windows, or was just fed up with compiling things for some reason, and used dkjson instead of cjson. It turned out to be more than adequate, as is pretty typical for Lua-only code. Although it can use the LPeg lib to speed up parsing.

[–] lime@feddit.nu 1 points 6 hours ago

yeah there's a lot of regex in there so i definitely get wanting some compiled parts.