skysight-inc/HackerNews huggingface dataset:
> Another way would be to make a minor interpreter modification to have it count byte code instructions executed

Lua provides the LUA_MASKCOUNT hook type since at least Lua 5.1, which calls the hook every N instructions. See https://www.lua.org/manual/5.1/manual.html#lua_sethook and https://www.lua.org/manual/5.4/manual.html#lua_sethook

The following prints 1 through 10 and then exits using Lua 5.3 and 5.4:

local i = 0
debug.sethook(function ()
i = i + 1
print(i)
if i >= 10 then
os.exit()
end
end, "", 1)
while true do
-- nothing
end

I've never used hooks in practice, though, so I may be missing some caveats beyond the obvious.

Regarding time, IIRC the Lua implementation very carefully implements lua_sethook (and related internals) such that you can safely install a hook from a signal handler, at least on common hardware like x86, ARM, etc where pointer assignments are naturally atomic. It can be tricky to make your lua_State context available to a signal handler, though.

Also, unless you isolate the process using system facilities, Lua probably isn't suited to running potentially malicious code as the VM doesn't see enough eyeballs. Looking through the bug history at https://www.lua.org/bugs.html it's apparent that even if you disable all APIs there are occasionally exploitable bugs in the interpreter. I suppose the same is true in practice regarding, e.g., Node--many more eyeballs but the JIT engines are so much more complex that you end up in the same place. (The jury is still out on dedicated WebAssembly engines, but JIT engines are notoriously complex and "memory safe" languages don't help with JIT bugs.)
When every country is ruled by capricious dickbags you might as well spread your eggs across many baskets so that the actions of any one set of dickbags are better hedged against.
c++, c, java vb, python, js, various stored proc languages, bash scripts were all used on the last project i worked on, along with tibco, reuters, com, corba frameworks. plus certainly stuff i have forgotten.
It's possible to have 0 dollars after paying other bills before your next grocery shopping trip so no matter how cost effective these things are they won't help. Once you're behind on rent or mortgage and gas bills and electricity bills and loan payments and credit card debt is racking up 20% interest and you're using every cent you have to stop those creditors from coming after you your only option is to cut down on other costs, even if they are relatively important, like food.
Your comments are contradictory.

You claim the US is "insane" for having kids play sports year round, and then when informed of reality, you claim that having kids play sports for only part of the year seems "imbalanced" unlike the superior system in your country where they play, uh, "all year round."

There's definitely a communication breakdown here.

To be clear: American sports are extremely a la carte. Kids can play as many or as little as they like. Different sports happen during different seasons. For example in our area schools boy's tennis is in the spring and girls' tennis is in the fall. This is because the courts are outdoor, there aren't enough courts for both to play at once, and too cold in the winter. Summer is generally too hot and kids are on vacation. Winter sports are indoor sports like volleyball, swimming, basketball, etc. If kids are really serious about a sport they can play nearly year round if they like because there are leagues that operate apart from schools.
Fascinating how different outlets are reporting this. The WSJ right now has it headlined "Inflation Cooled to 6.4% In January". https://www.wsj.com/

So is it rising or cooling? Can the central banks ease rate increases? Or does the WSJ just hope and pray that the Fed will stop, just please make it stop?
Indian tax authorities raid BBC, weeks after documentary critical of Modi airs
Most encoders let you define filters that restructure the data using out of band knowledge to achieve better rates. For example, if you have an array of floating point numbers, rearranging the exponent and mantissa can yield significant savings if you can arrange for a consecutive run of each separately because the generic compressor doesn’t know anything about the structure of the data. Compressors are great but out of band structural compression/reorganization + compressor will always outperform compressor alone.
Mostly backwards compatible.
Handmaiden’s Tail no less
>This is a public school. It is precisely censorship from the government.

It's not censorship from the government. Parents need and should have a say about what it's taught to their children in public schools. Government censorship would be the government preventing anyone from buying or borrowing through any legal mean, and penalizing those who read it.
dataclasses document the full set of attribute they can hold, along with their type.
That's a lot of naivette. Corporations _require_ we use stuff everyday. And when that stuff is something you build yourself, it makes zero sense that github is still using something else.
You need to wait till after 2PM.
Ask HN: What are your favorite unintended reply-all/(at)all stories?
Is anybody receiving cost-of-living adjustments from their employer?
you can via webhook - post request with your mastodon token
The intent of pydantic is to be a parser of (possibly recursive, with composition of classes) key-value "languages". It could, in principle, evolve in a completely different direction than dataclasses/msgpack/dataclassy, etc.

This is like -- there are many libraries that do PCA, from sklearn to statsmodels to plain scipy to genomics tools. But in a glue-language workflow you should choose a tool for its semantics.
There was self-help type book (quite a good one, but its name escapes me) that talks about the Passion Mindset and the Craftsman Mindset.

The Craftsman derives joy from mastering their craft, learning from past failures and improving every day.

You can be a Craftsman in any career which allows for outlier performance - public speaking, writing books, trading, academia, entrepreneurship, software engineering.

The Passion mindset is about finding your strongest passion and then working in that area. The problem with this is that most people don't really know what they will be passionate about from the start. And worse, it's even harder to know if the current thing is what you are most passionate about! You also may not have a skills edge in what you are passionate about.
The constant Rust spam on the front page makes me think that there may be some sort of pro-rust bot that upvotes them. There probably isn't, just a lot of enthusiasm, but it's tiring.

However, it has also convinced me that Rust isn't faster than C++ in practical applications, thanks to the number of "we moved our C++ codebase to Rust" blog posts that have 0 benchmarks. You can practically guarantee that if their code had gotten faster, they would have said something about it. That has dulled my enthusiasm for the language significantly.

Also, it is humorous to me to see blog posts that say, "[Rust feature that causes inconvenience] enables compilers to do [compiler optimization that C++ compilers already do]."
>"Can someone explain why Rust has mutability?"

Why not? Why this "there can only be one" mentality?
I think the difficulty here is that data classes beyond the most simple cases have awkward extension points, see the docs on post-initialization https://docs.python.org/3/library/dataclasses.html#post-init...

I am partial to a dataclass keyword but… it’s tough. The problem with declarative stuff like this is that sometimes you really just want to do things in a certain order and now you have to communicate that (the keyword argument hack is an example of this)
Zelensky could start WWIII? This kind of thinking beggars belief. Russia is the aggressor. They invaded Ukraine in 2014 and did the same in 2022. Ukraine is defending itself. It is Russia that, on repeated occasions, has threatened with the use of nuclear weapons.
Considering that some "union" jobs in Germany (there are collectively negotiated terms and conditions per industry which apply to everyone working at a company covered by those conditions whether or not being an actual union member) can go up to as much 120k per year for a 40 hour work week, and increase by a couple of percent every other year so, well, those jobs are a lot more attractive than people think.

Added benefit: working at rather stable companies with more or less solid financials.
Show HN: I built an AI that drafts emails based on 'inbox memory'
Hey everyone,

I spent the last few weeks building Warmest.ai.

Warmest is an AI email assistant that writes emails in the background for you, in your tone of voice, and with your content.

Every time you open your inbox, Warmest will have already written a draft response to all your emails. It's a bit like having a Chief of Staff or a PA.

When you first connect, Warmest indexes your inbox and creates vector embeddings out of all the emails you've sent, creating an 'inbox memory'. It then does vector search on this 'memory' to find similar emails, so that content you have previously sent can be pulled into a draft.

For example, let's say someone emails you the question "What is the value proposition of your business?". If you have answered that in an email before, Warmest will prepare a draft with with a your company value prop already populated. This massively reduces the amount of time you need to spend on repetitive emails, and helps you get through your inbox faster.

Warmest works super well for anything where you've needed to write an email more than once. Things like B2B sales, scheduling, customer support, or FAQs.

It's still in beta, but please give it a spin, and would really love any feedback!
I think Rust's features were actually inspired by OCaml rather than Haskell. Rust was originally written in OCaml, and OCaml feels a lot more similar to Rust than Haskell does.

Of course Haskell is heavily influenced by ML so it also has a lot of the same features.
I love these kinds of writeups, thank you!

How did you determine what addresses to read things into? (the chainloaded bootloader, then its initrd/ FDT / etc.).
"For example someone whose mobile phone got lost/smashed/blownup last time they were in Kabul, so they bought a new one"

How is that related to the BBC?
Yes, that’s why I think it’s a close fit for what Russ proposed rather than the more outlandish conspiracies circulating in social media.
Seems like a bit of survivor bias at play too in that narrative. Don’t pretty much all languages start off that way?
Frame pointers vs. DWARF – my verdict
I is not just video conferencing. Teams sux if you need many ad-hoc working groups based on topics or small teams. Meaning, they sux for exactly the kind of work developers do.
I'm not sure whether I would call crushing fines necessarily less of an inconvenience than jail?
The most interesting thing about human echolocation to me is that blind people (and all people, generally) do it automatically without consciously attempting to do so, and without realizing the source of their information about the world. It's evidence that we don't have access to at least some of our own logical thought processes.

How Well Do We Know Our Own Conscious Experience? The Case of Human Echolocation

https://faculty.ucr.edu/~eschwitz/SchwitzAbs/Echo.htm
Autocorrect strikes again. My bad. Shamful Disprey.
It’s all a cost/benefit ratio. Even if the most efficient language is used, given a sufficient number of requests, it might make sense to block them no?
The work chat tier list

Discord
Slack
Mattermost
<chasm>
IRC
Email
<chasm>
Hangouts
Teams
<chasm>
Linq / Skype For Work

Teams so fundamentally misses what the point of a good office/team oriented chat looks like that it’s worse than useless. They would be better off just splitting off the video calls (which are pretty good but drop the annoying corner thing) and just starting over with a Slack clone.
Give me C# with RAII and native AOT compilation and I basically don't need to use C++ again. That's close enough to regular C++ that a lot of programs wouldn't need major redesigns.
I invested heavily in C++.

Now I feel it's either making-c++-memory-safe-while-breaking-back-compatibility or die slowly. I was told by c++ experts there is no middle ground.

I actually started to shift focus onward Rust. Rust also provides a more consistent build tooling albeit build time is still very slow. Plus Rust does cross-platform decently. For C++, I need create my CMake manually each time, and cross build also involves manual creation each time.
Record profits are stolen wages
> I optimize directly for the hardware I'm running on, which typically gives me 10-100x performance improvements. Controlling how memory is managed is critical.

What makes you think you can't control how memory is managed in Rust? Rust doesn't have "automatic" memory management, it has a compiler that can help ensure you are managing memory correctly, and force you to type "unsafe" when you are doing things it doesn't understand.
What wasn’t going to happen? The consensus was 6.2, this was well within expectations. It also showed inflation slowed.

This is frankly well inline with what most analysts thought was going to happen.
Is your house running off of the power the panels output or are you being paid for the power they generate?
>It wouldn't even be reported.

Right-leaning outlets would definitely report on it and they'd be as wrong as left-leaning activists.
It seems the title changed. It's now "How Rust went from a side project to the world’s most-loved programming language."

The URL slug shows the old title perhaps.
Rust is immutable by default. You have to deliberately opt in for mutability. When you don't opt in to mutability the programming styles are very similar at a basic level.

First the type system is very similar with the capability of building sum and product types with recursive values. Second pattern matching over sum types is also very very similar.

Rust is like the bastard child of C++ and haskell.
> My last place had a guy screw up so horribly he was removed after 9 months BUT for some bizarre reason they kept him on the payroll for 3 more months so he could hit his cliff.

almost certainly a 12 mo. contract of some sorts, or else some sort of termination cause. maybe an "on retainer" fee.

point is, high level executives are in the same bell-curve as all other professions, and it's mostly a cartel.
You can replace F500 by French government, it also works

https://www.lemonde.fr/en/politics/article/2022/11/25/french...
> But for the many other purposes of classes that need custom init,

write your own `__init__` method then, as you would anyway. Dataclass' default init is way better than that of `object`.

> advanced field defaults

same

> no equality

set eq=False, all dataclass methods are optional

> custom repr/str

write __repr__ and __str__ methods, same as init, dataclass' default is much nicer than that of `object`

> advanced inheritance

What's the issue with inheritance? what's "advanced" inheritance, you mean mixins?

> etc dataclasses give you nothing but a bunch of magic to turn off or work around.

Python `object` has all kinds of default behaviors too, which are just worse. default behaviors aren't "magic". dataclasses currently manufactures its methods at runtime, so that's maybe "magic", but all of that could be built into Python, then it would just be, "default behavior".
Check out the Hyperion cantos by Dan Simmons.
Never question authority publicly; they'll be on to you and can stop you.
You don't think Russia would invade the Baltics? Or are they not west enough for you? Could you outline the difference between a Western country that Russia wouldn't dare invade vs nations that in your mind deserve to be ethnically cleansed?
What they lack, however, is deeper support for users on different servers (at least I couldn’t find any). Part of the appeal of Gitter is that it syncs with GitHub: kick someone off your team there, they’ll lose they rights in the Gitter channels etc. If I’m connected using another Matrix server however, there’s no connection to my GitHub account. So while one can obviously chat using this other Matrix server, there are no benefits of Gitter over just opening a room on some random Matrix server anymore.
The fed has been saying for a year that they aren’t stopping until at least 5.25% rates, the market is priced with that as a target.
Detecting whether doors are closed or open through the sound when you pass them is echolocation.
I've always looked at these exercises (like the NTSB reports) as trying to find as many possible ways that this could have been prevented - not trying to find the single most proximate way to prevent it.

And in doing so, you likely realize that you came close to disaster a number of times and never realized it.
Welcome to the bullsh!t.

It rose. Period. There is more inflation. That is what the .5% increase means. And yes, you are right, the WSJ just wants it to stop. Or shoudl I say Rupert Murdoch wants it to stop.

News Corp to cut 1,250 jobs after missing second-quarter estimates
https://www.theguardian.com/media/2023/feb/09/news-corp-job-...
Enough money is worth a life. Eg when building high way safety features the engineers typically do some cost-benefit analysis that assumes a life is worth about something like 6 million USD (in the US).
Neither are correct. Inflation is a year-over-year metric. Prices now are 6.4% higher than they were in January of 2022. Prices then were 7.5% higher than they were in January of 2021.

In general it's not very informative to talk about a change in the derivative ("inflation rose"). But if you did, you'd have to talk about an immediate delta and not a YoY. So in fact, the headline is simply incorrect. CPI inflation was 6.5% in December. So in fact "inflation is dropping".

But that doesn't get clicks.
Getting a cheap NAS.
Interesting.

As far as I know, the Rust developers consider performance worse than C a bug.
I find Tech extremely interesting but "Silicon Valley" really boring.
The problem I see is that technology innovation got completely confused with finical instrument innovation. This happened in Silicon Valley. Now the whole world thinks Silicon Valley is the heart of technical innovation when in fact it is actually Wall Street Innovation. There is and was good technical innovation in Silicon Valley but I think the tech talent pool has been polluted.
ill do what i feel is just, they can try and stop me, but there will be more like me.
You can use closures as functions with type inferred signatures
This has been my experience with Rust as well. The safety actually does cost some performance. Just like how C++'s "zero-cost" abstractions cost something.

It seems like a straightforward trade between speed and safety to me, but nobody in the Rust community wants to admit it. As such, there aren't a lot of public benchmarks of applications out there that can help the rest of us figure out when we actually should use rust - when the performance is worth the safety (no, Rust evangelists, that kind of safety is not always worth it, and no, we don't always pay the same costs for it).
Note that Rust changed significantly from the side project days to 1.0 and above. It used to have features like Go-like green threads, for instance.
Thunderbird 115 Supernova Preview: The New Folder Pane
Those heirs are the richest people in Europe, owning everything from VW and Porsche to BMW and a bunch of other household names. And those few percent are coming off from quite huge figures...
“Yada yada yada if their job depends on it”
dupe of https://news.ycombinator.com/item?id=34778954
The job of supporters, is to suppress other people? Sounds unhealthy.
Very disappointing to see. I knew something was up since Mike Hansen, the engineer maintaining their Mimic3 offline TTS model, mentioned being let go in the open GitHub issues.

https://github.com/MycroftAI/mimic3

Mike seems to have kept the effort going with his larynx2 project. I was thrilled at the results their model produced so I hope to see more from it.

https://github.com/rhasspy/larynx2
Rate of inflation growth is cooling. It’s a weird number that is always reported in a sort of strange way.

The fed is expected to go up to 5.25 and most of the market still expect that.
This can be done with Rust as well, using unsafe code block if absolutely necessary. And only those blocks have to be reviewed for footguns, as opposed to your entire C++ code.

Also even a 10x speedup sounds much. In Rust, instead using .get_unchecked() (the C++ equivalent) instead of using .get() is typically only a neglegible improvement of a few percentage points in that particular loop or whatever.
i can't believe there is ANY evidence for "most-loved"! most programmers have almost certainly never used it, much less loved it.
Counter-argument: the rest of Europe, specifically the EU.

We have been fighting our neighbours for hundreds of years, and after WW2 we decided to enter a huge trading agreement with each other, hoping that it would create lasting peace and prosperity.
In which cases do you not manage how memory is allocated in Rust?
This is my experience with good managers but also that they sympathize with the difficulties and successes of design and implementation otherwise they'll act in a way the hurts morale. Here it helps being a former individual contributor in the role being managed.
Mainly by looking at what addresses the original bootloader loads them into. The addresses don't matter too much, as long as you load them into valid memory, since for most you pass a reference to them anyway in later steps.
Tesla should take the initiative and bring in a co-operative German-style union or they are going to get stuck with an antagonistic UAW or similar.
Profit per electric car[1]. They beat all competitors by a very large margin.

Heh, it looks like people disagree that this is a valid metric parent was asking for or disagree that the data is valid. Oh, goodness.

[1]https://www.reuters.com/business/autos-transportation/tesla-...
> multi-award winning, widely-praised, multiple adaptations, massive cultural impact and so on

Can say the same about about Marvel movies and Fifty Shades of Grey.

> but if you're going to go out of your way to hyperbolise then don't be surprised if you get pushback on it.

I simply wrote that I think it sucks but don't support banning it.

As for surprise at screeching over tedium, who could be at this day and age. I already said I insist on your right to awful taste and screeching - just not at me. Begone to your Oprah's Book Club schlock you absolute philistines :P
I understand exactly what you mean at the conceptual level, but I've consistently found speedups over c++ in complex applications.
It's not even tube anymore, since the vast majority of viewers aren't using cathode ray screens, ie tubes.
> there are INNUMERABLE cases of people having created very successful projects that are lamenting the fatigue of maintaining it while commercial entities make a lot of money out of it, without giving back, not even pennnies, let alone workers or code.

Hi, people have made money using my code and I also don’t care. I’m happy more people are using my software. I like the bragging rights and I’ve gotten plenty of work off the back of my opensource work. I understand this is upsetting to you. If you don’t want people using the software you write for free, maybe don’t write free software? That’s sort of the point.

There is a problem of freeloading in the opensource world - we need better ways to fund opensource code. But I don’t see how the GPL is a viable solution to that problem. Not at all. More likely, if I release my code under the GPL not only won’t I get paid, but also nobody will use my software. That sounds like a strategy which just makes everyone lose.
>Government censorship would be the government preventing anyone from buying or borrowing through any legal mean, and penalizing those who read it.

You're describing some thing being outlawed. A government may censor information that is otherwise available via legal alternative avenues of delivery.