pbaam

Joined 3 years ago

Karma
42
Submissions
17
Member since
Aug 5
[ my public key: https://keybase.io/pbaam; my proof: https://keybase.io/pbaam/sigs/Wk2nIaawrTzkm7m-oN3sLH_Z52d7ITFOJnKGVtFVWTU ]
View on Hacker News

Recent submissions

Comment · 1 year ago
https://ziglang.org/documentation/master/#opaque

> opaque {} declares a new type with an unknown (but non-zero) size and alignment. It can contain declarations the same as structs, unions, and enums

So it can contain methods, just like structs. The only thing it cannot contain is fields (which the example above doesn't contain). An opaque type can only be used as a pointer, it's like a `typedef void* ...` in C but with the possibility to add declarations within a namespace

Edit: the documentation doesn't contain any example of an opaque type which happens to have declarations inside. But here is one: https://codeberg.org/andrewrk/daw/src/commit/38d3f0513bf9bfc...

Comment · 1 year ago
Comment · 1 year ago
I guess he means that in order to achieve incremental compilation they need to write their own code generation and linker for every architecture and format. This is needed because incremental compilation here doesn't just mean storing object files in a cache directory (which has always worked that way). They also want to cache every analyzed function and declaration. So they have to serialize compiler state to a file. But after analysis is done, LLVM will start code generation from the beginning (which is the time expensive thing, even in debug builds)
Comment · 2 years ago
I know, it's intentionally unrelated. But if you read my first sentence, you can do what you are interested in without using cat.

  sudo tee somefile > /dev/null
And you will be able to paste from your clipboard or write anything you want. Without cat or piping.
Comment · 2 years ago
The cat command can be omitted there, as tee reads from standard input by default, even if stdin points to a terminal. I was going to comment an actually useful (and unavoidable in bash) use of cat and ssh, which is to do do nothing with standard input and redirect it to a file:

  <file ssh 'cat >file'
And you could just use scp, but I've found clients without scp and servers with the SFTP subsystem disabled.
Comment · 2 years ago
Comment · 2 years ago
Comment · 2 years ago
> Sniffing the traffic from the device showed that it was connecting out to tcp.goodwe-power.com:200001

Is 200001 the right port number? Very good read anyways.

Comment · 2 years ago
Comment · 2 years ago
Comment · 2 years ago
They want to replace LLVM with their own backends. Zig's master branch can now be compiled without LLVM (and without CMake, see bootstrap.c) in x86 Linux because they implemented their own ELF linker and x86 code generation. It's explained in the talk why they want it: Most of the compile time is spent in LLVM, not in AST lowering or semantic analysis. Andrew also said that LLVM's coroutines weren't good enough to implement async/await.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton