HNHacker News
TopNewBestAskShowJobs

filmor

1,085 karma · joined November 27, 2014

submissionscomments
filmor··on HPy – A better C API for Python
cffi replaces ctypes, which is a completely different thing. cpyext is a reimplementation of the Python C-API, so no attempt at improving the API.

HPy on CPython uses the existing C-API under the hood, so there is zero need to build up some keep someone out...

filmor··on Ask HN: What is the best way to learn Erlang?
Well, Erlang has been picking up :)

- OTP27 added sigils[0], which allow you write UTF8 strings with just an additional tilde character

    ~"hallöchen" =:= <<"hallöchen"/utf8>>
- Also, since OTP27, Erlang's own documentation[1] is written in Markdown and created using ex_doc[2] - doc attributes etc. have been added in OTP27 as well, I think - You can use ex_doc in your own Erlang projects using rebar3_ex_doc for a while now[3]

I also miss the pipe operator, but there seems to be some opposition against it in Erlang-land (and it would need to be adjusted as Erlang's standard library doesn't put the "main" argument consistently in the first argument slot like Elixir does).

[0]: https://www.erlang.org/blog/highlights-otp-27/#sigils [1]: https://www.erlang.org/doc/readme.html [2]: https://hexdocs.pm/elixir/writing-documentation.html [3]: https://hexdocs.pm/rebar3_ex_doc/readme.html

filmor··on The perils of transition to 64-bit time_t
On Gentoo, definitely. I really don't want to rebuild my whole system whenever some foundational library fixes a bug. It already annoys me quite a bit that I need to set up sccache to get half-way reasonable compile times out of Rust projects (and I'm saying that as someone who enjoys gradually replacing significant portions of the userspace with Rust tools).
filmor··on Routed Gothic Font
1Il (one, upper case i, lower case L) all seem to look alike in this font. For me, that disqualifies it as a coding font.
filmor··on COSMIC Alpha Released
For me it has been running with minor issues and very few crashes for the last month as my daily driver on both my work (Fedora) and my private (Gentoo) laptop.
filmor··on Microsoft donates the Mono Project to the Wine team
Mono has support for app domains (and is in general closer to .NET Framework), a more powerful C API and runs on more architectures.
filmor··on Peng – A minimal Rust-based quadrotor simulation pipeline
https://rerun.io/

Quite obvious, if you scroll to the "Getting Started" section.

filmor··on Julius: Open-source reimplementation of Caesar III
Augustus, referenced in another top level comment, adds roadblocks to Caesar III (among other gameplay changes).
filmor··on Mini imported Japanese vehicles may soon be banned on Massachusetts roads
Where does it say that K-cars are not allowed on highways? I'm certain that I saw quite a few, and I can find no source that says otherwise.
filmor··on Fixing a memory leak of xmlEntityPtr in librsvg
The dev did not "forget a single punctuation mark". It was there and it was correct. What was /not/ correct is that he did not implement any form of implicit resource freeing in an RAII-language. Doing resource management using scopes is a choice. It's not inherently better or worse than explicit resource management with something like Go's `defer`. But if that choice is made, as in Rust or C++, you have to ensure that the implicit resource management is correctly implemented (Drop in Rust, destructors in C++). Same as in Go, where you have to ensure that you call `defer` with the correct cleanup function or in C# where you have to use `using` on your disposables, etc.
filmor··on Fixing a memory leak of xmlEntityPtr in librsvg
The ? is not really the issue here. Rust is similar to C++ in that it encourages implicit resource management using scopes, so if you have resources that have to be free'd, you have to implement Drop somewhere.

The code would have looked just as correct and would have been just as wrong with the "old" non-sigil `try!(...)` syntax.

filmor··on What Is in a Rust Allocator?
I have no idea what you are getting at. I just stated that you alloc/realloc what you require for your type. If you want to over-allocate, do it. But I don't see the need to know the size of the memory block that fulfilled your request.

That also gives the allocator the flexibility to use part of a block that it gave to you for someone else if that makes sense.

E.g. you request 200 bytes, a block of 256 bytes is actually allocated. Now you request with some other code 30 bytes. If the allocator had told you at allocation time "here are your 200 bytes, but just so you know, there's another 56" it could not hand the unused part of the 256 bytes to the next allocation.

filmor··on What Is in a Rust Allocator?
The growable array type would use `realloc` when growing, which can make use of this internal information without exposing it.
filmor··on North Yorkshire Council to phase out apostrophe use on street signs
The first two are accents, and to me it always looks extremely unprofessional when they are abused as apostrophes.
filmor··on Run0, a systemd based alternative to sudo, announced
This is about Kay Sievers, not Lennart Poettering.
filmor··on You can't just assume UTF-8
Arabian numerals are derived from Indian scripts, which are written left to right, yet the order of digits is already the same we have today.
filmor··on Laws of Software Evolution
Because it doesn't talk to other, potentially changing systems. As soon as an application is networked, it requires maintenance.
filmor··on MuPDF WASM Viewer Demo
If webOS came out with WASM already in place, it would have been even better :)

When the Touchpad was firesaled, I got one and was disappointed with the PDF viewer. Because there was no such thing as WASM (or even asm.js) at the time, it used out of the box a service provided by Adobe that on request from the UI rendered tiles of the PDF at different resolutions, depending on the zoom level.

Since the frontend code was JS, it was easy to implement an alternative via mupdf (https://github.com/filmor/webos-pdf/blob/master/arxservice.c...). Via the same inefficient process (rendering png tiles onto the filesystem), the mupdf implementation was about 3 times faster than the original (though, it's been 13 years, the actual speedup might have been less :)).

filmor··on What we know about the xz Utils backdoor that almost infected the world
The build scripts of OpenSSH are irrelevant. The malicious code is embedded on building an rpm or deb for liblzma itself and becomes active when the dynamic library is loaded. There is a recent PR for systemd that instead of linking to the compressors during build dlopen-s them when used (https://github.com/systemd/systemd/pull/31550) which disables this particular path, but any initial load of a backdoored liblzma makes sshd exploitable (see https://lwn.net/ml/oss-security/20240329155126.kjjfduxw2yrlx..., section "Analyzing the injected code").

Lennart Poettering stated on a mailing list that e.g. libselinux als links liblzma and ends up in a lot of services on SELinux-enabled systems.

filmor··on Managing mutable data in Elixir with Rust
As an aside: The particular technique used in the OP (resource objects) is actually not transparent. If you send the object handle to another machine, it will have an opaque handle that it can't do anything with apart from storing and sending around. However, if the other machine sends it back (and the resource object hasn't been deallocated in between) it will be the same as the one that you sent.
filmor··on Managing mutable data in Elixir with Rust
It's still to a large degree Rust itself. It's the language design which makes it possible to wrap the NIF C API in a safe fashion (e.g. using lifetimes, phantom data, etc.). The only additional safety feature we use is catch_unwind (https://doc.rust-lang.org/std/panic/fn.catch_unwind.html) to prevent panics from unwinding into the BEAM (and killing it).
filmor··on Managing mutable data in Elixir with Rust
ETS tables are absolutely mutable, they even have specific functions to iterate over them while being mutated (https://www.erlang.org/doc/man/ets#safe_fixtable-2). I use them extensively to share data in a "lock-free" fashion with other processes (a `gen_server` that gets all messages and aggregates data in ETS tables, retrieval via direct reads on a known table name instead of gen_server:call). Mnesia is also (usually) ETS down below.
filmor··on The current state of OpenTelemetry
Metrics are implemented in the `opentelemetry_experimental` application. Last time I tried them, they were still a bit buggy but working (not complete, thiugh).
filmor··on Jaq – A jq clone focused on correctness, speed, and simplicity
SQL is built for relational/tabular data, JSON is not relational and usually not tabular.
filmor··on 'Energy independent' Uruguay runs on 100% renewables for four straight months
Yet, the per capita energy usage is much higher in Uruguay, according to these:

https://www.worlddata.info/america/uruguay/energy-consumptio... (3.4 MWh) https://www.worlddata.info/america/brazil/energy-consumption... (2.5 MWh) https://www.worlddata.info/america/argentina/energy-consumpt... (2.6 MWh)

filmor··on Inko Programming Language
`unwrap_or` and `expect` work exactly like they do in Rust. The naming of `expect` works nicely if the argument is the precondition that failed (see https://doc.rust-lang.org/std/error/index.html#common-messag...), e.g.

    .expect("should have opened file")
filmor··on George Carlin's "Soft Language" (2019)
Invalid is derived from Latin with validus meaning "strong" or "in order". The German and Dutch uses of the word are derived directly from invalidus meaning ~"weak" (maybe via French), while the English word (as its mostly used) is an English(!) negation of "valid", which leans on the "in order" part to get to "inappropriate" or "not correct".
filmor··on Calling Rust from Python
FFI+cffi has the advantage that you leave Python specifics out of your Rust binding, so it's effectively a proper C binding that can be used for other FFI integrations as well.
filmor··on Austria rail operator OeBB unveils new night trains
Big companies like ÖBB can get their power through long-lasting power purchase agreements from renewable energy producers.
filmor··on What if OpenDocument used SQLite? (2014)
Not to be confused with Office Open XML (OOXML), Microsoft's "standard".
← PreviousPage 2 of 12Next →