Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
kobenz868289d@Ranchonyx zero-copy, ultrafast strings! I'm going nuts here, it even comes with a fast as fuck serializer for ANY Lua value, decoding AND encoding.
FUCK, the possibilities are jaw dropping: Immutability! Pattern matching! Data storage! Not that that shit wasn't already possible, but now I don't need a fuck ton of logic for it.
-----
*Lua strings suck, it's like teenage pregnancy, any "just the tip" and it's "boom! new string!", even if you've just added a single character, the whole thing's considered new shit, stored for "reuse". -
KDSBest771289d@kobenz I don't know what you are talking about tbh. Most string implementations do spawn new strings if you append something.
In C# there is the String Builder Class to prevent that if you want to concat many strings. -
kobenz868289d@KDSBest oh, no, if only it was just that. all strings in Lua are internalized. Lua will keep a single copy of EVERY unique string and it will check every string in your code so it can make sure it has all of them, it doesn't matter if you'll never use it again, Lua will hoard it
-
kobenz868289dthere's no "oh but this one's made up of those other two". Nop, to Lua, the third one will be a whole different string
-
CoreFusionX3532287dAs it just so happens with every language that considers strings as immutable, C does it, C# does it, Java does it...
-
kobenz868286d@KDSBest if I had that option I wouldn't be using it lol
@CoreFusionX nope, to be clear, you can't index a Lua string
---
shit, at least it's not indentation scoped
maybe I'm a simpleton, but I've just found out about LuaJIT's string.buffer and I'm procrastinating the heck out of it right now 🤤🤤🤤
random