Live data from Hacker News

Terra – a low-level counterpart to Lua

terralang.org

31–40 of 49 posts

Re: Terra – a low-level counterpart to Lua

#34
post #29
post #8

Earlier quoted context omitted.

Lower level, so more control for advanced programs performance-wise.

And what it may give us at lower level, comparing to LuaJIT + ffi + ljsyscall?

Code generators can, for some problems, write code that's faster than hand-written code simply because the sheer complexity of the result is pretty much impossible to handle "in yer brain".

This kind of highly problem-specific optimal code-building is out of scope for any kind of JIT, including luaJIT.

Have a look at Dan Amelang's jitblt:

http://www.vpri.org/pdf/tr2008002_jitblt.pdf

Re: Terra – a low-level counterpart to Lua

#35
post #2

As a speaker about Lua, this is awesome news. Yet, it also feels kinda pointless, most Lua use right now is in embedded interpreters in other software, and Terra would be hard to use, since most projects probably won't incorporate it at all.

That's changing rapidly, especially after LuaJIT and ngx_lua gained some publcity.

Re: Terra – a low-level counterpart to Lua

#37
post #19

At first I was confused because the pitch seemed to be mainly about writing fast code with Lua. If that's what they're going for, then a comparison with LuaJIT is sorely missing. But it appears that what they're actually pitching is a simple and flexible code generation environment . It's a way to generate statically-typed code at runtime that targets LLVM but looks nicer than this: http://llvm.org/releases/2.6/docs/…

Author here. You're right that we designed Terra primarily to be an enviornment for generate low-level code. In particular, we want to be able to easily design and prototype DSLs and auto-tuners for high-performance programming applications. We explain this use-case in more detail in our upcoming PLDI paper ( http://terralang.org/pldi071-devito.pdf ). Since we are primarily using it for dynamic code generation, I hav…

Than you so much for this. You actually implemented Haskell/Caml for us, mere mortals, and as close to bare metal as possible. Bravo!

Re: Terra – a low-level counterpart to Lua

#39
post #33

Does it really need that "terra" keyword? You could use the type annotation to differentiate: -- lua function function foo(a,b) ... end -- terra function function foo(a:int, b:int) ... end

I think it looks very clean. I've always liked Lua's use of full keywords (e.g. function and end) and if the function didn't take any arguments then how would you know it's a terra function?

Re: Terra – a low-level counterpart to Lua

#40
post #19

At first I was confused because the pitch seemed to be mainly about writing fast code with Lua. If that's what they're going for, then a comparison with LuaJIT is sorely missing. But it appears that what they're actually pitching is a simple and flexible code generation environment . It's a way to generate statically-typed code at runtime that targets LLVM but looks nicer than this: http://llvm.org/releases/2.6/docs/…

Author here. You're right that we designed Terra primarily to be an enviornment for generate low-level code. In particular, we want to be able to easily design and prototype DSLs and auto-tuners for high-performance programming applications. We explain this use-case in more detail in our upcoming PLDI paper ( http://terralang.org/pldi071-devito.pdf ). Since we are primarily using it for dynamic code generation, I hav…

[deleted]
Post reply on HN