Hacker Newsnew | past | comments | ask | show | jobs | submit | xonre's commentslogin

That place is C++/Lua, with most of the code in Lua. Concurrency model is thread-per-lua-state. Interthread comms is message passing implemented via textbook c++11 atomic and condition variables. Lua is just a small C library so the style remains very friendly to those who like C with classes.


PHP should do a real major compatibility break and remove $ sigil from variable names. It's gonna be worth the pain!


Hello Perl 6!

Such a change makes it a completely different language with no compatibility. Thus all previous code is lost, no easy migration paths (especially for libraries which would like to support both during transition)


I would love that. But yeah, it would probably kill PHP because it would break all code.

Maybe https://getrector.com could auto-fix 99% of code but it would still be very hard to get adoption.


Would it though? I’ve been thinking about this for a while.

What about introducing a new file extension for this? Something like MyClass.p so that .php is for classic syntax and .p Can support newer syntax? You could support old codebases while at the same time support better syntax.

It’s probably too much for the core php team to maintain both though


Tl;dr: it's an autoconf problem

Article also misses: comparing speed of full rebuilds. Pch gives massive speedup on edit-compile-debug cycle or when several modules can share a single pch.


Yes you should.

You'll need a glob function, cd/getcwd/setcwd, pretty-printer. That's about it.

Lua stdlib replaces sed, awk, grep, cut, tr, tail, etc.

Startup time is the best. In my testing, a lua script that functions like `echo` runs faster than echo.


> In my testing, a lua script that functions like `echo` runs faster than echo.

this is kind of hilarious

lua must be severely optimized at this point


so I finally got a luajit and some standard libs working together in my environment

the reason why it took so long is I use nixos and nix-darwin and... well, you know... it was non-obvious how to get everything working together "because Nix" but with the help of a good LLM I figured it out.

HOLY HELL IS THIS FAST.

i had the brand new chatgpt 4.1 rewrite a name=value pretty-printer terminal function from elixir (which I used because it was easy and maintainable, but at the cost of the VM startup) to lua.

272ms for the elixir version (`env | name-value-to-table`) vs. 17ms for the Lua version (`env | name-value-to-table-lua`). WOW. 1/16 the time LOL.

anyway here is that rewrite https://gist.github.com/pmarreck/47e110cbc62ea6603a0e61543d2...

Guess I'm gonna have to keep this in my toolkit! (And now that I figured out the Nix, it will remain easy!) Thanks!


Load the table. Modify. Serialize to file.

Not too hard. Emacs does it with the .emacs file, mixing generated and manual content.


> Load the table

If it comes from an impure function, you don't know if you'll get the same result each time you evaluate it.

> Modify. Serialize to file.

And potentially lose information.


Lua is C in Lisp's clothing.

Lisp killer features were GC, good data representation, first class functions. Lua has all that and more. But its being a "thin" library over the C runtime shows through the clothes.


>Lisp killer features were GC, good data representation, first class functions.

Lisp's killer feature is procedural macros that are extremely easy to write and debug.

Lua doesn't have such a thing, that's why Fennel was created.

Erlang also doesn't have such a thing, that's why LFE was created.


You are correct wrt to iostream, it's bad. I stick to studio.h.


It's probably auto when you wanted auto&.

A copy was made instead of a reference. I've been bitten by that.


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

Search: