Live data from Hacker News

Hello Lua

haxe.org

41–50 of 74 posts

Re: Hello Lua

#41
post #39
post #38

Earlier quoted context omitted.

Also, on most websites, the logo/brand in the top left is a link to the homepage. I clicked it a couple times until I saw the "Home" link next to it.

I've been trained out of this because many company blogs link to the root of the blog, and not back to the company product website. I don't bother clicking that logo anymore.

That's true. I find that annoying as well. It wasn't immediately clear to me that this page was a blog though. They do have a link to the homepage in the menu at least.

Re: Hello Lua

#42
post #6

Earlier quoted context omitted.

Haxe is what ActionScript should have been. However (imo), it's hard to find a niche for it now. What does it get me that Perl and OCaml don't? I've been drawn to Haxe several times over the years, but have never really thought of a project, "huh, Haxe would be a great fit here". Maybe if I wrote a mobile game or something.

The reason we started using it at work was we could target both Javascript and Flash from the one codebase. However, we finally don't need to support flash anymore... so now there's no reason to not just write in javascript.

Haxe is still an excellent hedge. Js doesn't offer the same breadth of deployment targets.

Re: Hello Lua

#43
post #37

Earlier quoted context omitted.

Can you explain who is the target audience for Lua target? What can I do with it?

Well, with LuaJIT you get speed. How much speed? CloudFlare's firewall system uses LuaJIT to analyse approximately 4 million GET requests per second. ( Small pause, reread ) That much speed. That was the figure in June 2015, at least. Some of the autogenerated code looks like this: http://i.imgur.com/F5aT0NF.png (snagged via pdfimages from http://www.slideshare.net/jgrahamc/lua-the-worlds-most-infur... ) This video w…

> CloudFlare's firewall system uses LuaJIT to analyse approximately 4 million GET requests per second.

While I agree with your premise (LuaJIT is a pretty awesome project), this example means nothing in terms of performance.

— "analyse" doesn't give an indication of the workload -- it could vary from "matching against a precompiled regexp" to running advanced statistical models.

— 4 millions requests per second does not mean anything without knowing the size of the deployment. You can always throw more hardware at a "trivially" parallelizable problem.

— Throughput is only one dimension on the "speed" continuum, latency (and especially tail latency) is also very important. Some languages have very good throughput and fail hard at tail latency (Java, Go until recently). Some others have lower throughput but more predictable latency.

Re: Hello Lua

#44

Earlier quoted context omitted.

I agree completely! ... Well, almost agree completely. Daniel Stenberg is the author of curl: https://daniel.haxx.se/ Nicolas Cannasse is the (main) author of haxe: https://medium.com/@ncannasse Both are awesome in their own right. I wrote the Lua target announced here, and am happy to answer any questions.

Can you explain who is the target audience for Lua target? What can I do with it?

You can build a pretty damn good simulation of a Boeing 737-300 with it. (http://ixeg.net/)

Re: Hello Lua

#45
post #30

Earlier quoted context omitted.

I agree completely! ... Well, almost agree completely. Daniel Stenberg is the author of curl: https://daniel.haxx.se/ Nicolas Cannasse is the (main) author of haxe: https://medium.com/@ncannasse Both are awesome in their own right. I wrote the Lua target announced here, and am happy to answer any questions.

Lua is still my goto embedded scripting language. I don't have any experience with haxe per se, but is the transpiler embeddable as well?

The compiler is written in ocaml, so I'd guess not.

Re: Hello Lua

#46
post #17

Earlier quoted context omitted.

cURL was created by Daniel Stenberg, Haxe was created by Nicolas Cannasse. (EDIT: beaten) My favourite Haxe feature is compile-time macros. This leads to massive meta-programming and language extension capabilities. My least favourite aspect is that it does not strictly unify or abstract every target language & runtime, so you end up writing in that language's semantics but using Haxe as syntax sugar. (Good for C++,…

Can you explain what you mean by "not strictly unify or abstract every language & runtime"? In day-to-day use, how would you notice this problem? Can you give an example of what problems or hurdles this can cause? I've only used Haxe briefly for a few small game demos, and loved it, but I've only used the JS backend.

Presumably they mean that porting your js examples to C++ isn't likely to be as easy as just flipping a switch.

Still orders of magnitude less difficult than rewriting the whole thing in another language, and given that a big target is games, abstracting over the platform semantics would be too costly IMO.

Re: Hello Lua

#47
post #43
post #37

Earlier quoted context omitted.

Well, with LuaJIT you get speed. How much speed? CloudFlare's firewall system uses LuaJIT to analyse approximately 4 million GET requests per second. ( Small pause, reread ) That much speed. That was the figure in June 2015, at least. Some of the autogenerated code looks like this: http://i.imgur.com/F5aT0NF.png (snagged via pdfimages from http://www.slideshare.net/jgrahamc/lua-the-worlds-most-infur... ) This video w…

> CloudFlare's firewall system uses LuaJIT to analyse approximately 4 million GET requests per second. While I agree with your premise (LuaJIT is a pretty awesome project), this example means nothing in terms of performance. — "analyse" doesn't give an indication of the workload -- it could vary from "matching against a precompiled regexp" to running advanced statistical models. — 4 millions requests per second does…

You make incredibly fair points and I don't have the data to answer what you've raised. This could be lack of research or the fact that CF hasn't released it. I expect a 20/80 non-researched/non-available mix.

My understanding is that the WAF detects trivial stuff like SQL injection and XSS, and the video also mentions it detected ShellShock and so forth (yeah, this was a while ago).

"Thousands of regular expressions" is mentioned verbally in the video around ~11:25. That's where I got that from.

There are some bits mentioned about the hardware around 19:30:

- E5-2630v3 (16 cores, 32 w/ HT which is turned off), 128GB RAM, 10Gbps

- Custom built by Quanta: 4 nodes per 2U (each node is like half-width and 1U high), redundant 2xPSU in the middle

- 40 machines run Kafka storing 400TB of log data (ingest @ 15Gbps), 50TB disk per node

- 5 machines run CitusDB (sharded PostgreSQL) to power realtime graph generation, 12TB SSD per node

- 100+ machines for realtime analytics running Go (and presumably LuaJIT) - LuaJIT seems to be the realtime "hmm, interesting" flagging system, while Go is used for in-depth intelligent analysis that's (I assume) slightly behind realtime.

Also, the video is actually over here - https://www.youtube.com/watch?v=LA-gNoxSLCE

---

I'm curious to understand what tail latency is, and very interested to learn more about language latency and performance in general. What subjects would you recommend I learn about / read? (I would describe myself as interested from a hobbyist-intermediate standpont, but from a non-academic POV; I unfortunately get dismally lost with formulaic presentations, math is not a strong subject for me.)

Re: Hello Lua

#48
post #39
post #38

Earlier quoted context omitted.

Also, on most websites, the logo/brand in the top left is a link to the homepage. I clicked it a couple times until I saw the "Home" link next to it.

I've been trained out of this because many company blogs link to the root of the blog, and not back to the company product website. I don't bother clicking that logo anymore.

Yeah, I hate that too.

I remember seeing a random website the other day, the blog had a homepage link (not in the image, as "Home" text). That was really nice.

Re: Hello Lua

#49

From Haxe's introduction: > Its syntax largely follows the ECMAScript standard, but deviates where necessary. Anyone can tl;dr the main differences to JS?

Strong static typing with a fairly powerful type system, pattern matching, operator overloading, compile time macros, inline functions, in addition to many others.

Personally my favorite feature is its abstract types, which allowed me to define a 0-overhead color abstraction the was just a 32 bit RGBA integer everywhere. Stuff like this can have a sizable performance benefit for games by reducing GC pressure.

Re: Hello Lua

#50
post #48
post #39

Earlier quoted context omitted.

I've been trained out of this because many company blogs link to the root of the blog, and not back to the company product website. I don't bother clicking that logo anymore.

Yeah, I hate that too. I remember seeing a random website the other day, the blog had a homepage link (not in the image, as "Home" text). That was really nice.

Yeah, this Haxe blog has that. It is nice.
Post reply on HN