HNHacker News
TopNewBestAskShowJobs

remexre

1,591 karma · joined October 12, 2016

PhD student at https://melt.cs.umn.edu/

Researcher at https://www.sift.net/

Email is concat ["me@", username, ".com"]

submissionscomments
remexre··on Show HN: Minimax – A Compressed-First, Microcoded RISC-V CPU
Interesting that shifts are in the <1IPC set; I thought those were fairly cheap with a barrel shifter; does this simply omit one for space purposes, or are they more expensive than I expect?
remexre··on C Minus Minus
And relevantly, people were clamoring for a non-LLVM AArch64 backend due to how slow LLVM is at codegen by comparison...
remexre··on How much have tech layoffs affected engineers vs. other departments?
Dental?
remexre··on Zig-style generics are not well-suited for most languages
What're the failings of elaborator reflection in providing this in your view? I haven't used it thoroughly, but I thought one could define custom binding forms with it (in Idris 1, at least).
remexre··on What can’t the internet handle in 2022? Apostrophes
It's pretty believable to me that _some_ Java deserialization library from the early oughts totally does this as a default behavior.
remexre··on ZFS 2.1.6
I would suspect Nix wouldn't be the optimal way to manage Ubuntu kernel modules; I suppose you could use it to build them, but I don't think Nix without NixOS will e.g. configure DKMS for you.
remexre··on Linux Kernel 6.0
ublk -- performant user-space block drivers; though maybe it's not of the most utility unless the network-raid things companies have been building on it get open-sourced (might've already happened, I haven't been following closely)
remexre··on Solo founder dilemma; CEO or CTO?
Yep, the founder of my company is still the "Vice President of Research"!
remexre··on Rust-Written Apple DRM Linux Kernel Driver Renders First Cube
- Integer promotion -- Nope, you need to explicitly cast; integer _literals_ get their type inferred, though.

- Implicit casts

It has the following coercions:

+ Subtyping, which is based on lifetimes, not inheritance -- e.g. I can use a global array somewhere an array with a shorter lifetime is required

+ unique references to shared references, unique references to mut pointers, shared references to const pointers, mut pointers to const pointers

    &mut ---> &
     |        |
     v        v
    *mut ---> *const
+ "deref coercion" -- basically, if you have a smart pointer (e.g. a reference counting one), you can get a reference out of it

+ "unsizing coercions" -- if you have some pointer type that points to e.g. an array of known size, and you want to change it to a (bounds-checked!) pointer to an array of unknown size (a slice, in Rust parlance), that coercion occurs

+ function types to function pointer types

+ the ! type to any other type -- there are no values of the ! type, so this is sound (it's the type that e.g. exit() returns)

- loop keywords -- it's just for and while, not even do-while

- switch -- It has real ML-style pattern-matching, with extra goodies for pattern-matching on arrays more easily. This doesn't have the fallthrough problems of C, and is more expressive to boot.

- enum -- Again, the real ML-style design. Typesafe, and _far_ more expressive.

- _Generic -- Another ML-family design :) This time via traits, which are similar to typeclasses in languages that have those instead. Think, "interfaces, but don't require a vtable (unless the programmer requests one)"

- typeof -- Nope, though there's (ML-family-style again!) type inference, so the cases where it'd be necessary in e.g. C macros just aren't a problem.

- No explicit number of bits -- the builtin types are u8, i32, f64, etc. -- the only ambiguously-sized integers are isize/usize, which I believe are specified to be the same size as size_t; I don't know that there's a pointer-sized integer type for platforms with larger pointers than size_t's (e.g. ARM Morello and other CHERI CPUs)

Which language(s) do you like more for writing this kind of systems program?

remexre··on Cloudflare has replaced Nginx with in-house, Rust-written Pingora
They might've just embedded Lua into the Rust, same as one would for C
remexre··on About Lockdown Mode
It means an attacker with an arbitrary-write vuln needs to be able to target a page as the JITted code is being written to it, rather than being able to target any existing page with code in it.
remexre··on A pair of Linux kernel modules using Rust
You already could, actually! zgrep CONFIG_9P_FS /proc/config.gz to see if your kernel's configured for it, modprobe 9p if it's built as a module. The article's talking about doing an in-kernel 9P _server_ instead; I think this is just so that it can act as an abstraction of an SMB server, because you ought to be able to do a 9P server in userspace with no loss of capabilities...
remexre··on JavaScript hydration is a workaround, not a solution
I can see email and chat, sure, but ebooks, forums, video tubes, and documentation? All four of those seem like they shouldn't require much JS, and I would be unsurprised to find good examples of each that work even with JavaScript disabled.
remexre··on I have complicated feelings about TDD
> is when the component in question is a low level component in the system that must be relied upon for correctness by higher level parts of the system.

And then, property tests are more likely to be possible, and IMO should be preferred!

remexre··on AllegroServe, a web server written in Common Lisp
> We've recently added these features:

> [...]

> - Security up through TLS 1.0 (SSL 3.1).

uhhhhhhhh, isn't this removed from Firefox for having security holes fixed in later versions of the TLS spec?

remexre··on C99 doesn't need function bodies, or 'VLAs are Turing complete'
> Though I do wonder why there can't be a form of malloc that allocates in a stack like fashion in real time

I think that's basically what the LLVM SafeStack pass does -- stack variables that might be written out of bounds are moved to a separate stack so they can't smash the return address.

remexre··on Factor: A Practical Stack Language
I'm developing one at https://git.sr.ht/~remexre/rtf -- it's nowhere near ready for general use, but idiomatic code looks like:

    : parse-digit ( u -- u -1 | 0 0 )
      { DUP $30 $3a WITHIN } { $30 - TRUE }
      { DUP $41 $5b WITHIN } { $37 - TRUE }
      { DUP $61 $7b WITHIN } { $57 - TRUE }
      { ." parse-digit 1: " TODO } 3 CASE ;
    : add-digit ( u u -- u flag )
      ." add-digit 0: " TODO
      ;
    : parse-digits-0 ( u addr len -- u flag )
      { OVER B@ -ROT { parse-digit } 2DIP ROT
        { { SWAP base B@ * + } 2DIP 1 /STRING parse-digits-0 } WHEN
      } { DROP TRUE } ?COND ;
    : parse-digits ( u addr len -- u flag )
      { parse-digits-0 } { DROP FALSE } ?COND ;
    : parse-prefix-if-exists ( addr len -- addr len 0|1|2 )
      DUP {
        OVER B@
        { DUP $2d = } { DROP 1 /STRING 1 }
        { DUP $7e = } { DROP 1 /STRING 2 }
        { DROP 0 } 2 CASE
      } { 0 } COND ;
    : parse-base-if-exists ( addr len -- addr len base )
      DUP {
        OVER B@
        { DUP $23 = } { DROP 1 /STRING #10 }
        { DUP $24 = } { DROP 1 /STRING $10 }
        { DUP $25 = } { DROP 1 /STRING %10 }
        { DUP $5e = } { DROP 1 /STRING ^10 }
        { DROP 2DUP $3a SCAN DUP } {
          1 /STRING { NIP - 1- 10 BASE B! 0 -ROT parse-digits } 2KEEP
          ROT { ROT } {
            ." parse-base-if-exists 1: " TODO
          } COND
          \ ." parse-base-if-exists 2: " TODO
        }
        { 2DROP base B@ } 5 CASE
      } { base B@ } COND ;
    : with-saved-base ( x*i { x*i -- x*j } -- x*j )
      base B@ SWAP DIP base B! ;
    : apply-prefix ( u 0|1|2 -- n )
      { } { NEGATE } { INVERT } 3 SWITCH ;
    : parse-number ( addr len -- u -1 | 0 0 )
      { parse-base-if-exists base B! parse-prefix-if-exists
        { 0 -ROT parse-digits } DIP
        SWAP { apply-prefix TRUE } { DROP FALSE } COND
      } with-saved-base ;
(This being an incomplete rewrite of the bootstrapped text interpreter's number parser; as I said, nowhere near ready.)
remexre··on Embed is in C23
> It doesn't have to, you just add a zero byte at the end of the embedded byte sequence in the object file. It's up to the programmer to make the choice how to interpret that.

Like, are you proposing that the ideal semantics for `#embed "foo"` if foo contained 0x10 0x20 0x30 0x40 to be to expand to `16, 32, 48, 64, 0`? That seems more annoying than the opposite, given that:

> That said for binary embeds you almost always need the length embedded as well, which has been the case for every tool I've used to embed files in object code. You usually get something like

TFA demonstrated it by relying on sizeof() of arrays doing the right thing:

    static_assert((sizeof(sound_signature) / sizeof(*sound_signature)) >= 4,
        "There should be at least 4 elements in this array.");
You'd need to change this to subtract one every time, which sounds more annoying when embedding binary resources than adding the zero to strings would be.
remexre··on Embed is in C23
https://github.com/camel-cdr/execfs ?
remexre··on Embed is in C23
How does the compiler know if an array is a string or not?
remexre··on About using Nix in my development workflow
It doesn't have useful types for a lot of low-level abstractions; take, for example, all the stuff hanging off of stdenv -- if I'm trying to get nixpkgs up and running for a new C compiler that's neither GCC nor Clang, for example, it'd be really nice to know what all attributes need to be set for that. Instead, this ends up being a multi-day exploration through the nixpkgs source, where it turns out that (undocumentedly) the compiler must be named either gcc or clang...
remexre··on Asahi Linux: July 2022 Release and Progress Report
This is the userspace part of the driver, not the kernelspace part; the existing open-source graphics drivers already are (for the most part) in C++, because extern "C" is less of a pain than writing a compiler in pure C
remexre··on Tell HN: We are trying to get tail calls into the WebAssembly standard
Yep, a basic security check for any endpoint that accepts JSON: what happens when you hand it 4KiB of '[' characters
remexre··on Timeline of “foundational” advances in homotopy theory?
Is there a non-homotopy type theory with univalence?
remexre··on Timeline of “foundational” advances in homotopy theory?
Univalence seems generally useful for verified software engineering, if we could get it in a system with regularity.
remexre··on How safe is Zig?
Could this be integrated into the LLVM SafeStack pass? (I don't know how related Zig still is to LLVM, or if your thing would be implemented there.)
remexre··on The State of WebAssembly 2022
See this subthread: https://news.ycombinator.com/item?id=31810249
remexre··on The State of WebAssembly 2022
It would also be kind of nice if web developers knew they couldn't use more than 4GiB per tab, so didn't even try to get close :P
remexre··on Fork() without exec() is dangerous in large programs (2016)
no, fork creates a new address space, vfork doesn't

the posix_spawn mentioned in the article is effectively the equivalent of CreateProcess

remexre··on Fork() without exec() is dangerous in large programs (2016)
Isn't vfork much worse in terms of the problem the author is talking about, since the child can now acquire locks in the _parent's_ address space?
← PreviousPage 11 of 23Next →