Hacker News new | past | comments | ask | show | jobs | submit | more atdt's comments login

It's less complicated than you might think. You call into SQLite C library functions using C calling conventions. Here's the relevant code: https://asm32.info/fossil/asmbb/file?name=source/sqlite3.asm...


How about for setting up a server and serving http requests / establishing web sockets?

If it’s just a bunch of calling C code then I have to ask which part of this is actually assembly


You can ask the same about e.g. Pascal, Python and Javascript, because all of them just make a bunch of C calls at the end of the day and can’t use NIC ports directly.


To do this in assembler you write raw syscalls to bind to open the TCP stream and then accept to handle incoming connections, possibly with fork or clone3 to spawn a process/thread to handle the new connection. None of that requires C programming. HTTP is "just" some text parsing on top of read/write calls to the file descriptor returned by accept. Web sockets are "just" some connection logic on top of HTTP.

A basic implementation of that is totally possible in assembly with no calls to c libraries. Would even be a great project for people to learn some systems programming. Keep in mind, all of these protocols (except maybe web sockets) were designed when programming in assembler was common. There's probably some HTTP implementation in the wild doing the same thing.

That said there's a lot of reasons you probably don't want to do that, HTTP can be subtle and you probably don't want to be doing raw clone3 calls to spawn threads, if you want to be doing thread or process per connection in the first place.


Well, you see, most OSes today aren't written in ASM. Their native libraries are C, so you have to interface with those libraries if you want to utilize them and their features.

You can certainly write your own TCP/IP stack with raw sockets and directly interface with the NIC, if you like. But at that point you're both reinventing the wheel and bypassing the entirety of the OS, you might as well just write a forum exokernel.

Most developers don't consider utilizing a library in another language as "cheating". Popular and core Rust, D, C++, Python, nodeJS, etc libraries do this all the time.


To be fair, from that perspective every backend web application in every language is really just "calling C code".


That's overly simplistic and untrue. If you write a C# / .Net program you're not "just calling C code", you're not calling C at all.


But the CLR is written c, c++ and assembly which is what runs c#. Also the syscalls that run down the chain are also written in c, c++ etc.


That is just the runtime. That is smaller of fraction of what is going on when your programs execute than you think.

The C# code you write (and majority of the your code's dependencies) are JIT compiled to native machine code (or more recently there are AOT compilation options).


but then your runtime VM calls C :)



Which applications you use is almost irrelevant -- over the past several years, there has been a steady stream of "zero-click" exploits that allow an attacker to compromise phone with no user interaction. The remote code execution vulnerabilities discovered last year and this year in the modems used in Samsung devices require nothing more than knowing the victim's phone number.[1] And you don't need to be particularly important to be caught in a wide net, cast by criminals looking to build up a bot-net or harvest data from as many devices as possible.

[1]: https://googleprojectzero.blogspot.com/2023/03/multiple-inte...


All of this makes me think I should just switch to a flip phone. It's exhausting having to constantly drop hundreds of dollars every 3 years just to stay safe.

I have a Pixel 5 that does everything I want. Google will stop supporting it within the next year. It doesn't make sense to me that this device already needs to be recycled. Yes, I know about custom ROMs, but even those end support for perfectly OK phones (GrapheneOS for example no longer supports Pixel 3a).


I completely agree. My phone lost official LineageOS support last year but it still works fine and I cannot justify throwing it away to replace with a new expensive device full of features I don't give a damn about. Probably I'm just stupid but I'm going to keep using it until it breaks.


Highway (https://github.com/google/highway), Google's SIMD library, lets you write length-agnostic SIMD code. It has excellent support for a wide range of targets, including both RISC-V and Arm vector extensions.


second this


The ability to invoke functions from wikitext and interpolate the result into the rendered page has been a feature of Wikipedia for over 17 years[1]. The ability to write custom functions in Lua was rolled out a decade ago[2].

  [1]: https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/message/2MMGKQV5EDDXR27RLQVCZ6TCYIXK2R24/
  [2]: https://en.wikipedia.org/wiki/Wikipedia:Lua


Google.org donated money and staffing to support the Abstract Wikipedia project. Two of the seven Google.org fellows who were supporting the Abstract Wikipedia team are permanently based in Zurich[1], and Google was able to provide space to meet. It was the most practical place to hold an off-site.

  [1]: https://diff.wikimedia.org/2022/04/14/google-org-fellowship-with-abstract-wikipedia-and-wikifunctions/


There is zero chance of that happening. Guido van Rossum (and other key figures in the Python community) have spoken very candidly for years about the mistakes they made in the 2-to-3 migration and their decisions in the year since have demonstrated their commitment to not repeating these mistakes.


I was curious about these comments and did a small web search. I found a video interview from May 21, 2021 [1] and have pasted some excerpted quotations from it from Guido van Rossum below for others who are curious.

“Python 4, at this point whenever it’s mentioned in the core development team, it is very much as a joke… We’ve learned our lesson from Python 3 vs 2, and so it’s almost taboo to talk about a Python 4 in a serious sense.”

[...]

“I normally talk about that as a mistake, because Python was more successful than the core developers realised and so we should have been much more aware and supportive of transitioning from Python 2 to Python 3”

[...]

“I’m not thrilled about the idea of Python 4 and nobody in the core dev team really is – so probably there never will be a 4.0 and we’ll just keep numbering until 3.33, at least”

[...]

“We now have a strict annual release schedule, so after 3.10 will be 3.11 and after that will be 3.12, and so forth. We can go up to 3.99 before we have to add another digit. Adding another digit is not completely trivial, but still much better than going from 3 to 4."

[1]: https://www.youtube.com/live/aYbNh3NS7jA


At least take a look at PEP-703[1]. It will answer most of your questions. Significantly, even if this proposal is accepted, the GIL would remain enabled by default.

  [1]: https://peps.python.org/pep-0703/


A large portion of the student body at every American college is "drowning themselves in pleasure and mindlessness". The simple, naturalistic explanation is that when Harvard students abandon themselves to partying and procrastination, it is for the same reason that students at Boston University or Colorado State do it: i.e., they're young, horny, and on the loose for the first time in life, and their mental circuitry for self-regulation isn't fully wired up yet. But this account does not satisfy the Harvard man, who is at pains to distinguish his habits of procrastinton as themselves the mark of a Harvard man, a proof of belonging to an elite order.


There you go.

Why are people lazy and self-sabotaging? Because they're human. They want to do pleasant things more than they want to do unpleasant things.

It's just school. A few years down the road people don't care about most of what you did there. Better enjoy the ride as much as you can without torpedoing your career.


Exactly this. There is no need for overthinking things, like in the article.

When I was in college I noticed one group who managed well above all the others. They where in their 30s.


My now-deceased mother earned her bachelors [UTSA] in her early-50's, and always commented how "few of my classmates attend office hours and even fewer seem to care about what we're learning."

Lady: they're just trying to survive while all these intoxicating chemicals [hormones, drugs, rage] pollute their very existences.


You honestly believe that people who get into Harvard don't have more self-discipline on average that those who don't?


Not the GP, but emphatically and obviously yes. There's the "reads a new book once per week" type of discipline that the average ivy leaguer tends to have, and there's the "wakes up at 4AM to go to the job they don't like despite how much their back hurts" discipline that the working class are obligated to develop.


> reads a new book once per week" type of discipline that the average ivy leaguer tends to have

I got two degrees and spent five years at Harvard, and -- no, they don't.


So you're saying the sweat of a coal miner is equivalent to the sweat of an Einstein ("genius is one percent inspiration and 99 percent perspiration")?


Whoa, thats quite arrogant statement. So, are you PR person from Harvard?


People who attend institutions considered "elite" have on average been told since early childhood that they are part of the elite.

In my experience, such people tend to have less self-discipline and fewer inhibitions than regular folks. That's a natural consequence of knowing that nothing truly bad can ever happen to you, no matter what you do.


While true, the estimated average IQ at Harvard is 142. IQ is highly associated with self-control and discipline.


> IQ is highly associated with self-control and discipline.

I'd like to see a citation for that, especially for the idea that the self-control/discipline associated with high IQs transfers over to non-academic aspects of life, which is what's in question here.


Here you go: https://pubmed.ncbi.nlm.nih.gov/2614657/

> Delay behavior in both sexes was also correlated positively with IQ and with Q-sort-derived indexes of ego resiliency and ego control. The relationship between ego control and delay behavior was particularly strong after both IQ and ego resiliency were partialled. These results were interpreted as reflecting the fundamental importance of both cognitive skillfulness and impulse control for adaptive delay behavior in situations that contain strong motivational inducements.

This study doesn’t measure academic related delayed gratification. I’m surprised to be asked for a source. This has been settled science for decades.


I'm pretty sure they're conflating a higher likelihood of determining an action precluding risk factor prior to action with actual self control and discipline....

It's more just that the smarter you are the more likely you are to both recognize the existence of the risk factor as well as "do the math" before your impulses induce action.


Estimated average IQ from SAT score.

So it's bullshit. They just cram SAT prep non-stop with private tutors.


And this explains the question pose as well. They don't self-sabotage. They just "jump through academic hoops" ... but not through their own effort, or only with great assistance. This help they get just really breaks for most in the university years.

They don't self-sabotage, they just lose their advantage.


> So it's bullshit.

That’s quite the opinion. Do you have any evidence to back that up? Countless studies have found that SAT scores are highly correlated with intelligence. Both “g” and IQ, which are roughly equivalent for this context. For example: https://www.psychologicalscience.org/pdf/ps/Frey.pdf?origin=...

And here is another: http://www.iapsych.com/iqmr/koening2008.pdf


I don't think anyone would argue otherwise, the controversy is that IQ test results can be increased significantly by training.

But that discussion ultimately boils down to what intelligence really is... You either subscribe to the believe that it's essentially something you're born with or something that can be improved by training.

IQ tests fundamentally cannot measure for the former definition, but I does a decent job for the latter.


The user I replied to is clearly arguing that SATs do not provide any correlation with IQ. They called the proposition “bullshit.”

As for your question, g is very difficult to improve through training. Almost impossible in adulthood. The only studies I am aware of which indicate an ability to improve IQ score over time are those which allow participants to repeatedly take similar IQ tests. This enables the respondents to practise the type of question and answer faster and more accurately. Obviously this would produce an inaccurate result, over-estimating the intelligence of the individual.

To draw parallels with the SAT, I see evidence that repeated attempts reveal gaps in one’s knowledge and skill, and these are prerequisites for the test. This permits the individual to study those areas and practise the kinds of skills required to improve their score. Given this, we should acknowledge that the SAT is not a perfect analogue for IQ tests, but in aggregate, they do yield striking correlation. To tie this to my premise above, it is highly likely that the average Harvard student has an above-average IQ.


They are BS under the first definition.

And I think we've gotten quiet far from the context their statement was made in.

The premise was that intelligence increases self control/delayed gratification. From this, we've extrapolated that havard students will have on average a higher self control, because they've had the the privilege of a much better education, which caused their IQ scores to be quiet high.

Personally, I'd agree that this extrapolation is flawed, because both factors are only correlated with no causal link.


> They are BS under the first definition.

I provided a study which shows high correlation. Do you have any evidence to the contrary?

I don’t agree with your summary of the premise. It doesn’t follow that more training means higher IQ scores, but I acknowledge it could mean higher SAT scores for individuals. Just not in aggregate.


Correlation is not causation and is meaningless for extrapolations. The only thing it provides is interesting data to discover the causality through further study.

But I guess you're too far gone into narcissism to understand how dumb this has gotten.


I made no claims about causation. The claim is correlation. Perhaps you should re-read the comments :)


you're extrapolation, thus you're using it as a causation.

Let me give you an example:

Swiss cheese has holes, by studying its properties you can find a correlation between the size of the cheese and the total volume of holes.

You do another study and find that as you increase the size of the holes the cheese, you're left with less grams of cheese.

by your logic, which extrapolates between these two unrelated studies finding different correlations, you can confidently state this:

  more cheese correlates with more holes
  more holes correlates with less cheese

  more cheese == less cheese
outstanding logic, indeed.


The claim being made is correlation.


It’s my understanding that a lot of people who could make the cut for Harvard etc but do not due to resource constraints (limited student numbers, limited finances).

These people then go on to other universities. So yes I believe you’ll find all levels of self-discipline across all the universities.


The difference is there are some 3000 universities in the US. I guarantee you, the vast majority of students who could make the cut at Harvard are not attending a college ranked at 1500. So when you compare an average student at Harvard, maybe there's no significant difference between that student and students at the top 100 (or pick a number, 100 seems high frankly, I've studied in universities ranked around 20, 50, 100 and the differences in the average student and course difficulty was quite big between the 20 and 100) ranked universities, but there's certainly a difference between that student and the average college student.


Can’t speak for the GP but I’d say “No they do not” to your question.


Assuming that they do, does it significantly change the patterns and tendencies of actions among that age group? I think the distribution of behavior should be intact even if you just sample among Harvard students.


This has to be sarcasm


Fantastic list, thank you. I didn't know about most of these. What's the benefit of the video speed controller over the playback speed controls provided by YouTube?


more fine grained speed levels, can go up to 4x, plus it works on ALL videos on every page not jsut youtube


Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: