HNHacker News
TopNewBestAskShowJobs

deaddabe

432 karma · joined July 9, 2021

French hacker.
submissionscomments
deaddabe··on Ask HN: What is your native language?
French here.

Maybe you should use HN's poll feature in order to be able to aggregate results, but it would be a long list of languages to choose from (or add "other at some point).

deaddabe··on Node.js packages don't deserve trust
Note that this separation is necessary if you want to achieve somewhat parallel compilation in Rust. Every proc_macro needs its own separate crate, so I end up providing two crates for macro-based stuff. At least, the stdlib seems to have enough batteries included for the dependency count to not be as high as NodeJS projects.

From my experience I would rate the count of dependencies in this order:

NodeJS > Rust > Python > C/C++

Though I cannot explain why this is ordered this way between {Node, Rust, Python}. Again, batteries included? Language popularity? Beginners-friendly programming language?

deaddabe··on Show HN: A Graphviz Implementation in Rust
Why imply WASM and a browser? I guess running a benchmark of the two binaries on a host should be sufficient.
deaddabe··on Quick rundown of barcodes and marker systems
Unfortunately it seems that BinaryEye is only able to reason about barcodes, not markers.

None of the markers presented in the article were detected. Some special barcodes, like MaxiCode, were not detected either. Method: I started the app on my phone, pointed it to the laptop screen with the article displayed and scrolled though each example.

deaddabe··on Quick rundown of barcodes and marker systems
Interesting read with a lot of links to explore. I have been digging down this rabbit hole quite a bit myself. For this I have used Binary Eye [1], an Android application that can read but also generate various barcodes (even some not listed in the article like PDF417 [2]).

Wikipedia lists a good number of the different barcode varieties for the curious, both linear and 2D: https://en.wikipedia.org/wiki/Barcode#Types_of_barcodes

After having playing with that, I guess that my next step is to find a webcam and play with marker systems for AR. Does someone have a webcam recommendation (or another device?) to get started with AR/marker detection?

[1] https://f-droid.org/en/packages/de.markusfisch.android.binar...

[2] https://en.wikipedia.org/wiki/PDF417

deaddabe··on The Rust compiler has gotten faster again
From my experience C is very fast to compile. Especially compared to C++, because of the metaprogramming and monomorphization stuff. In C you would use void*.

Dynamic dispatch is faster to compile than static dispatch, but runtime performance differs. You can do dynamic dispatch in Rust, I think it could enable faster/smaller builds but at the cost of worst runtime performance.

Tradeoffs, Yada Yada.

deaddabe··on How trains could replace planes in Europe
The constraint on OUIGO trains is because tickets have to be checked before onboarding. So you have hundreds of passengers to check in line. This takes time. So people are required to come earlier.

However in practice most people respect the 30 minutes, so that you can arrive 10min before the train and get your ticket checked without waiting in line. This is not guaranteed. But often works. I take a lot of OUIGO and never respect the 30 min, because you often wait 10min in line. Once I arrived 5min before departure, had my ticket checked but had to run in front of the correct car. When train arrives nobody is allowed to pass the checkpoint.

For the InOui you can always come 5min before departure, because tickets are checked on-board so there is no wait line.

deaddabe··on High-fidelity remote communication
> If you note, I said I moved back to a studio apartment in Paris. Not a cheap area even if I didn’t live in the center of town but definitely didn’t move there by choice either.

May I ask the reason of work was not the one? I know I would not want to go back in the country side for now, given the limited public transportation and medical infrastructure out there.

> I think you’re mixing two points I’m making. None of the point about offices in city centers and expensive neighborhoods relates to my personal experience. It was a general point about the futility of office-obsession on the part of companies, which was particularly bad even for startups in the Paris area back in 2015/2017. Hopefully it’s better now. But I remember people looking at me like I was mad for saying remote was non-negotiable.

Sorry if I misread or interpreted things too quickly. From what I am witnessing in the area, you currently can :

1 - Go full remote in the country side and have your pay reduced. Job security takes a hit too, because the job market is not "hot" like in the US. 2 - Agree to come to the office 2/3 times a week and go live in the suburbs (or stay in town if you can afford it and enjoy it)

I currently using option 2. Maybe I am missing g other options.

deaddabe··on High-fidelity remote communication
> In general you're right of course, but it still solves the problem that you may not HAVE to move to the expensive place anymore. Of course you still CAN, like the author chose to.

> And as someone who never moved away from where he was born and also never lived in the really expensive part of the city, it might solve the problem of many more people just moving here to work, whereas they would prefer living more remotely. I would love to stay here, for example, not just because of work because I've lived here all my life and like it.

I lived in rural land before moving in the Paris suburbs in order to land a job. In some ways I am glad I had to. It opened me to so many new stuff. I would not imagine enjoying my twenties in rural land personally. The trade of housing space for commodities, almost car free living and infrastructure is currently worth it for me. Maybe I will go back rural in my 30's now that full remote is gaining traction. Or maybe not. I get your point though.

> Also your (and the author's) mention of a studio confused me for quite a bit, we'd never call anything 30m2 a studio where I live :P

The nomenclature we use in France (IIRC) is studio for a single room, and then 1 bedroom, 2 bedroom, etc.. no matter the floor size. How would you call it? And where do you live so we have context in naming things? :)

deaddabe··on My personal journey from MIT to GPL (2019)
(missing "(2019)" at the end of the submission title)
deaddabe··on My personal journey from MIT to GPL (2019)
I share the same point of view now. Especially after now 4 years in the software industry. The quantity of ope source software used is huge. But none of the money goes back to the authors.

Companies have two choices : avoid GPL like pest or embrace it.

We (I, mostly) contribute back to open source at work. The only problem that is not solved yet is should we use GPL-3 code, because we sign software and there is the Tivoïzation clause.

I still continue to release my (Rust) libraries with Apache-2.0/MIT. Because of static linking almost imposed by the current Rust development workflow. LGPL would contaminate the whole software if statically linked. Or make people link to it dynamically. Maybe this is not my problem but the companies'. Should we push for GPL libraries?

deaddabe··on High-fidelity remote communication
The author points out that remote working is solving the "expensive places to live" problem, yet moved to a studio in Paris which are awfully expensive. I am quite of puzzled by this.

Of course, if the author gets the North American salary instead of the European one, while living in Paris, then things might work out financially.

I moved in the deep suburbs of Paris because rent and apartment prices are a no go for a single income person, even in tech.

deaddabe··on Gtk4 Tutorial
Note that this page is a little bit outdated. Not updated since August 2021, and for example does not mention [0] Relm4 [1].

[0] https://github.com/areweguiyet/areweguiyet/pull/77

[1] https://github.com/AaronErhardt/relm4

deaddabe··on Gtk4 Tutorial
You do not have to convert .ui files to Relm code, see gladis's relm example [0].

[0] https://github.com/MicroJoe/gladis/blob/master/gladis/exampl...

deaddabe··on Gtk4 Tutorial
Thanks, it works.

However adding a GtkApplicationWindow and a GtkButton inside of the component tree is not updating the preview area. Adding a know valid GTK3 .ui file [0] does not update the preview area either.

Seems like the "preview" button is also missing from Glade. Oh well, let's edit XML files afterall. :)

[0] https://github.com/MicroJoe/gtk_liststore_item/blob/master/g...

deaddabe··on Gtk4 Tutorial
I downloaded and tried it just now.

When creating a project, I get an empty .ui file with no possibility to add any widget. This project still seems in its infancy, or I am doing something wrong. It also seems to enforce a "framework" instead of just being a graphical .ui file editor. How I am supposed to use this if I am using Rust instead of Python, and Relm instead of their MVC framework?

I miss Glade (and it had issues!).

deaddabe··on Gtk4 Tutorial
I cannot find any relevant documentation while searching "gtk template widgets" in my favorite search engines. Do you have a link? Maybe this crate is still needed because of discoverability issues, if one cannot find an alternative easily.

I have not started to discuss with gtk_rs team for the moment.

Since this second crate has less "stars", I guess the gladis crate should be figured out first: incorporated, or documented in gtk-rs so that it is made obsolete.

EDIT: here is the feature request to merge gtk_liststore_item into gtk-rs: https://github.com/gtk-rs/gtk-rs-core/issues/297

deaddabe··on Gtk4 Tutorial
Gtk-rs is still pretty bare bone.

I tried to do my part by removing boilerplate using macros [1] [2], but it is still complicated to design GTK apps. Even more now, because Glade has been deprecated for GTK4 and no visual editor is available to replace it for now, making developers manually write XML while exploring the sparse documentation. This is a regression for developers' experience.

I am really trying to like GTK after using Qt a lot in the past, but there is just too much effort. Things should be as simple as VB6/WinForms. With no visual GUI editor, I find myself to just write CLI tools in Rust instead of going the extra mile and creating GUIs.

[1] https://github.com/MicroJoe/gladis

[2] https://github.com/MicroJoe/gtk_liststore_item

deaddabe··on Syncthing – a continuous file synchronization program
Nice catch, this usecase seems common enough.
deaddabe··on Syncthing – a continuous file synchronization program
Thanks! I will use the enable-linger on the NAS running 24/7, and configure it using a remote browser (probably via SSH tunnel). This way I can always sync to NAS even if everything else is off, and the laptop/desktop will sync from the NAS when required.
deaddabe··on Syncthing – a continuous file synchronization program
I access radicale via an nginx proxy with proper HTTPS (LetsEncrypt) and an HTPASSWD over that, so the setup is secure. However radicale default setup is not secure, I agree.
deaddabe··on Syncthing – a continuous file synchronization program
Thanks for the suggestion. This is an app for Windows [0] but everything I use is Linux, so the setup to start SyncThing it at boot should be straightforward.

I am more worried about the Android part. The best solution would be to start SyncThing when on my LAN via matching SSID, and disable it when I am out of range.

[0] https://github.com/canton7/SyncTrayzor

deaddabe··on Syncthing – a continuous file synchronization program
For the contacts and calendar I still use the VPS, but with radicale [0] instead of Nextcloud. The resource usage is minimal, probably the attack surface too. And I like the do one thing and do it well mantra (in this case, CalDAV/CardDAV).

[0] https://radicale.org/3.0.html

deaddabe··on Syncthing – a continuous file synchronization program
I have switched from Nextcloud to Syncthing. The former was a resource hog that was eating up too much everything on my modest VPS.

I share the files on my local network at home between phone, laptop and desktop. My only issues so far:

- I need to manually start Syncthing on the devices, whereas Nextcloud was always running on boot. Not sure if I should start it every time, especially on the Android phone which cannot sync while away from home. I do not want to empty the battery while outside of my LAN, + the persistent notification "Syncthing is running" is annoying.

- I need to power up at least the laptop or desktop to backup my phone data. One solution that I will try is to install a headless Syncthing instance on my NAS. This way the phone can always sync to the NAS every time, and then laptop/desktop can sync from NAS when needed.

The joys of peer2peer! At least, I am sure that my moderately sensitive files are not leaving my local network to be stored on my VPS, which can be hacked someday.

I also need to figure out how to install Wireguard on my router to allow to access my NAS from my phone while on a trip, but that's another story.

deaddabe··on Syncthing – a continuous file synchronization program
Can you share a reference wrt evolving Android storage schemes?
deaddabe··on Why I built my own static site generator
What $(BUILDER) are you using? Could be GNU m4 (been there, done that) or something more (or less?) evolved.
deaddabe··on Renters now rule the suburbs in DC, Miami and Los Angeles
Yes
deaddabe··on Show HN: 40k HN comments mentioning books, extracted using deep learning
Impressive work.

What data source are you using for the books, authors and covers? I looked at OpenLibrary [1] but the covers are not the same, so I suppose it is something else? Maybe Amazon directly somehow?

[1] https://openlibrary.org/search?q=zero+to+one&mode=everything

deaddabe··on What Every C Programmer Should Know About Undefined Behavior
This would make sense, since this type is almost always used for iterations and sizes. Anyways I have played with Compiler Explorer and could not spot the "overflow checks" inside some dumb code: https://godbolt.org/z/4znWG8GoP

Maybe this is because x86_64 instruction set is already wrapping up unsigned integers, and maybe the majority of instruction sets are also.

deaddabe··on What Every C Programmer Should Know About Undefined Behavior
Interesting, so that would mean that `int` would be faster than `unsigned int` in tight loops because the compiler would not have to check for overflow and do the wrapping (if the upper bound is unknown so that it cannot be optimized out).

I think that in Rust the unsigned types do not wrap by default, so that the compiler does not have to introduce these checks at runtime. If one wants wrapping, they have to directly use the wrap types instead which would be more instruction-heavy.

I wonder if there is a way in C to reproduce this mechanism in order to not generate any check instructions as well for unsigned types.

← PreviousPage 2 of 3Next →