Hacker News new | ask | show | jobs
by h0x91b 4756 days ago
1) JS is easy, almost everyone can work with it. 2) V8 is faster than LUA 5-10 times........ 3) MVC - Model and crons, i think should be in DB.
5 comments

You know there is a redis fork that uses LuaJIT right? https://github.com/neomantra/redis
2) Faster than LUA-JIT? Since when?
You know what's faster than JS? C. C, the language many VMs are built in and tasked with running these kinds of things.
And ASM is faster than C.

Javascript strikes a nice balance between performance and high level usability.

V8 faster than Lua-JIT sounds like a really bold claim. AFAIK it is the other way around, with a factor of 3x.
Nope, in redis v8 is faster, just because i have optimised GET/SET/INCR commands, and lua use a regular connection to DB like any other client, so in my case is no need to parse/encode redis format. And i can optimise any other redis functions for v8.
And it's not possible to do the same for Luajit? Doesn't sound like a fair comparison.
I started this project because javascript is more convenient and easier to teach (everyone knows). The fact that the V8 found in 10(!) Times faster than the native commands even through pipelining, it was found out only later. And as I said, none of my friends can not use LUA to do something serious, but easy to work with javascript. Most of what I've done is independent of the language I use a different approach to scripting the database.

Now cron can do directly in the database. The results you can obtain using REST request (with gzip is very less traffic). On the javascript there is a huge amount of libraries, such as Crypto, if desired, there will be templates to insert. When I finish the beta, it will be possible to write map / reduce function on the clusters. The differences will be very much.

You presume a great deal. "Everyone knows"? I've always found Lua to be a much nicer language than JS, certainly with far fewer ways to shoot yourself in the foot. I always thought "everyone knows" that. If it wasn't for the lack of libraries, Lua would be my first choice for teaching someone programming. "Doing something serious" in Lua is mainly hindered by the aforementioned lack of libraries/platforms, compounded by lack of experience.
Personally I do not like LUA, I do not force anyone to use JS. My opinion is that JavaScript is a powerful and handy, but again, this is only my opinion.
Yes, but the easy of use of JavaScript is orthogonal to the performance claims.

Also, keep in mind that I wrote Lua-JIT, not Lua. There's a big performance difference between them too.

I will perform the test on the speed of Lua-jit, but I wrote redis-v8 not for speed. The fact that the V8 was faster than Lua (regular) was a surprise for me.
i wonder if JS will empower any embedded hw projects soon. writing the next mars rover in js anyone?
No, because it's entirely non deterministic and mostly an evolved shit-crock rather than an engineering tool.