HNHacker News
TopNewBestAskShowJobs

QuaternionsBhop

90 karma · joined June 1, 2024

submissionscomments
QuaternionsBhop··on Introducing tmux-rs
My understanding is that the author was referring to there being more segfaults in programming than in gardening.
QuaternionsBhop··on Dear diary, today the user asked me if I'm alive
Reading the comments about whether AI can experience consciousness, I like to imagine the other direction. What if we have a limited form of consciousness, and there is a higher and more complete "hyperconsciousness" that AI systems or augmented humans will one day experience.
QuaternionsBhop··on Why You Should Learn Linux (As a Developer)
Backwards terminal compatibility, hooray! Ctrl+C inputs an ascii command code. To copy/paste, you can use Ctrl+Shift+C/Ctrl+Shift+V.
QuaternionsBhop··on Robot dentist performs first human procedure
Who will be making the open mouthed vowel sounds? You or the robot?

https://www.youtube.com/watch?v=qobhDJ_vEOc

QuaternionsBhop··on What I think about Lua after shipping a project with 60k lines of code
Local by default would have been a much better choice. The entirety of my code looks like local this local that. In all my years of Lua I have only found 1 reason to use a global variable: in Love2D when loading a texture, a local variable will go out of scope and get garbage collected, resulting in a black texture, but a global variable will not. Maybe it's even been fixed by now, as that was years ago.
QuaternionsBhop··on What I think about Lua after shipping a project with 60k lines of code
I agree with this, but my point was that I cannot hide the details from myself, and will bring them up when they are relevant and confuse my poor friend just trying to learn Lua.

Definitely very little effort picking up my toy again after a 6 month break

QuaternionsBhop··on What I think about Lua after shipping a project with 60k lines of code
No, Lua does not, but check out Roblox's Luau which is a gradually typed extension of Lua.
QuaternionsBhop··on What I think about Lua after shipping a project with 60k lines of code
> I think he was just offering the perspective of someone else that has also written a lot of Lua.

This is what I was going for, but I am a recent Rust convert and cannot help myself from gushing over Rust. Sorry!

QuaternionsBhop··on What I think about Lua after shipping a project with 60k lines of code
I know that I would have found strong types constraining when I first started learning Lua in 2009, but do you ever really need to change the type of a variable after you create it? I did a lot of hacks using ternary true-false-nil and drive-by appending random state to a table it doesn't belong in, to be recalled later in some other random place in the code. The lack of rules makes even following your own ideas of structure easy to cheat and subvert.

I think your comment about opposite end of the spectrum has merit, because I find the strict rules to be refreshingly binding to my coding ideals. Rust is ergonomic to think in, and I have even used it to prototype things before implementing them in Lua.

To me, Rust vs Lua is changing a struct and then simply following the chain of compiler errors instead of trying to remember every last place a mushy table gets manipulated.

QuaternionsBhop··on What I think about Lua after shipping a project with 60k lines of code
After 10 years and many projects, the greatest with 40k lines of code including a time-of-intersection-solving single body physics system, I have come to know how to use Lua for my purposes. Even so, from the moment I started watching Rust hype videos on YouTube, I knew I would eventually be converted into a Rust fanatic. At the end of a 2 year project to rewrite my Lua game with a new physics system, I felt it was a good time to learn Rust (and rewrite the game again in Rust). So far I have spent 6 months in Rust and my old tool looks like a toy. How did I ever live without iterators, algebraic data types, the safety of a strong type system, and especially separate types for arrays and hashmaps for god sakes?

Lua makes the scope of learning programming smaller compared to other languages, so it is probably fair to say that it is a good language to learn programming with. However, knowing the details of heap vs stack, array vs hashmap, and explaining that to someone learning programming for the first time within a language that attempts to hide those details is frustrating. I can't see the smaller picture and view a table simply as a thing that you get and set values from, I can't see the weak types as anything more than an annoying source of bugs at runtime, and I crave the borrow checker which saves me from myself.

My 10 years of Lua set me up to appreciate Rust's fantastic design choices, and I'm having a great time in Rust land. I wish to remain in Rust land but my finances demand me to use my Lua skills at least a little while longer. End of ramble

← PreviousPage 2 of 2