News for hackers. Stuff that matters.

csl

Yes, I can see how it would make sense to be able to set this in pyproject.toml (typically for private package)

uv is still quite new though. Perhaps you can open an issue and ask for that?

Maybe not exactly what you need (sticky) but you can set UV_NO_BINARY=1

See https://docs.astral.sh/uv/reference/environment/#uv_no_binar...

Re:Bill Gates's Personal Easter Eggs in 8 Bit BASIC (2008) on Saturday April 26, 2025 @04:38PM (#43806986)
An excellent article. Bill Gates himself posted a comment: https://www.pagetable.com/?p=43#comment-1033
Re:How to Delete Your 23andMe Data Amid the Company's Turmoil on Tuesday October 08, 2024 @06:06PM (#41782282)
The way I read it, and I may be wrong, is that they will retain the _interpreted_ results, but now the raw and complete data.
Re:Ask HN: Who is hiring? (January 2021) on Monday January 04, 2021 @12:22PM (#25634585)
boost.ai | https://www.boost.ai | Stavanger, Norway | Senior software engineer | Onsite | Full-time

We are looking for a Senior Software Engineer who will boost our capacity in developing the backend services that power our world-class conversational AI platform for enterprises.

You will be working on:

  * Our flow engine, which is the central component that coordinates the interaction between our AI subsystems to interpret and craft replies to users
  * Our conversation search, aggregation and metrics engines. These sift through millions of conversations in seconds to deliver key insights on a virtual agent’s performance
  * Hundreds of cloud databases, creating rock-solid data structures and highly performant algorithms to be used by the rest of the organization, all while ensuring constant uptime
Qualifications

  * Overall strong software engineering skills
  * Demonstrable proficiency in Python and relational databases (PostgreSQL on AWS RDS)
  * Deep knowledge of HTTP server/client architectures on Linux systems
  * Able to analyze key characteristics of data structures and algorithms
  * You have years of relevant experience... or you're just really, really good
Personal qualities

  * You're looking to push the boundaries in whatever you do
  * You’re ambitious and structured with high work capacity
  * You're a team player but are also not afraid to undertake solo missions
What’s in it for you?

  * An engaging work environment with people who share a common mindset; to deliver a world class product in a brand new, up-and-coming industry.
  * Young, dynamic and extremely motivated colleagues in all departments, both professionally and socially.
  * Challenging, varied and engaging work tasks.
  * Room and encouragement to be independent and innovative.
  * Opportunities for a very steep career path.
  * Competitive salary and exciting bonus schemes.
  * In-house gym and other benefits.
For more information, please contact me at [email protected]
I did basically everything you mention, back in the day, although on a C64.

In many ways, things were much easier back then: Direct access to most of the hardware, flat memory layout, smaller and vastly simpler ISAs, smaller programs (meaning shorter disassemblies to wade through), no protected mode so you could overwrite anything in RAM and so on. And you wouldn't even have to do it live in-memory, just disassemble the program piecewise from disk. People did extraordinary things back then, and you vastly underestimate their capabilities. Sure, you had to write a lot of tooling yourself, but it was simpler times.

I am not trying to detract from the copy protection mechanism, which truly is ingenious. I was just genuinely curious whether I was misunderstanding anything from the article.

Very clever and great article! But it sounds pretty easy to write a cracker for it: Just rewrite the machine code to jump over the check. Or did I miss anything?

Edit: Guess it depends on the details and amount of "obfuscation" that he mentions.

Re:Ask HN: Are books worth it? on Saturday January 04, 2020 @10:38AM (#21955403)
It appears to me that if one wants to make progress in mathematics one should study the masters and not the pupils.

— N.H. Abel (1802–1829)

The BFR runs on a mix of liquid oxygen and methane, according to Wikipedia.

Ignoring obvious scalability problems, wouldn’t it be possible to manufacture that with a pretty decent environmental footprint from various carbon neutral bio sources?

Re:JIT compiling a subset of Python to x86-64 on Wednesday November 22, 2017 @04:03AM (#15755412)
Truffle + Graal looks awesome. I looked at some old ZipPy slides (JIT compiler for Python) here: http://socalpls.github.io/archive/2013nov/slides/zippy.pdf

They have an example where this code is compiled:

    def sumitup(n):
        total = 0
        for i in range(n):
            total = total + i
        return total
It was optimized quite well, but still had loops. I know this is a lot to ask, but I would have expected it to be possible to specialize it to a loopless variant:

    def sumitup(n):
        if n < 0:
            return 0
        else:
            return n*(n-1) // 2
Clang 4+ actually finds this optimization, but gcc and icc doesn't seem to: https://godbolt.org/g/v4zhrm

That is, the assembly generated by clang seems to be equivalent to

    if n <= 0:
        return 0
    else:
        return ((n-1)*(n-2) >> 1) + (n-1)
which might even run faster on the CPU, due to the speficic code emitted.
Re:JIT compiling a subset of Python to x86-64 on Wednesday November 22, 2017 @03:35AM (#15755267)
What is your impression of libjit? It looks really nice. I've only tried GNU Lightning, and I made Python bindings for it (although, today I would have used cffi to interface with it instead of my ctypes approach, because of the header files): https://github.com/cslarsen/lyn

I'd love to see a comparison of the various JIT libraries. I guess both give you optimizations and register allocation for free. Of course, the JITting speed is quite important as well.

Re:JIT compiling a subset of Python to x86-64 on Tuesday November 21, 2017 @05:31PM (#15752236)
Indeed I had already linked to your really cool project at the end. Perhaps I should have made it stand out more. The AST approach is more stable, as the Python bytecode can change between any release while the AST changes in a slower, evolutionary pace.
Anyway, I've made a follow-up post that shows how to JIT compile a subset of Python, directly based on the previous techniques: https://csl.name/post/python-compiler/
Maybe I need to reread LISP, then. I agree that SICP is laser-focused on Scheme, and thus leaves out general compilation techniques.
I do see your point, but I tried to make it clear that this is compilation in an extremely restricted sense: It specializes and executes a function at runtime. And I wanted to cover the core technique of doing just that.

Perhaps I should have included a small example of compiling a linear list of abstract instructions into machine code. But that again would consist of compiling small templates in a coherent way, just like many actual compilers do.

Anyway, point taken, and maybe I'll expand the article or follow up on it.

Is it really that friendly when starting out, though? I found it brilliant, but quite the challenging read. I'd rather just read chapters four and five of SICP [1] and move on to Queinnec as a follow-up on more advanced topics.

[1]: The book is free as well: https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html...

Almost always in evenings, whenever I have time and feel like it. If you're a student, you're probably hosed with deadlines, so pick very small things to try out — things like really simple interpreters.

This particular project luckily turned out to be quick to get working. Also, I kept the scope very small, calling it a day right before getting big ideas.

Brainfuck is simple enough that you could just write out the machine code directly in memory. I think that would make a really good exercise.

I made one based on GNU Lightning to JIT. Even that can be considered a pretty huge dependency:

https://github.com/cslarsen/brainfuck-jit

The interesting part is how slow a one-to-one translation of Brainfuck code to machine code will run without any optimizations. That's where the speed comes from, entirely based on those sweet optimizations. So writing one yourself is a rite of passage, like writing a Mandelbrot renderer.

The above project, from the looks of it, looks quite mature, and therefore interesting in its own right.

Re:Sieve of Eratosthenes in Python (2015) on Thursday October 05, 2017 @01:26PM (#15410870)
Depending on how you plan to use it, a bitset may be more efficient (at least memory wise). E.g. https://gist.github.com/cslarsen/1590498
How can the results be old when the paper is from 2017?
Re:Limits of computation on Sunday April 30, 2017 @06:21AM (#14230883)
Thanks, I see now that the whole section is very clumsily written.

IIRC, a Busy Beaver may halt or not. You only care about those that _do_ halt, though, and the _champion_ is the one with the most number of 1s on the tape. The whole problem is determining if a given machine will halt or not. Which we know, by the halting theorem, is possible to prove on a case-by-case basis, but not in the general case (i.e., you cannot create an algorithm to determine it).

So you resort to heuristics. E.g., if a machine never has a "go to the halt state" in its transition table, you know that it can't ever halt. But as the machines grow, you'll have to cover an infinite amount of such heuristics, hence the incomputable nature of them.

Re:Limits of computation on Saturday April 29, 2017 @02:31AM (#14225332)
If anyone is interested, I attempted to plot the first few Busy Beaver iterations: https://github.com/cslarsen/busy-beaver
Re:FDA Authorizes Ten 23andme Genetic Health Risk Reports on Friday April 07, 2017 @04:34AM (#14058125)
When 23andMe took down their health reports, I reimplemented most of them myself: https://github.com/cslarsen/arv/

(I.e., arv is a newer version of the older dna-traits, which includes the actual health reports: https://github.com/cslarsen/dna-traits/)

Just `pip install arv`, `python -m arv --example genome.txt` and you're good to go (it's fast as well, parses in 60-70ms).

Note: The following is complete speculation and probably bullshit. Please correct me!

I can't find the actual paper for this one. But reading an older study [0], also about TMEM106B, it seems they had already established an association between three SNPs and frontotemporal lobar degeneration (FTLD) risk.

However, the surprise discovery back then seemed to be the large discrepancy between the controls and the subgroup FTLD-GNR (those with FTLD and GNR mutations) for TT rs6966915 and CC rs1990622. See table 2 in [0], and look at the odds ratios. They are remarkably low for TT/CC, which invites further study that may lead to understand how to protect against FTLD (by understanding possible protective mechanisms, even therapies and so on).

As for listing out those odds ratios for your 23andMe genome, you can do it with arv [1]. For table 1 in the study (unless you know you have GNR mutations):

  import arv
  
  genome = arv.load("genome.txt")
  
  rsid = "rs6966915"
  gt = genome.get_snp(rsid).genotype # plus orientation
  print("%s %s" % (rsid, arv.unphased_match(gt, {
      "CC": "CC - OR 0.94",
      "CT": "CT - OR 1.04",
      "TT": "TT - OR 0.74"})))
  
  rsid = "rs1990622"
  gt = ~genome.get_snp(rsid).genotype # minus orientation
  print("%s %s" % (rsid, arv.unphased_match(gt, {
      "TT": "TT - OR 0.93",
      "CT": "CT - OR 1.04",
      "CC": "CC - OR 0.74"})))
Again, did I say that I'm a complete noob? Be very careful drawing conclusions from the program (or believing I know what I'm talking about --- I don't!)

[0]: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3034409/

[1]: https://github.com/cslarsen/arv

Re:I Wrote My Fastest Hashtable on Monday February 27, 2017 @09:37AM (#13744486)
There seems to be a preprint on that chapter from here: http://www.hackersdelight.org/divcMore.pdf

I recommend the book as well, it's got a lot of really awesome tricks!

So, a consultancy company then? Which we all know only scales with the number of employees.

Most people in Europe use Gmail, right? So they must already have figured out this stuff.

Older »