<infinisil>
Hmm.. does rust not allow abstraction of this stuff through interfaces/traits/whatever?
<jD91mZM2>
I doubt it, sadly. There's no good way to have a function that both can work on mutable and immutable stuff rather than copy-pasting or macros
<jD91mZM2>
and I can't use macros because you can't have repetitions inside nested macros (and I already have a macro)
<gchristensen>
I think there is a way, jD91mZM2, you should ask #rust on irc.mozilla.net
<joepie91>
not sure I understand the usecase; if you have a chunk of code, then it pretty much inherently cannot work on both mutable and immutable things? either the code mutates and it requires mutable things no matter how you define it, or the code does not mutate and you can take an immutable reference
<joepie91>
(and there is no need to support mutable references then)
<jD91mZM2>
joepie91: What about modifying the amount of spaces before a node in the AST?
<gchristensen>
ack
<jD91mZM2>
I can use children() to iterate all metadata
<jD91mZM2>
(and child nodes)
<infinisil>
jD91mZM2: Well, it's kind of weird to see such an ugly sed command be used to work around something with Rust, which everybody usually praises for its abstractions and stuff :P
<joepie91>
jD91mZM2: still not quite seeing how that conflicts with what I said?
<joepie91>
infinisil: Rust has zero-cost abstractions; but it is certainly not the most abstraction-permitting language in existence :)
<jD91mZM2>
joepie91: Well I need mutability. But it's also incredibly nice to be able to have it work on immutable stuff, especially since I cannot have a proper iterator with mutability because lifetimes :(
<jD91mZM2>
infinisil: Ah yes. Your "anything with interfaces/traits/whatever" did get me to think though...
<jD91mZM2>
What if I don't macro the function itself but rather helper functions
<infinisil>
joepie91: Yeah, Haskell would be more up there, and then there's Idris even higher up
<joepie91>
infinisil: JS does quite well on this as well :P
<infinisil>
Ack!
<joepie91>
jD91mZM2: what is 'immutable stuff' here?
<jD91mZM2>
joepie91: The reference to the node itself
<gchristensen>
jD91mZM2: why do these functions need to take mutable references?
<jD91mZM2>
gchristensen: Well, if you want them to return mutable data
<jD91mZM2>
Which I do, so I can modify metadata for formatting
<infinisil>
joepie91: (well js can probably do lots of stuff, but only at runtime, no compile-time guarantees, similar to Nix)
<joepie91>
infinisil: yes
<infinisil>
The "dependent types" in Nix lol
<sphalerite>
ugh gitlab doesn't include the file's source on the blob page? >_>
<jD91mZM2>
Idea is this: The user may or may not have a mutable reference of the thing
<sphalerite>
how am I meant to view the file without javascript :(
<jD91mZM2>
If it does have a mutable reference, I want to allow mutating the inner children easily using that function
<joepie91>
jD91mZM2: isn't that just a matter of a shared trait for mutable and immutable children, with mutable children having extra functions?
<joepie91>
or so
<jD91mZM2>
Not really, a trait needs to have the same function signature
<sphalerite>
jD91mZM2: I do have a browser with javascript on my big laptop, it was more of a general complaint about gitlab
<joepie91>
jD91mZM2: I don't see how this violates that
<jD91mZM2>
joepie91: Well I need to take &self for immutable and &mut self for mutable
<joepie91>
jD91mZM2: so use &self for shared functions (since those can work with both mutable and immutable things), and &mut self for mutable-thing-specific functions?
Drakonis has joined #nixos-chat
<jD91mZM2>
joepie91: I am really unsure what you want me to do
<joepie91>
jD91mZM2: I'm unsure where you're seeing a problem :P
<joepie91>
like, to be clear, I'm far from a Rust expert, but from what you've described so far this sounds like a fairly standard usage of traits?
<joepie91>
and I'm not quite seeing where the mismatch is between what you want to do, and what is supported
<jD91mZM2>
joepie91: I want to have both child() and child_mut() functions. I can do this by copy pasting or having a macro generate both problems.
<jD91mZM2>
s/problems/functions
<jD91mZM2>
child_mut() so my formatter can modify the metadata and amount of space
<jD91mZM2>
child() so it'll still work on immutable references, AND we get a real nice children() iterator
<joepie91>
jD91mZM2: I have some thoughts on this that I can't quite formulate right now :P it's getting hotter here and it's affecting my thought processes...
<jD91mZM2>
Even the standard library is having this issue, somewhat
<jD91mZM2>
Iter, IterMut, IntoIter
<jD91mZM2>
Copies for each type of reference, or owned
<jD91mZM2>
nix-lsp just got basic auto-indention formatting
<jD91mZM2>
Very basic
<jD91mZM2>
If anybody wants to take over development of nix-lsp to actually make stuff not "very basic", I'd be glad to give it over. I don't really find it too fun to implement stuff
* LnL
prepares to put the the next step of his secret plans into motion
<gchristensen>
uh oh
<LnL>
some people at work are starting to write nix expressions now
<gchristensen>
muahahaha!
<gchristensen>
can I send you (and them) stickers? :)
<LnL>
exactly :D
<LnL>
oh, sure if you want
<LnL>
I should also get a bunch of nix-darwin stickers before nixcon
<joepie91>
perfected my almost-oil-less pancake baking process
<joepie91>
few drops of oil at the start of the batch, zero oil after that
<joepie91>
\o/
<gchristensen>
no butter?
<joepie91>
nope
<gchristensen>
but why /o\
<joepie91>
because easier and tastier :P
<gchristensen>
not-sure-if
<joepie91>
I do add a little more egg to keep them from becoming dry
<joepie91>
also, Dutch pancakes, so thin ones
<joepie91>
I suspect this wouldn't work with eg. american pancakes
<gchristensen>
but to make that you need a lot of butter
<LnL>
kind of looks like my first failed attempt at cheesecake
<gchristensen>
oh by the way, what were you cooking the other day?
<LnL>
one of the things was my second attempt at cheesecake, which was a success :D
<gchristensen>
yay!
<LnL>
and sushi
<gchristensen>
you made sushi?
<jD91mZM2>
Unrelated, but I am fairly certain I am getting ZFS or BrFS or something like that next weekend! My root is filling up so fast I can't delay it much longer (:
<jD91mZM2>
s/BrFS/BtrFS/
<gchristensen>
will zfs / btrfs save you space somehow?
<gchristensen>
I guess I'm asking why does your root filling up add pressure to your timeline :)
<gchristensen>
LnL: those are beautiful! I've never had the guts to do it.
<joepie91>
though mine are colored very differently due to my process
<gchristensen>
oh nice
<samueldr>
here we call those crêpes
<joepie91>
flat brown-ish on one side, mostly yellow with brown 'veins' on the other side
<joepie91>
samueldr: these are a little thicker than a crepe would typically be
<samueldr>
oh
<samueldr>
(harder to gauge on a picture I guess)
<LnL>
gchristensen: not actually that hard, the rice is basically the only difficult part
<joepie91>
samueldr: especially because they taper off a bit
<joepie91>
so the edges look thinner than the rest of the pancake is
<joepie91>
crepes are just thin everywhere
<joepie91>
though it'll probably depend on who you ask :P
<jD91mZM2>
Welp, I might not even be able to nixos-rebuild switch --upgrade... It's really full
<infinisil>
jD91mZM2: Yeah, compression is very nice, makes my /nix/store over 2 times smaller]
<jD91mZM2>
gchristensen: But yeah I could also just go with either resizing my partitions once more, or even LVM. But for LVM I still need to wipe my disk, so might as well take ZFS
<jD91mZM2>
infinisil: Oh yeah, ZFS had 2x something compression
__Sander__ has quit [Quit: Konversation terminated!]
<infinisil>
It depends on the dataset
<jD91mZM2>
Of course
<gchristensen>
gotcha
<infinisil>
Overall I only have a 1.07 compressratio
<jD91mZM2>
Oh
<infinisil>
Because most of my pool is movies and series :)
<infinisil>
(which can't really be compressed any further)
<gchristensen>
infinisil: you might consider making a new pool with compression disabled and move your movies and series to it.
<jD91mZM2>
I heard Google is working on some really cool compression for ChromeOS
<jD91mZM2>
Basically it can take almost anything to 0GB
<infinisil>
gchristensen: Or just a different dataset
<jD91mZM2>
It does this by putting all your data on their servers
<infinisil>
jD91mZM2: Lol
<gchristensen>
oh sure
<jD91mZM2>
WELL, root is now 0b availabl
<infinisil>
I don't like the idea of (a) google having all my data (b) not being able to access all my data without internet
<jD91mZM2>
I think I can give up on doing a system upgrade
<gchristensen>
joepie91: btw I bought a 15-drive chassis and 2x LSI raid controllers which can be reflashed to just be sata expanders :|
<joepie91>
gchristensen: one of us, one of us, one of us...
<joepie91>
:P
<gchristensen>
I idled in your channel for a half day, it was too much
<joepie91>
heh, keep in mind that #datahoarder is heavily off-topic
<infinisil>
Ohh I should join that, I want to build a small storage array soon (tm)
<gchristensen>
joepie91: I got a single 6TB drive for it, so I don't think I'm "one of you" yet
mmercier has quit [Ping timeout: 265 seconds]
<joepie91>
gchristensen: ... yet
<joepie91>
:D
<samueldr>
I know I'm not a data-hoarder since I bought my first TB-scale drive this year... and it's sitting nearly empty
<joepie91>
I... may have a combined 13TB of storage...
<gchristensen>
_my_ amount of data is very small. _my_ amount of data fits in less than 500G. My brother, though, has a real appetite.
Drakonis has quit [Remote host closed the connection]
<maurer>
raid mirror is equivalent to raid1
<jD91mZM2>
which is?
<maurer>
basically, it'll keep a copy of every block on both disks
<maurer>
tl;dr
<maurer>
If you have two drives and want to go fast, do striping
<jD91mZM2>
Oh, so I have no reason to have that? The NixOS example does it for /boot for some reason
<maurer>
If you have two drives and want to keep your data, use mirror
<maurer>
the nixos example does it for boot because there are no other raid modes that would be compatible with boot
<jD91mZM2>
But why RAID at all?
<maurer>
So you don't lose your data mostly?
<jD91mZM2>
Can I keep boot as a normal partition?
<maurer>
Yes, you can
<jD91mZM2>
And basically have EFI partition + ZFS
<maurer>
Yes, that works fine
<maurer>
What they are doing there is saying "We have 4 devices anyways, and boot isn't big, might as well keep backup copies of boot on every drive in case of failure"
<jD91mZM2>
Are zfs commands available from the installation CD? If I want to reinstall with ZFS, do I boot into there, format and nixos-install?
<maurer>
I believe they were there last time I tried
<jD91mZM2>
maurer: Ah, right. I just have 1 device I believe
<maurer>
Note - what they are doing to boot there is _unrelated_ to zfs
<maurer>
They are setting up a traditional linux md-raid
<jD91mZM2>
Oh ok
<jD91mZM2>
Which brings me to what I started the conversation with: Are there any good tutorials anywhere?
<jD91mZM2>
That for example don't do RAID stuff
<jD91mZM2>
BTW apparently nix-store --optimise REALLY helps with my disk usage
<jD91mZM2>
(Honestly, I kinda like that. Then I can leave that up to LVM, a separate tool)
<gchristensen>
hrm
<gchristensen>
"2018-08-20 15:50:06 jD91mZM2 gchristensen: But yeah I could also just go with either resizing my partitions once more, or even LVM. But for LVM I still need to wipe my disk, so might as well take ZFS"
<jD91mZM2>
gchristensen: When I said that I was thinking of LVM+ext4
<jD91mZM2>
which of course brings me no checksums and cool stuff
<gchristensen>
ah
<jD91mZM2>
Now I'm just thinking about whether to use BtrFS or ZFS
<LnL>
I can't judge because I've not used both, but I still hear about weird BtrFS issues from time to time
<jD91mZM2>
oof
<gchristensen>
my experience with btrfs was several years ago, so I'll not say anything
<jD91mZM2>
That settles it, I'd say. Just wish ZFS wasn't so difficult to understand
<jD91mZM2>
gchristensen: Outdated knowledge > no knowledge
<gchristensen>
it isn't so difficult, spend an hour reading those blog posts linked from that page I sent you and you'll have a good working knowledge
<jD91mZM2>
It's hard not to get distracted :^)
<jD91mZM2>
Just double checking: `zpool create tank sde` is the same as `zpool create tank /dev/sde`, right?
<joepie91>
for those interested in visual/flow programming: https://xod.io/
<joepie91>
this is extremely close to what I was working on in this area
<makefu>
joepie91: this looks remarkably similar to nodeRED, no?
<joepie91>
makefu: the major difference is that unlike nodered, which is a) horribly buggy and b) very basic, xod is extremely well-thought-out and works well
<makefu>
well, that is actually an advantage
<makefu>
and it seems to run directly on the uC
<joepie91>
makefu: like, there's a bunch of visual programming things, but they all fail on the point of being 'toys'; they try to do programming 'without needing to learn programming'
<joepie91>
this makes them unsuitable as a 'real' replacement for text-based languages
<joepie91>
there's actual language design going on here
* joepie91
is very excited
<joepie91>
as far as I can tell, this project is on the exact same path that I was traveling wrt visual programming design, except they're further ahead
<simpson>
"You’re protected against creating programs that don’t compile. If it links, it’s likely going to work." I've heard this before~
<makefu>
every c program ever
<joepie91>
going to give xod a spin at the local hackerspace tomorrow
<makefu>
great, i will also check it out
<joepie91>
and from what it looks like now, I'll probably end up contributing lol
<makefu>
esp8266 support would be nice out of the box. these small boards are the future of entry-level iot