News for hackers. Stuff that matters.

alnsn

Re:NetBSD adds a new beginner-friendly text editor called atto on Thursday October 29, 2026 @09:04AM (#50288315)
You can ask Claude to cross-complie, prepare an image (aka install) and run an emulator. I tried exactly this yesterday and in about an hour I could attach to tmux and run tests on emulated riscv64 board.
Re:Why Is There a Tiny Hole in the Airplane Window? on Friday January 09, 2026 @10:33AM (#46554937)
Related: Why there are holes in bicycle rims: https://youtu.be/yppBwvPciBo?t=8m7s
Space optimal isn’t necessarily the fastest.

Note that PostgreSQL code uses 2-graph instead of a more compact 3-graph version. The latter is noticeably more compact: 1.25 vs 2.1 factor.

It’s down to a quality of implementation. I can give you some hints on improving it if you’re interested.

A tiny JIT code generator inside cdb would definitely bring performance on par with a generated C code but it’s probably an overkill.

Not sure that scares you, code generation or a choice of scripting language?

If you want to avoid a code generation, you can generate a .cdb (constant database) file with the cdbw(3) C API and read it using the cdbr(3) C API.

cdbw(3) http://netbsd.gw.com/cgi-bin/man-cgi?cdbw+3+NetBSD-current cdbr(3) http://netbsd.gw.com/cgi-bin/man-cgi?cdbr+3+NetBSD-current

Some examples of .cdb files on NetBSD:

/usr/share/misc/terminfo.cdb /var/db/services.cdb

If you don't like a particular choice of a scripting language, you can adapt my Lua script:

https://gist.github.com/alnsn/68f599bc9358fcee122d6175392d77...

Building and peeling a graph should be identical but the assign step is different. I use non-minimal not order preserving BDZ scheme while Joerg's code is based on the original CHM scheme.

Given keys A, B, C and D, CHM always maps them to values 0, 1, 2 and 3. BDZ, on the other hand, can generate values in a range [0, 2.1 * 4) and it doesn't preserve an order. For instance, one possible mapping in the BDZ scheme is 7, 2, 5, 1.

Alex

Re:Rust bare metal on ARM microcontroller on Tuesday September 22, 2015 @02:14PM (#10260468)
This is going to be interesting. Rust on top of rumprun bare-metal unikernel https://twitter.com/gandro23/status/645734117699624960
Re:Reproducible builds in Debian: preventing compiler backdoors on Monday September 07, 2015 @11:54AM (#10181887)
> Many other free software projects, including FreeBSD, NetBSD, and OpenWrt, are moving in the same direction.

I might be wrong (I'm away from my NetBSD boxes) but build.sh script in NetBSD has a buildseed option which can be used to create identical builds of the base system.

Re:Intel Architecture Code Analyzer on Sunday September 06, 2015 @07:03AM (#10177333)
I spent about an hour looking at the tool. They say that only very few instructions aren't supported (and thus ignored by the tool) but a very popular imul instruction can be ignored.

PS I noticed that gcc with -march=corei7-avx generates more cycles compared to a generic amd64 compilation for an unrolled integer(4) to char[4] conversion.

Re:Looking for new LuaJIT maintainers on Friday July 31, 2015 @04:36PM (#9984305)
You can start from here http://lambda-the-ultimate.org/node/3851#comment-57805 or read the whole thread.
Re:Fast Approximate Logarithms, Part I: The Basics on Sunday May 10, 2015 @07:39AM (#9519613)
This one? #include <boost/math/tools/remez.hpp>

I used some bits from it to help me in building my own log approximation but I didn't have time to dig into it.

I ended up doing Chebyshev approximation over [1, 2) interval but I extended the interval slightly to make sure that an error term at 1.0 is minimal (you can also minimise an error term at 2.0 if you want some smoothness between [1, 2) and [2, 4) intervals).

It's easy to calculate new interval values for Chebyshev approximation and it shouldn't be a problem to modify Remez but I couldn't find any Remez implementation that would let me do what I needed.

Usually, interval ends in Remez algorithm are fixed, while internal points can be moved by the algorithm. I needed a way to to fix one or two internal points (1.0 and optionally 2.0) but let the algorithm move interval ends within certian limits.

If anyone knows of any tool that let me do it, I'd be happy to play with it and publish my code. My approach is a bit similar to [1] but I'd more likely use Intel assembly or DynASM.

[1] http://gallium.inria.fr/blog/fast-vectorizable-math-approx/

PS The author of [1] uses remez from e Sollya tool but it doesn't let me fix internal points. I looked at the implementation but it's more obscure than boost/remez.

UPDATE: it's not clear from the above what my objectives were. I wanted to to produce exact values for integer powers of 2 including log2(1). This approach also gives a small relative error around x=1.

I once spotted a plane going circles over North London.

https://mobile.twitter.com/nasonov/status/484027620993273857...

Re:Ex-Goldman Programmer Found Guilty on Friday May 01, 2015 @04:19PM (#9474243)
Indeed, it has been discussed many times. But I don't remember any discussion on attribution rights. If GS replaced GPL text with their own header they presumably deleted names of the original authors. I wonder if those authors could (collectively perhaps) send a complaint to GS and ask to restore the attributions?
Re:OpenBSD's new file(1) is now priv-separated on Tuesday April 28, 2015 @06:17PM (#9455439)
It depends on how much effort you put in making sure your parser is robust. I ran AFL tests for several days trying to find bugs in Lua parser but AFL kept discovering a way to load a binary chunk. After that, it didn't take to crash on a malformed binary chunk. Priv separation is a good idea even if you trust your parser.
Why [0, 1] interval is so popular in random number generators? It's one of the worst intervals possible imo because it includes subnormal numbers. The interval [1, 2] is much nicer. Some implementations generate random numbers in [1, 2] and subtract 1.0: http://permalink.gmane.org/gmane.comp.lang.lua.luajit/3051
Re:C99 tricks on Sunday February 15, 2015 @05:09AM (#9052231)
I use lengthof for lengths of string literals.
Re:Unofficial DynASM Documentation on Wednesday June 18, 2014 @06:15AM (#7909288)
Hi Luke, Take a look at bpfjit in NetBSD. It uses bsd licensed sljit library to generate code for multiple platforms. The library has some slight overhead over hand-written assembly but it gives you a single codebase for all platforms. At the very least, you can borrow some optimisations from my code. http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/net/bpfjit.c?onl... PS I can't work on sponsored projects. Alex