Readit News logoReadit News
NilsIRL commented on Lego price per part over the years   brickinsights.com/statist... · Posted by u/janandonly
ivanech · 2 years ago
5 years ago I did a similar analysis of price per part because I remember there being a big controversy around the price of the new Star Destroyer set. I analyzed price per piece but also price per gram, estimated in a few different ways. I was surprised to see that price per gram was stable through the 2010s on an inflation-adjusted basis and that it went down fairly significantly over the 1990s.

I did this before I learned how to finish projects, so it's been sitting in a private repo the whole time :)

I just made the repo public. Perhaps the author or someone else can make use of it: https://github.com/iechevarria/lego-price-analysis/

The plots and code are in this file: https://github.com/iechevarria/lego-price-analysis/blob/mast...

NilsIRL · 2 years ago
> I did this before I learned how to finish projects

Very curious about this. As do many people I struggle to finish projects.

How does one learn this skill?

NilsIRL commented on Show HN: dockerc – Docker image to static executable "compiler"   github.com/NilsIrl/docker... · Posted by u/NilsIRL
kunley · 2 years ago
Great! Thank you for dissolving my doubts.

About Zon, I was just curious if you had any issues with it. I also need to finally start using it in my small projects.

Good luck with Zig!

NilsIRL · 2 years ago
I moved zig-clap to zon. Was alright. I appreciate that absence of a package registry.
NilsIRL commented on Show HN: dockerc – Docker image to static executable "compiler"   github.com/NilsIrl/docker... · Posted by u/NilsIRL
luke-stanley · 2 years ago
What about Cosmopolitan and WASM? ;)

Cosmopolitan libc allows compiling of a single binary that runs on multiple OS platforms without modification – maybe Dockerc could use this to create a more universally portable container binary?

WASM binaries could run in the browser, or another WASM VM, including securely sandboxed environments that spin up fast.

I understand that newer Docker builds can use WASM under the hood so WASM in WASM would be funny, it seems if that were the case, maybe extracting the WASM with a more thin wrapper would be better?

NilsIRL · 2 years ago
Unfortunately cosmopolitan wouldn't work for dockerc. Cosmopolitan works as long as you only use it but container runtimes require additional features. Also containers contain arbitrary executables so not sure how that would work either...

As for WASM, this is already possible using container2wasm[0] and wasmer[1]'s ability to generate static binaries.

[0]: https://github.com/ktock/container2wasm

[1]: https://wasmer.io/

NilsIRL commented on Show HN: dockerc – Docker image to static executable "compiler"   github.com/NilsIrl/docker... · Posted by u/NilsIRL
FooBarWidget · 2 years ago
It's interesting. According to the source code, it uses FUSE to mount the container's internal filesystem. This means that the compiled binary will either need root privileges to run, or the user must have configured FUSE to allow non-root mounting. Not ideal, but there's not much of an alternative either.
NilsIRL · 2 years ago
I thought it was an acceptable trade-off given that AppImage has the same limitation.

An alternative is to extract the image to disk but that has quite a bit of overhead.

NilsIRL commented on Show HN: dockerc – Docker image to static executable "compiler"   github.com/NilsIrl/docker... · Posted by u/NilsIRL
tluyben2 · 2 years ago
Can it be done for docker compose (in theory) too?
NilsIRL · 2 years ago
don't give me ideas ;) (yes)
NilsIRL commented on Show HN: dockerc – Docker image to static executable "compiler"   github.com/NilsIrl/docker... · Posted by u/NilsIRL
dale_glass · 2 years ago
Nice, but what's the difference between this and AppImage?
NilsIRL · 2 years ago
They have the same goal but achieve it differently.

dockerc allows you to re-use your existing docker images without having to spend time packaging something up.

The applications running from dockerc-generated executables run inside a container so they are guaranteed to be hermetic.

NilsIRL commented on Show HN: dockerc – Docker image to static executable "compiler"   github.com/NilsIrl/docker... · Posted by u/NilsIRL
kunley · 2 years ago
This can be useful for certain people, but I am surprised the documentation (there is just the Readme) doesn't mention what happens when you already have a docker daemon- esp. what happens to all the networking/firewall tricks docker is using. I see potential for quite a number of operational issues.

Nice to see Zig in action, btw. What about using Zon for deps, instead of a git submodule? Just curious if the author tried it, I honestly didn't have time to use Zon deps yet

NilsIRL · 2 years ago
I don't expect this to interact with the docker daemon in any way. With networking executables generated by dockerc behave in the same way as a native application running outside a container.

> What about using Zon for deps, instead of a git submodule?

I couldn't find documentation quickly enough (dockerc was initially during a hackathon and was my first time using Zig). I plan to fix this eventually.

NilsIRL commented on Show HN: dockerc – Docker image to static executable "compiler"   github.com/NilsIrl/docker... · Posted by u/NilsIRL
nightshift1 · 2 years ago
Can I run this in a container?
NilsIRL · 2 years ago
dockerc can, the produced executables cannot, at least not without some tweaking.

Even if you path through `/dev/fuse` and `/usr/bin/fusermount3` (using -v) it fails the mount the fuse filesystems with the error message "Operation not permitted".

It might be possible to make it work if it falls back to extracting the container when failing the mount the fuse filesystems.

u/NilsIRL

KarmaCake day1004June 30, 2019
About
https://www.nilsand.re

hn@nilsand.re

@NilsIRL everywhere

<script>alert(1);</script>

View Original