Live data from Hacker News

Lua Fun: A high-performance functional programming library designed for LuaJIT

github.com

11–20 of 34 posts

Re: Lua Fun: A high-performance functional programming library designed for LuaJIT

#11
It's quite interesting to see essencially the ideas used in stream fusion [1] to produce practically the same results produced in Haskell, avoiding allocations and often making it much easier for the compiter ro produce vectorised code. At least that's what it looks like to me, correct me if I'm wrong.

Edit: [3] has a good exlanation of how stream fusion works, and it should make it clearer why the linked code appears to be doing the same thing.

see also here[2] for a further paper on stream fusion being used to produce vectorised code. I've linked to the reddit comments because there's some useful discussion there too.

[1] http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.104.7...

[2] http://www.reddit.com/r/haskell/comments/1br0ls/haskell_beat...

[3] http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c...

Re: Lua Fun: A high-performance functional programming library designed for LuaJIT

#12
post #2

Even though we occassionally talk about Lua on HN, it frankly still doesn't get enough attention - nor does Mike Pall and his fantastic work on LuaJIT. Please considering sponsoring [1] LuaJIT so that Mike can continue working on it. Lua Fun looks like a wonderful addition to the Lua ecosystem. [1] http://luajit.org/sponsors.html

> Even though we occassionally talk about Lua on HN, it frankly still doesn't get enough attention - nor does Mike Pall and his fantastic work on LuaJIT.

Because most HNers are web developers and care only about the browser.

Lua is really strong in the game developer community.

Re: Lua Fun: A high-performance functional programming library designed for LuaJIT

#13
post #12
post #2

Even though we occassionally talk about Lua on HN, it frankly still doesn't get enough attention - nor does Mike Pall and his fantastic work on LuaJIT. Please considering sponsoring [1] LuaJIT so that Mike can continue working on it. Lua Fun looks like a wonderful addition to the Lua ecosystem. [1] http://luajit.org/sponsors.html

> Even though we occassionally talk about Lua on HN, it frankly still doesn't get enough attention - nor does Mike Pall and his fantastic work on LuaJIT. Because most HNers are web developers and care only about the browser. Lua is really strong in the game developer community.

Most? I'd say far from most. I see just as many articles about Go, Scala, Clojure, etc. as I do Javascript.

Re: Lua Fun: A high-performance functional programming library designed for LuaJIT

#15
post #12

Earlier quoted context omitted.

> Even though we occassionally talk about Lua on HN, it frankly still doesn't get enough attention - nor does Mike Pall and his fantastic work on LuaJIT. Because most HNers are web developers and care only about the browser. Lua is really strong in the game developer community.

Most? I'd say far from most. I see just as many articles about Go, Scala, Clojure, etc. as I do Javascript.

How much of those are for native applications? The realm where Lua tends to be used most.

Re: Lua Fun: A high-performance functional programming library designed for LuaJIT

#16
post #12
post #2

Even though we occassionally talk about Lua on HN, it frankly still doesn't get enough attention - nor does Mike Pall and his fantastic work on LuaJIT. Please considering sponsoring [1] LuaJIT so that Mike can continue working on it. Lua Fun looks like a wonderful addition to the Lua ecosystem. [1] http://luajit.org/sponsors.html

> Even though we occassionally talk about Lua on HN, it frankly still doesn't get enough attention - nor does Mike Pall and his fantastic work on LuaJIT. Because most HNers are web developers and care only about the browser. Lua is really strong in the game developer community.

openresty is getting a lot more attention with web developers. and I think its actually strongest in the "other" category but a lot is not very public.

Re: Lua Fun: A high-performance functional programming library designed for LuaJIT

#17

In case you skipped the article it contains this nugget: Take this example containing functional composition and higher-order functions: reduce(operator.add, 0, map(function(x) return x^2 end, range(n))) LUA converts this into 10 lines of assembler (2 jumps). Also, the LUA compiler is directly generating SSE. Anyone have any good benchmarks comparing simple functional examples in LUA with Clojure or Common Lisp?

probably not. this is the first time I have seen the outcome of optimising this type of code. I knew it was possible as it optimises my tail recursion.

Re: Lua Fun: A high-performance functional programming library designed for LuaJIT

#19
post #12

Earlier quoted context omitted.

> Even though we occassionally talk about Lua on HN, it frankly still doesn't get enough attention - nor does Mike Pall and his fantastic work on LuaJIT. Because most HNers are web developers and care only about the browser. Lua is really strong in the game developer community.

Most? I'd say far from most. I see just as many articles about Go, Scala, Clojure, etc. as I do Javascript.

Yes, but usually in the context of web development as these are common server side languages for web apps.

pjmpl just meant we don't see a lot of game developer content on here, which is largely a C++ dominated area (with Lua game scripting becoming a lot more common).

Re: Lua Fun: A high-performance functional programming library designed for LuaJIT

#20

In case you skipped the article it contains this nugget: Take this example containing functional composition and higher-order functions: reduce(operator.add, 0, map(function(x) return x^2 end, range(n))) LUA converts this into 10 lines of assembler (2 jumps). Also, the LUA compiler is directly generating SSE. Anyone have any good benchmarks comparing simple functional examples in LUA with Clojure or Common Lisp?

I know nothing about LUA syntax, so I also have no idea which part of this is new and which part is ordinary LUA.

Is -- calculate sum(x for x^2 in 1..n) a comment or is it the output of a code transform?

Post reply on HN