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

Global-by-default scoping was one of Lua's largest mistakes. I wish they'd fix it, but of course it would break backwards compat.


Strictly speaking, Lua is not global by default. All free names, that is, all names unqualified with `local`, is actually indexed from a table `_ENV`, which is set to `_G`, the global environment. So, all free names are effectively global by default, but you can change this behavior by put this line at the top of your file `local _G = _G; _ENV = {};`. This way, all free names are indexed from this new table, and all access to the global names must explicitly be accessed through `_G`, which is a local variable now. However, I have never seen such practice. Maybe it is just too complicated to accept that all free names are global variables and you have to explicitly make it local.


Thanks to Lua’s great metaprogramming facilities, and the fact that _G is just a table, another workaround is to add a metamethod to _G that throws an error if you try to declare a global. That way you can still declare globals using rawset if you really want them, but it prevents you from declaring them accidentally in a function body.


yeah. I hate typing `local` for every variable. I would prefer they introduce some syntactic sugar like `let`(to mean local variable) and `const`(to mean local and constant).


“local” is the same as the “let” that you are describing, isn’t it? Just 2 chars longer.


The link to the Amazon product looks like a non-affiliate link when you hover over it. But if you click, as soon as the mousedown event fires, they swap in an affiliate link. How rude!



Wow, that's b terrible. And worse, I wasn't aware this could be done in thinking of many ways it could be exploited to phish users



This is awesome on Linux. I've wanted to see my battery status forever, and the ability to pause when you remove an AirPod is really nice too.


This is cool! Please add a dark theme and respect `prefers-color-scheme: dark` :)


I'm also unable to load it in chrome on linux (wayland backend). Seems like some sort of GPU issue.


Same. Chrome on Manjaro with Wayland, just crashes.


more info on setup, if you can: are you using a non-intel GPU for rendering?


nvidia GPU for me with hardware acceleration enabled (required some command-line flags passed to chrome to get it working on wayland):

    google-chrome-stable --enable-gpu --ozone-platform=wayland --enable-features=UseOzonePlatform,WaylandLinuxDrmSyncobj


hmm not ideal -- will try and take a look and see whats going wrong


I agree with this. But do you have any resources on "thinking with portals"? It's easier said than done.


Sadly, I don't. If I did I'd be busy building it rather than judging others on HN.

But it's a bit telling that OpenAI themselves can only come up with a better ~door~ ads.


Super exciting. I hope to be able to embed a Ghostty-backed terminal into my Rust app in the future. Amazing work as always, Mitchell!


Private equity seems to be a form of cancer that slowly sucks the life out of everything it touches, with a single goal: to grow and spread. Can someone more knowledgeable please explain to me why I'm wrong?


The reason it's easy to conclude that they're evil is because they are almost never committed to preserving or improving the quality of their investees. They are only committed to making money, and that often comes in the form of price gouging and liquidation.


(not my views, playing devils advocate)

PE strives to make things more efficient from a capital point of view. Business foois making $X in profit, and the PE firm's analysis says the can make X+Y dollars with some changes. This is 'better' because now the capital usage is more efficient and more can be spent in other places - new products, new jobs, new businesses, returns to investors, etc. And of course returns to the PE firm.

In principle an efficient economy is important on a macro scale - if all the business are stuck in how they were doing things 30 years ago then we would have reduced innovation and ultimately less jobs.

In practice there is of course a lot of money that flows back into the PE boss's pockets and.... thats it.


It trades robustness for efficiency. It makes the business/service altogether less robust, unable to withstand shocks, unable to survive the tests of time.


It shortens the outlook from years to months.


Have you seen “Other peoples money” with Danny de Vito? I felt it explains this cancer quite well, 35 years ago.


Efficiency?


The classic playbook includes making a lot of debt, and then leaving the lenders holding the bag when the company files for bankruptcy. It can only be considered efficient if con artistry is efficient, that is, efficient at taking the money from the hands of people who trust other people "too much".


This is over simplistic and if everyone knew this is what happens when PE comes into play then no one would lend to PE-backed companies. Often times these debts can work out.


Work out for the banks and shareholders yeah. Not the company and its employees


Very cool! Was it difficult to get Bitrig approved on the App Store? If I had to guess just based on the idea, it seems like the sort of thing Apple would take issue with.


Heh... it definitely wasn't an overnight approval. However, Apple has relaxed the guidelines for developer tools compared to the early days of the App Store. If you look today there are Python IDEs, Jupyter Notebooks, and various other apps that execute user generated code. The key guideline to be mindful of is 2.5.2.


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

Search: