Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hugomg
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
hugomg
1y ago
We figured that it wasn't worth dealing with the hassle of unaligned addresses because the more portable alternatives worked just as well.
2.
▲
by
hugomg
2y ago
tl;dr: For Pallene, Lua is a scripting language. For Terra, Lua is mainly for metaprogramming. The key difference is that Terra cannot directly manipulate Lua data. Although Terra's syntax is similar to Lua, its type systems and data s
3.
▲
by
hugomg
2y ago
The difference is the Lua-C API. The default Lua-C API is designed for humans: it is stable and safe to use, but every operation must pay the cost of function calls and passing data through the Lua stack. Pallene bypasses the API and reache
4.
▲
by
hugomg
2y ago
> I can just as good implement it in C using the Lua C API Pallene beats C when the code uses many Lua data structures. Acessing Lua data from C via the Lua-C API has significant overhead that can erase the gains from rewriting into C. A
5.
▲
by
hugomg
2y ago
(I'm one of the Pallene authors) For compiled code, Pallene's performance can be comparable to LuaJIT[1]. Pallene might be better in code with unpredictable branches, which don't fit in a single trace. LuaJIT has the edge in
6.
▲
by
hugomg
6y ago
Pallene and Teal are in a bit of a different space. Teal is focused on compile-time type checking. The intention is to encourage you to add type annotations to your entire Lua codebase. It's another take at the problem that Typed Lua w
7.
▲
by
hugomg
6y ago
It wouldn't be the JS we know and love if it had been burdened with a type system designed by a committee sometime in the 90s. That said, one thing we can say for sure is that the dynamic typing doesn't make your job any easier :)
8.
▲
by
hugomg
6y ago
I always love reading more about JavaScriptCore internals although I have to confess that much of the time one of the main lessons I get from it is that life would be much easier if we had types and didn't need to speculate so much in
9.
▲
by
hugomg
6y ago
If you are curious, this is what the resulting format string looks like after expanding all the macros: https://gist.github.com/hugomg/73e91ebca7ced3c5c6f955e9e830b...
10.
▲
by
hugomg
7y ago
We chose the Pallene name because it was another one of Saturn's moon names that sounded nice, and is pronounced the same way in English and Portuguese. The Mike Pall thing was just a coincidence although we certainly can't deny h
11.
▲
by
hugomg
7y ago
It is no surprise that the benchmarks on the LuaJIT website are going to show it ahead of PUC-Lua, is it? In truth the performance comparison is a bit more complicated than that. :) For a pure Lua comparison LuaJIT is typically going to bea
12.
▲
by
hugomg
7y ago
In case others aren't familiar with the termiology: #SAT is the counting version of the SAT problem, which tries to find how many different solutions exist to a set of constraints)
13.
▲
by
hugomg
7y ago
Some SAT solvers allow you to add additional constraints while they are running. So you can find a solution and then add additional constraints to try to get it to find a better one.
14.
▲
by
hugomg
7y ago
Generally speaking, if you ever find yourself coding a brute-force backtracking search for some combinatorical problem, it might be a good idea to consider using a SAT solver instead. This way you get to take advantage of the non-chronologi
15.
▲
by
hugomg
7y ago
Seeing someone cite a little project I did for fun many years ago is a very nice surprise. :)
16.
▲
by
hugomg
8y ago
Yes.
17.
▲
by
hugomg
8y ago
Currently there is no special support for metaprogramming, but maybe we could borrow some ideas from Terra in a future version...
18.
▲
by
hugomg
8y ago
Wow, I hadn't thought of that. Its a complete coincidence, actually!
19.
▲
by
hugomg
8y ago
From the point of view of Lua, Pallene works the same as C If you want to produce a standalone executable, at the end of the day this executable will contain a copy of the Lua VM. If you want to produce a library that can be "require&q
20.
▲
by
hugomg
8y ago
If you were writing naive code, it probably wouldn't be that much. Maybe a 2to 3 times difference. But the thing with Terra is that you can be even faster than naively-written C if you know what you are doing.
21.
▲
by
hugomg
8y ago
I talk a bit about this in a sibling comment. Maybe that helps answer your question? Pallene uses garbage collection, and shares the Lua garbage collector. The idea is to make as easy as possible to call Pallene from Lua and Lua from Pallen
22.
▲
by
hugomg
8y ago
You hit the nail on the head. With a more "Oberon-like" language we can use textbook optimization algorithms and take advantage of existing compiler backends, like GCC and LLVM. For dynamic languages these techniques aren't e
23.
▲
by
hugomg
8y ago
Don't worry, that is still a fine question. Pallene programs are still able to use Lua's "load" to eval dynamically-typed Lua code. But it is less likely that we would implement a function to load Pallene source code at
24.
▲
by
hugomg
8y ago
Pallene has been designed to seamlessly interoperate with Lua, not to replace it. So you can still use Lua when you need dynamic code loading or magic debug hooks. Roughly speaking, from the point of view of Lua, Pallene is a system languag
25.
▲
by
hugomg
8y ago
Terra uses Lua as a metaprogramming language, while Pallene/Titan use Lua as a scripting language. Terra is designed for high performance numerical computing. As you mentioned, it has no garbage collector, uses C-like datatypes and its
26.
▲
by
hugomg
8y ago
Yup, this is the idea. :) If you don't mind, I'm curious about what applications you currently use Lua for.
27.
▲
by
hugomg
8y ago
Pallene is indeed approaching this problem more for performance than for autocompletion. (For just autocompletion it would be more appropriate to use a typesystem that is closer to full Lua, like Typed Lua) For us, the main motivations for
28.
▲
by
hugomg
8y ago
Gabriel's slides are already available here: https://gligneul.github.io/luaworkshop2018/
29.
▲
by
hugomg
8y ago
I'm first author of the linked paper and am working on Pallene for my PhD. Feel free to ask any questions here!