Better HN
topnewbestaskshowjobs
Log inSign up

slashdev

17,493 karma · joined May 14, 2013 (13y ago) · 5,497 submissions

Founder of revscope.co

Revenue focused web analytics to help you quickly identify where to focus your effort to best increase revenue.

And embersofvictory.com

Retro turn-based strategy game.

Submissions

5491.

Are humans a hybrid between two disparate species?(macroevolution.net ↗)

2 points · by eloff · 13y ago · discuss

comment 13y ago · link · parent

Maybe try another country where people are shorter and men from the US are more attractive to the local women. I'm an average height average looking fellow from Canada. But living in Latin America I strut around like a Norse god. I'm dating a model right now - I never thought I'd say that.

comment 13y ago · link · parent

I think the first step is to stop caring about looking like an idiot. The trick is to be confident that you're not actually an idiot. Then you can look like one, and people can laugh at you, and you can laugh right along with them because you do look rather dumb, but you never think for a moment that you actually are an idiot. Tell yourself enough that you don't care what others think about you, and that what really matters is what you think about you, and you'll start to believe it and actually have that kind of confidence. If you don't have it, fake it until you have it ;)

comment 13y ago · link · parent

Reading your description of all the things you can learn about your own breathing reminds me of a line in a Seinfeld episode when Tia the model turns to Jerry and says: "I've never met a man who knew so much about nothing"

comment 13y ago · link · parent

To answer my own questions, yes it uses (relies on) LuaJIT and there seems to be no problem running multiple Lua states, each using Terra. In fact because of the independent nature of compiled Terra code, I would wager you can create the Lua states with Terra and threads from within Terra itself. LuaJIT actually can't do this currently, you need a little bit of C code, because the callback passed to pthread_create will be invoked in a new thread on the old state (which would be invalid in LuaJIT as you can't share a state across threads like that.) Anyway I'll try it out and submit it as a test case for Terra if it works.

comment 13y ago · link · parent

Yes, that's true, except for the calling into non-Lua libraries, this is where LuaJIT + ffi really shines. It can actually optimize away boxing/unboxing and inline the native function call into the trace (not the body of the native function, but the call itself.) Surely you're referring to something else? The often repeated wisdom on the LuaJIT mailing list is only use the Lua C API for legacy code as it can't come close to the performance or ease of use of the ffi. If your experience is otherwise, maybe the JIT bailed on your test code? The ffi is very slow without the JIT.

String and memory limitations have yet to bother me at all because anywhere speed matters you get order of magnitude improvements by managing the strings/memory yourself via the ffi. With Terra, it's clear that's the approach being advocated as well. I agree it really bolluxes small benchmarks, especially if the code is written for Lua and not done the "LuaJIT way" with the ffi. Outside of embedded or other exotic environments I think one would be hard-pressed to come up with a real-world workload where Lua PUC outperforms LuaJIT and there's no easy way to turn the tables. There are just far more options for optimization with LuaJIT and more ability to get closer to the metal than you have with Lua PUC.

None of that is to take away from what the Lua PUC guys have accomplished. Like any craftsmen who enjoys his work, I just like to use the best tools. That's LuaJIT in my opinion, and now Terra too.

comment 13y ago · link · parent

So it's using LuaJIT and not PUC Lua? (A good thing to be sure, as LuaJIT is much faster, even without the JIT.)

Is there a way to run Terra with a separate Lua state per thread? So as to not have the problem with serializing when calling Lua from Terra?

1
180181182183184