Hacker News new | past | comments | ask | show | jobs | submit login
Nginx/njs: A subset of JavaScript language to use in Nginx (github.com/nginx)
33 points by novoreorx 1 day ago | hide | past | favorite | 17 comments





I have never understood why nginx is pushing njs. Openresty which is using lua achieves the same thing and has way more community momentum.

Many people who need nginx are proficient in JS, or they work with people who are proficient in JS.

Lua is not a common skill among web developers.


I hear yeah.

But there is virtually no language as easy to learn as Lua.

You can learn the whole language in 30-min. Seriously.

It’s so small you can fit the entire standard library in your head.


Lua happens when you give game developers the idea to write an embeddable language rather than reinventing the wheel of custom languages with every game or every game engine. It's not the sexiest or the fanciest language, but for its narrow purposes, it kicks ass.

I always struggled and had to check library functions to do what I actually wanted, as they frequently didn't. That's partially why many Lua uses build their own standard libraries, and as a result the Lua user community is very fragmented.

Yeah, and you'll have forgotten it the next time you need to configure something.

Lua is one of the worst, unneeded, unnecessary, pos garbage.

nginx.com is a corporation led by product managers selling what they believe customers want and will pay for

OpenResty (Lua) has/had the weight and momentum of Taobao and then CF behind it.

ngx_mruby, nginxpy, ngx-php, and ngx_http_perl_module also exist. And so do freenginx, caddy, istio/envoy, etc. It's a toolbox.


I knew lua before learning frontend development and god do I miss lua.

They should instead make an optional lua c-like syntax if they want to ease learning for js folks.


As who wrote so many lines of Lua and even made a type checker for that at work... I think you need to explain which part of Lua do you miss. 'Cause many aspects of Lua come from being strictly embedded, which precluded many otherwise valid and better options.

Consider nginx + njs as a self-hosted Cloudflare worker

I have never understood why anyone gives a flying f about openresty and lua.

Openresty is the most toxic, rude, entitled “community” I’ve ever experienced. And Lua is a garbage language stuck in the 1980s, used by people afflicted with NIH. Lua’s entire ecosystem is copy-n-paste hell.


Word! From an enlightened person.

lua is still better than javascript.

I'm waiting for the X > Y flame war except when you need to do Z, where Y is an element of {Java, PHP}. (And to be fair, Hack is awesome in its realm except the tax barrier to entry is difficult/impossible to learn and acquire.)

Webserver centric DSLs have fallen by the wayside because it's limiting and pointless to pour -> too much <- application-layer/-level engineering into infrastructure-side engineering that can be more-or-less accomplished without it in performant backend application infrastructure using {C, C++, Rust, Go, Haskell, Erlang} or using cloud-native control-/data-plane configurability that makes it moot. The one of the keys to large-scale ops is striking a nuanced balance of engineering flexibility across the levels of both the application stacks and the network stacks.


Why do you hate lua and openresty so much? Do you have bad experiences with them?

JavaScript is becoming the ether of web programming.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: