HN2new | past | comments | ask | show | jobs | submit | orivej's commentslogin

Some Common Lisp FFIs have opted to coax this information out of the compiler. https://github.com/rpav/c2ffi is a C++ tool that links to libclang-cpp and literally outputs JSON with sizes and alignments. (It is then used by https://github.com/rpav/cl-autowrap to autogenerate a Lisp wrapper.) The older CFFI Groveller [1] works by generating C code which is compiled by the system C compiler (e.g. GCC or Clang) and, when executed, prints Lisp code that contains resolved values of constants, sizes, alignments, etc.

[1] https://cffi.common-lisp.dev/manual/html_node/The-Groveller....


Very lisp. Basically reprogram itself. Unfortunately this is not applicable to maintained code like c, rust … etc?


In fact, in a way C and Rust do the same thing!

When you run ./configure or cmake for a C program, it often prints something like "configure: checking size of long long" or "-- Check size of long long". This is done by generating, compiling and running a short C program that prints sizeof long long. The result goes into an autogenerated config.h.

In Rust the first example of build.rs usage [1] compiles and runs a C program during the build of the crate, and the next page [2] shows how to use autogenerated Rust code with include! macro.

Lisp is more similar to C or Rust than you might think. Code generation typically happens while the library or program source code is being loaded, and it is orchestrated by a declaration in an .asd file, which is analogous to meson.build, but looks more like Cargo.toml, e.g. [3]

[1] https://doc.rust-lang.org/cargo/reference/build-scripts.html [2] https://doc.rust-lang.org/cargo/reference/build-script-examp... [3] https://github.com/rpav/cl-freetype2/blob/b7871aed0c5244fc3b...


The attack relies on the fact that when downscaling by a large factor, the tested downscalers (except Pillow in non-nearest neighmode mode, and all of them in area averaging mode) ignore most of the pixels of the original image and compute the result based on the select few which are the same in all modes, making the result look nearly the same regardless of the mode.


Thanks for that reference to Pillow. I presume it's from "Understanding and Preventing Image-Scaling Attacks in Machine Learning" [0] which mentions secure scaling algorithms immune to the attack. I wish I could mention this in the grand parent, but the editing window closed.

[0] https://www.sec.cs.tu-bs.de/pubs/2020-sec.pdf


Gentoo (actually Funtoo) was the last distribution I used on my main laptop before switching to NixOS. (I have tried Guix, but not GuixSD, so won't talk about it.)

> 1) Are these kind of systems overkill for the desktop user?

There is more to learn to be free to do everything — for some this might be too much (even though it is easy to start and the learning is mostly gradual), for others this is fine (especially those viewing the obstacles as opportunities to learn rather than distractions), and many others can be satisfied with their systems before achieving such freedom. While efficient usage of NixOS requires more upfront involvement, once settled or learned it becomes the easiest to maintain, and brings the piece of mind I had with no other OS with its easy global configuration, nondestructive updates, and manageable malleability (adding and customizing packages, effortlessly offloading their build to your other machines with Nix, even without NixOS).

> 2) How easy is it to customize/tweak these systems in the manner that Gentoo does? So, building from source by tweaking the software options on build time?

Nixpkgs have close to optimal balance between the ability to use prebuilt packages and the ability to extend them, and it's more customizable (thanks to Nix and Nixpkgs designed to allow reaching into the old definition of a package, writing tweaks just for the parts you need, while keeping automatic updates!), although it's geared towards users that want most of their packages prebuilt (in particular it does not have cross-cutting USE-flags). You can either replace a package (and cause dependent ones to be rebuilt against it), or override under a new name (and install it alongside other packages that may depend upon and actually use the non-overridden one).


City Car Driving [1] is a simulator that I have seen used in a driving school.

[1] https://store.steampowered.com/app/493490/City_Car_Driving/


Surprisingly I also got 292 (156+136 bonus) on the first try on Lenovo X1 gen 4 (NixOS, Xorg). Both synaptics and libinput powered touchpads have always felt perfect for me, with minor to none customization. (Currently my only setting for libinput is to enable natural scrolling.) However, I have no experience with the Apple laptops.


There is a Pedro Medeiros pixel art tutorial about spaceships shaped from ordinary things: https://www.patreon.com/posts/spaceship-design-16838125


Here is a good starting point to research the critique of this document: https://bugs.ruby-lang.org/issues/12004#note-6 . Its point is particularly apt:

> Given a choice between only two extremes, I'd far rather have Linus Torvalds telling me I'm an idiot and my code is shit, then exist in an offense taking culture where various forms of criticism are re-branded as "harassment."

However, the Linux copy has cut one of the more malicious paragraphs: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...


I would like to extend this point: "I'd rather have Linus Torvalds telling me I'm an idiot and my code is shit, than ... releasing kernel with my shitty code and EVERYONE thinking that I'm an idiot".


But this is a false dichotomy.

They could just refuse your code without calling you an idiot.


Of course there exist examples of Linus calling or even implying that individual people / organisations are "idiots" and they are wrong (and he has acknowledged this). But in the vast majority of cases the criticism is aimed at the code itself and I genuinely don't see the issue with this.


Neither do I


> ... releasing kernel with my shitty code and EVERYONE thinking that I'm an idiot

Or, "releasing kernel with my shitty code and ruining the day for a lot of people."


> it was also found to break some client software -- in particular, the Go DNS library

The issue for the curious: https://github.com/miekg/dns/issues/234


An interesting alternative to SMS over XMPP/IRC over Twilio is SMS over XMPP over your Android phone. This lets you send and receive SMS on the computer and share the history with the phone. For this I'm using MAXS (http://projectmaxs.org/), an open source modular system available on F-Droid and Play store where each module is installed separately and provides a specific service over XMPP, such as receiving new messages, reading old messages, querying location, etc.


I can attest that this works well (I'm using it with the Profanity client), although the contacts aren't treated as IRC users. And a personal plan is much cheaper than Twilio.


> This lets you send and receive SMS on the computer and share the history with the phone

Google has added support for this to their "Android Messages" SMS app on the playstore. They call the feature "messages for web". It's pretty slick actually.


I looked at MAXS once, but couldn't find anything about encrypting or signing messages, which kinda killed it for me.


I use JMP.chat but I'm not exactly sure it is what you are looking for.


with gdb 7.12 or later, you can exclude files matching a glob with "skip -gfile", e.g. "skip -gfile /usr/*".


Thanks a lot for the tip!


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

Search: