Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

LUA is FFOC

Name: Anonymous 2011-02-05 9:01

LUA is the toy language for those who enjoy the Forced Flushing Of L1/L2 Cache per operation. In fact, every operation causes several L2 cache misses during table look-ups, flushing both the L1 and L2 caches.

http://www.slideshare.net/hughreynolds/optimizing-lua-for-consoles-allen-murphy-microsoft

Enjoy your FFOC.

Name: Anonymous 2011-02-05 9:03

Too bad LuaJIT is FAST AS VIRGIN FUCK

Name: Anonymous 2011-02-05 9:12

>>2
It'll never compare to other languages that are data-oriented and data-parallel friendly, like your old school imperative languages such as C, C++, or functional languages like Scala or F#.

LuaJIT and Lua/LLVM still using those god damn look-up tables in the JITed code.

Your idea of ``FAST AS VIRGIN FUCK'' is incorrect, as Lua is no longer a virgin, but rather a two-time whore who can't even find anyone willing to pay her $5 for a blowjob.

Name: Anonymous 2011-02-05 9:24

>>3
I lol'd; real nice.

Name: Anonymous 2011-02-05 9:25

>>1
[m]Allen Murphy ([b][u]Microsoft[/b][/b])[/m]

Yeah. A report by Microsoft about a Non-microsoft product. What exactly did you expect, a fair competition?

Besides me not even attempting to argue that Lua does indeed stated Table cache ``faults'' (if peanuts like that can even be called a fault to begin with), it's obvious that

   1.) Microsoft always makes even the least terrible fault look like a fucking drama
   2.) I have yet to read about a case where this fault actually causes any noticable trouble

So please take your rant and go to /g/, where you belong to.

Name: Anonymous 2011-02-05 9:26

>>5
Ffuuu.. BBCode.

Allen Murphy (Microsoft)

Yeah. A report by Microsoft about a Non-microsoft product. What exactly did you expect, a fair competition?

Besides me not even attempting to argue that Lua does indeed stated Table cache ``faults'' (if peanuts like that can even be called a fault to begin with), it's obvious that

   1.) Microsoft always makes even the least terrible fault look like a fucking drama
   2.) I have yet to read about a case where this fault actually causes any noticable trouble

So please take your rant and go to /g/, where you belong to.

Name: Anonymous 2011-02-05 9:32

>>5-6
You are wrong. Memory hazards and cache misses are the primary reason for slow software on modern hardware. Optimising for cache coherent hardware can reap performance gains of several orders of magnitudes. This is no laughing matter.

Mad that Microsoft has some smart developers working there? Fine, here's one from Sony for PS3/Cell development showing how important programming for cache efficiency really is.

http://research.scee.net/files/presentations/gcapaustralia09/Pitfalls_of_Object_Oriented_Programming_GCAP_09.pdf

Lua is the anti-thesis of data-oriented programming. Lua is a laughing matter. FFOC indeed.

Name: Anonymous 2011-02-05 9:38

>>7
I was asking for a case where this matters. A case that can actually be tracked down.

While in theory I'd fully agree with you, your point is pretty much a pointless one if you're entirely unable to actually prove it.

Judging by your logic, an application that is entirely written in an interpreted language (such as eve online, which is almost entirely written in Python), must be OMG FUCKING SLOW.

But how come it isn't at all? Good question indeed. Your turn.

Name: Anonymous 2011-02-05 9:44

>>8
Python does not use huge sprawling look-up tables for all object-name resolution lookups. CPython does have scalability issues due to the GIL, but this isn't a problem with IronPython or rewrites of Python targeting LLVM.

Lua's tables are deeply ingrained into the language. There's no correcting it.

Name: Anonymous 2011-02-05 9:46

>>1
That explains a lot. I was playing a puzzlequest game on the DS and it was amazingly slow. I couldn't rationalize it. It's written in Lua in no small part, and now that I know this it all makes sense.

>>5
Table cache ``faults'' (if peanuts like that can even be called a fault to begin with)
But... they are faults, by their very definiIHBT and how!

Name: Anonymous 2011-02-05 9:46

>>8
Does Eve run on consoles? Nope. I know the folks working on Batman Arhkam Asylum originally were using Lua for scripting, but performance issues forced them to rewrite all of their scripts in native C++ so that they could ship it on current generation consoles.

Name: Anonymous 2011-02-05 9:54

>>11
I know the folks working on Batman Arhkam Asylum originally were using Lua for scripting
[citation needed]

Name: Anonymous 2011-02-05 10:00

>>12
What, anecdotes aren't good enough for you?

Name: Anonymous 2011-02-05 10:12

>>7
several orders of magnitudes [sic]
If by several you mean two, in the most contrived of cases, then sure. Not that you don't have a point...

Name: noko 2011-02-05 10:35

>>14
Because what's a couple of orders of magnitude between friends? 1ms per frame or 100ms per frame, who cares, except console gay developers who are all crazy?

Name: Anonymous 2011-02-05 10:52

>>15
I think >>14 was in support of the fact that cache-conscious code is important. He did after all say he had a point. He was just pointing out the exaggeration.

That said, performance improvements of hundreds of times is a big deal.

If you don't understand the memory model of your computational hardware, you will never be able to develop fast software for it.

Name: Anonymous 2011-02-05 11:04

I think they're saying their memory and CPUs suck.
Also, "No JITting since security model forbids executing on data." WTF.

Name: Anonymous 2011-02-05 11:32

>>16
You completely misunderstood >>14-san.

Name: Anonymous 2011-02-05 12:53

>>18
I think you have misunderstood >>16

YHBT

Name: Anonymous 2011-02-07 6:55

Etymology
From Proto-Oceanic (compare Malay luah).

Verb
lua
   1. to vomit

Name: Anonymous 2011-02-07 8:25

Lua's problem is that it uses hash tables for dispatching. This limits Lua to single dispatch in addition to making everything slow and rigid. You cant redefine `+` in Lua, as I do in my Lisp DSL

`+` a:Num b:Str -> "$a$b"
`+` a:Str b:Num -> "$a$b"


neither you can union two types

userFriendly? x:string? -> ye
userFriendly? x:picture? -> ye

Name: Anonymous 2011-02-07 8:28

And of course Lua doesnt have Lisp macros, which are very nice to have, especially when entering arbitrary complex game logic.

Name: Anonymous 2011-02-07 8:30

>>21
`+`
U MENA HASKAL‽

Name: Anonymous 2011-02-07 8:33

>>23
Haskell HAS NO MULTIDISPATCH
http://en.wikipedia.org/wiki/Multidispatch

Name: Anonymous 2011-02-07 8:56

>>24
Your ``in Lisp'' DSL is just Perl 6 with a lisp and ML/Haskell syntax:
Operator overloading (Perl 6 does it better)
Lisp macros (Perl 6 does it worse(?))
Multidispatch
Pattern matching
$
Num and Str
SYNTAX. SYNTAX EVERYWHERE

In conclusion:
WHBTC

Name: Anonymous 2011-02-07 9:01

>>25
>Operator overloading (Perl 6 does it better)
You wrong. DSL doesnt do operator overloading. It does pattern matching. That is: I can write

hasUserFriendlyObject [@_ x:userFriendly? @xs] -> [x xs]

meaning find first `userFriendly?` object, then return it and rest of the list. Doubt that Perl does this.

Name: Anonymous 2011-02-07 9:01

>>24
Haskell via Multi-parameter type classes
You just failed.

Name: Anonymous 2011-02-07 9:03

>>26
Or better yet:

hasUserFriendlyObject @_ x:userFriendly? @xs -> [x xs]

Because conceptually functions accept single argument - list.

Name: Anonymous 2011-02-07 9:04

>>27
>C/C++ via visitor pattern
we all see where haskell's place is - right between cobol and pascal

Name: Anonymous 2011-02-07 9:09

>>26,28
I'm sure you can, with a macro.

Name: Anonymous 2011-02-07 9:11

>>30
CL allows variable length arglists, so I dont even need macro for this.

Name: Anonymous 2011-02-07 9:13

>>31
Everything allows variable length arglists, so you don't even need a macro for this. But you need it for pattern matching.

Name: Anonymous 2011-02-07 9:14

>>32
Its embedded in `lambda`. So iam always a few keystrokes away from it.

Name: Anonymous 2011-02-07 9:16

>>33
It's embedded in `sub`. So I am always a few keystrokes away from it.

Name: Anonymous 2011-02-07 9:18

>>34
Please, implement >>28 in Perl.

Name: Anonymous 2011-02-07 9:22

>>35
Basically, it does a (drop-while user-friendly? xs), >>26,28 it's unscientific and ultimately bloated.

Name: Anonymous 2011-02-07 9:23

Lisp:

f [x _ @xs] -> x+xs.f

Haskell:

f = sum . map snd . filter (odd.fst) . zip [1..]

Name: Anonymous 2011-02-07 9:23

>>36
*(drop-while (negate user-friendly?) xs)

Name: Anonymous 2011-02-07 9:23

>>36
So, you cant? Q.E.D.

Name: Anonymous 2011-02-07 9:24

LISP:

f l -> subst l.max l.{[x]->x; [x _ @xs]->x+xs.rec}/l.len l


F#

let quux (a : array<int>) =
 
    let (s,_,m) = Array.fold
               <| fun (s,p,m) x -> let nx = if x > m then x else m
                                   if p then (s+x, false, nx)
                                        else (s,   true,  nx)
               <| (0,false,a.[0]) <| a
 
    Array.map  <| function | x when x=m -> s / (Array.length a / 2)
                           | x          -> x
               <| a

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List