HNHacker News
TopNewBestAskShowJobs

chlorion

771 karma · joined November 25, 2021

submissionscomments
chlorion··on Backblaze seemingly does not support files greater than 1 TB
A disk image is just a file though. Does it do some sort of analysis of files and block disk images somehow?

Maybe you mean that it doesnt do image-level backups by default?

chlorion··on F-strings for C++26 proposal [pdf]
Being able to use string formatting without a heap is pretty cool.

Rusts string formatting machinery does not require any heap allocations at all, you can for example impl fmt::Write for a struct that writes directly to a serial console byte-by-byte with no allocations, and then you have access to all of rusts string formatting features available to print over a serial console!

I'm not sure about the horrifying and dangerous extensions part though, I'm not really a C++ expert so I don't know if there's a better way to do what they want to do.

chlorion··on Ada's dependent types, and its types as a whole
I'm pretty sure that gentoo also packages ada, but it doesn't get installed by default, as its behind a USE flag.
chlorion··on Borrow Checking, RC, GC, and Eleven Other Memory Safety Approaches
Theres even more than just UAFs that you have to worry about in a single threaded context, but yes you are correct.

Here's a good post that talks about why shared mutability even in single threaded contexts is dangerous: https://manishearth.github.io/blog/2015/05/17/the-problem-wi...

chlorion··on Show HN: A portable hash map in C
It depends.

You can corrupt memory in such a way that allows executing arbitrary code, in which you could do anything that the process has privilege to do, which is probably reading and writing files as the current user and a lot more.

chlorion··on Emacs arbitrary code execution and how to avoid it
Would you mind explaining how you could do this?
chlorion··on The two factions of C++
Imagine an engineer in any other field acting like this.

"I don't want to install air bags and these shiny safety gadgets into my cars. We have been shipping cars without them for years and it works for us and our customers."

The problem is that it doesn't actually work as well as you think, and you are putting people at risk without realizing it.

chlorion··on "Begin disabling installed extensions still using Manifest V2 in Chrome stable"
I used the lite version while on chromium for some time. I noticed no difference in terms of blocking ads.

The main thing I missed was the ability to block arbitrary elements with the zapper. I use this for more than just ads, so losing it is a real loss in functionality. Otherwise it worked fine.

chlorion··on "Begin disabling installed extensions still using Manifest V2 in Chrome stable"
Yup, the MV3 version requires zero permissions and in theory should be faster. These are real benefits that for some reason nobody will admit exist.

Saying anything positive about MV3 or the lite extension seems to get you downvoted without explanation though, which is a nice example of how absurd this site is when it comes to anything related to Google.

Sometimes I think downvoting should require leaving a comment and reason, because I can't see any reason to downvote this other than "google bad".

chlorion··on Nearly all Nintendo 64 games can now be recompiled into native PC ports
There are lots of emulation methods but interpretation is probably(?) the most common or at least very common.

Interpretation involves writing a VM that represents the state of various parts of the machine, and executes instructions that change the state of the VM, with varying levels of accuracy.

chlorion··on The V8 Sandbox
Yup you can write a garbage collected interpreter for a programming language with no unsafe code at all, even for languages that have complex data structures like doubly linked lists in them.

Using something like a slotmap to store the languages objects in is what I would do, and your GC would just involve removing values from the map after marking everything that's reachable.

The popular slotmap crate on crates.io does contain unsafe code but nothing about the data structure inherently requires unsafe.

chlorion··on Show HN: File-based cache for slow Python functions
I think python objects have a __hash__ method available on them as well that can be used for hashing. That should be even much faster than sha1, but for this use case I'm not sure how much it really matters. Would be interesting to benchmark!
chlorion··on Show HN: File-based cache for slow Python functions
Using md5 for this seems like an odd choice.

Sha1 is a better choice even for non-cryptographic use cases, it's quite a bit faster than md5. Even better would be something like xxhash!

According to a quick bash script I wrote to benchmark the popular hash functions, md5 comes out last compared to sha1, sha256, sha512, and blake2, and by a decent margin!

A good rule of thumb is to never use md5 at all. Not even for non-cryptographic use cases. It's not only broken, but also very slow!

chlorion··on The return of the frame pointers
The bounds safety C compiler extension research by Apple has measured the runtime impact of adding bounds checking to C and it is not a lot more than 1-2% in almost all cases. Even in microbenchmarks its often around 5%. The impact on media encoding and decoding was around 1-2% and the overall power use on the device did not change.

https://www.youtube.com/watch?v=RK9bfrsMdAM https://llvm.org/devmtg/2023-05/slides/TechnicalTalks-May11/...

It's a myth that bounds checking has extraordinary performance costs and cannot be enabled without slowing everything to a halt. Maybe this was the case 10 years ago or 20 years ago or something, but not today.

chlorion··on The 'drinking bird' makes a comeback and could power gadgets with clean energy
Hair dryers and clothes dryers both operate by adding a bunch of heat to the thing they are trying to dry. I am not a physics expert but that seems to suggest that heat helps speed up evaporation!
chlorion··on C++ Safety, in Context
The performance and power use cost to checking bounds is trivial!

Apple has tested this, on mobile devices even, when working on -fbounds-safety. From the slides:

    System-level performance impact
    • Measurement on iOS
    • 0-8% binary size increase per project
    • No measurable performance or power impact on boot, app launch
    • Minor overall performance impact on audio decoding/encoding (1%)
    • System-level performance cost is remarkably low and worth paying for the security benefit
Some more specific synthetic benchmarks suites reported ~5% runtime cost for bounds checking.

https://www.youtube.com/watch?v=RK9bfrsMdAM https://llvm.org/devmtg/2023-05/slides/TechnicalTalks-May11/...

Bounds checking being omitted due to performance is mostly a myth, the only time this should ever be believed is in very specific circumstances such as performance critical code and when the impact has actually been measured!

chlorion··on Bash Debugging
Gentoo has a script that you can source at /lib/gentoo/functions.sh that provide various helper methods, mostly for printing messages, and it provides nice little green and red starts to indicate whether something has succeeded of failed.

I use functions.sh in all of my scripts that are known to be running on Gentoo only and it makes them feel Gentoo-y and is useful in general.

chlorion··on You've just inherited a legacy C++ codebase, now what?
In Emacs I have clangd and clang-tidy running on each key stroke!

The project size is probably a lot smaller than what most people are working on though, and I have a fast CPU and NVME disk, but it's definitely possible to do!

I'm not sure about the fuzzer part though.

chlorion··on The Emacsen family, the design of an Emacs and the importance of Lisp (2023)
>For example: in VSCode the user doesn't have to understand how to install a language server, it just automagically suggests allowing it to install one for you. In Emacs, if you're using the official distribution you will have eglot, whose developers specifically refuse to add that functionality.

I can understand this not being friendly for some users, but on most systems that people are using Emacs on, software is installed through a system package manager and not downloaded and unpacked into ${HOME}. I do not want software that isn't the system package manager to install LSP servers.

Maybe this is more of an issue for people using Emacs on Windows, since there is no system package manager, and people are less likely to understand how to install stuff.

chlorion··on XFCE 4.20 Aiming for Usable Wayland Support While Maintaining X11 Compatibility
X11 is objectively more bloated and full of junk than Wayland.

Nothing wrong with wanting to stick to X11, but if you are doing so because you want to avoid bloat, you are probably confused.

chlorion··on Zed, a collaborative code editor, is now open source
There are multiple tree-sitter based major modes that are usable right now!

I use python-ts-mode, rust-ts-mode, c++-ts-mode, bash-ts-mode and a few more right now and they work well.

You can write your own modes with it also, but I have not yet looked too deeply into this.

It's definitely usable today in emacs-29, but not every language has a tree-sitter mode yet.

Whoops my tab was outdated and I didn't see that others already replied.

chlorion··on Brains are not required to think or solve problems – simple cells can do it
I think you are still conscious during the blackout, you just don't have a memory of it. Amnesia is the effect here, which is a little different than actually being unconscious the whole time.

When in surgery you really are unconscious though, hopefully at least.

I would compare this to forgetting what exactly you did on this exact day and this exact time one year ago. You can't remember it (most likely), but it doesn't mean you were unconscious during that time.

chlorion··on Polymorphic Types in C [pdf]
>passing incompatible types is a constraint error in C just as in C++. Whether this is a warning or not depends on the compiler and on compiler flags.

Much of the existing C code out there is filled with these things because they weren't errors until recently, and people ignore warnings. This is why Fedora and Gentoo are doing so much work to port all of their software to "modern C", so that it will actually compile with new compilers, and hopefully fix bugs at the same time. Existing c++ code did not have this problem because it was always an error.

Note that modern compiler in this case means bleeding edge, released literally within weeks or months of this posts date, most distros are not yet compiling the world with these and most users are not using them.

https://fedoraproject.org/wiki/Changes/PortingToModernC https://wiki.gentoo.org/wiki/Modern_C_porting

>Passing void* around is also generally not necessary in C.

This is not true.

I know several examples in real libraries that require this, two OTTOMH is PAM and Wayland. Both of these require void pointers to give you access to some state object that you create and need passed around, it has no way to know what this type will be ahead of time, and C has no other way to do this.

Another example is data structures or algorithms on data structures like sorting, you either use macros to emulate generics or you use void pointers. Qsort is a perfect example.

>One can take the address of an array and then get the same type checking.

I don't think this is true, C will not include the length in the type. Passing std::array<T, N> in C++ causes an error if T or N are different, in C this length information is not part of the type and does not get type checked.

chlorion··on New theory suggests LLMs can understand text
Not all of it is an opinion.

The LLM does not have the ability to tell you what it knows and what it doesn't know about a subject. In order to get information out of it, you need to present it with a pattern that matches with something it was trained on.

An example, is that an LLM can tell you how many programming languages it knows, how much it knows about them (which one it understands best), and how many it doesn't know. If you ask it a question like "how to do X in python", it will have been trained on something that roughly matches that and give a response, but if you ask "what things do you know how to do in python", and it simply is not capable of giving a response.

I'm not sure that this means it doesn't have some form of understanding of things, and I do believe that AGI is possible to create in general with sufficient technology, and I do realize that our brains may work in a similar way, but I think LLMs are missing something when it comes to understanding and creating that we have not yet figured out.

chlorion··on Polymorphic Types in C [pdf]
It's definitely not a myth.

A trivial example is assigning pointers to incompatible types or passing them to incompatible function parameters not being an error. GCC 14 and Clang 16 are only just now making these errors by default. C++ never had this problem.

Another example, is having type safe generic functions and classes. Using void* to pass around arbitrary types is something that you don't need to do in C++ because it supports generic programming.

In C++ you can for example, pass an array of a specific length to a function, and make it a compile time error to pass an array of incorrect length, using std::array. In C arrays decay to pointers.

static_case is also a thing in C++ that allows you to cast between types much more safely.

There are so many things that I could probably spend several hours typing them out and I don't think that is really needed.

C++ is certainly more type safe than C, whether or not you think the tradeoffs it makes are worth is something to debate for sure, but it gives you tools to write type safe code that simply don't exist in C.

https://wiki.gentoo.org/wiki/Modern_C_porting#What_changed.3...

chlorion··on On being listed as an artist whose work was used to train Midjourney
In your first two examples, Google is still not providing an alternative to the original content, the people who have uploaded the content are and they are doing so illegally.

Also, Google can and will delist stuff that is violating copyright if you report it: https://transparencyreport.google.com/copyright/overview

The Google Books thing is a lot more interesting I think. I guess the idea is that Google is acting as a Library, and they are lending you the book? I'm not sure how I feel about this and I would need to do a lot more research on it before having a strong opinion.

The other big difference here is that you can't use the content linked from Google search as if it were your own. If you Google search "nes emulator in javascript", and you get a link to a Github repo, you can't copy paste the code as if it were your own, and even basing your code on what you have saw could be risky depending on the license of the repo. LLMs are acting as a sort of search engine, pretty similar to how Google search does, but people are using the output from the "search" as if it were their own work that they have full rights to!

chlorion··on On being listed as an artist whose work was used to train Midjourney
Googles search engine is not selling derivative works.

If you search for a Disney movie on Google search, it does not try to sell you a film derived from the movie.

chlorion··on On being listed as an artist whose work was used to train Midjourney
No, and I don't think anyone is arguing that LLMs should be illegal either.

I personally am not against LLMs training on things the operator has rights to, and even training on copyrighted things, but I am against it laundering those things back out and claiming it's legal.

chlorion··on On being listed as an artist whose work was used to train Midjourney
The difference is that the LLM is still copying copyrighted material in your case, but if I burn a Linux ISO, that is not happening.

You do not have to produce an exact copy of something to violate copyright, and I think anything the LLM outputs is violating copyright for everything it has ever trained on, unless the operator (the person operating the LLM and/or the person prompting it) has rights to that content.

chlorion··on On being listed as an artist whose work was used to train Midjourney
Google is not producing something that competes with or is comparable to what it's parsing and displaying, which makes it very different.

Google is displaying the exact content and a link to the source, and is functioning as a search engine.

Copying music (or whatever), and then outputting music based on the copied music is not the same thing as a search engine, it's outputting a new "art" that is competing with the original.

Another way to put it, is that you can't use a search engine to copy something in any meaningful way, but copying music to produce more music is actually copying something.

← PreviousPage 3 of 16Next →