Hi, I am a Nim lover since the last night. Just fabulous!
As the first exercise, I am thinking of trying to provide fuse (filesystem in userspace) for Nim. There already exists nim-fuse? If not, I will.
I searched github but strangely, not found.
https://github.com/akiradeveloper/nim-fuse
Let me share the beta-version.
I started to develop this library a mouth ago and now it works for several simple tests. With helps of guys in IRC, I decided the design but if you find something that doesn't sound nim-ish please tell me. Any comments are welcome.
I think I first register this library to nimble database after some fixes and hope that this is merged into lib/wrappers eventually as official library.
This is a API that might help you understand the design. https://rawgit.com/akiradeveloper/nim-fuse/master/fuse.html
I was going to look what I can do with nim-fuse but failed!
First off I get an error when I import it (using the latest Nim compiler):
~/.nimble/pkgs/fuse-0.1.0/fuse.nim(78, 6) Hint: 'sz' is declared but not used [XDeclaredButNotUsed]
~/.nimble/pkgs/fuse-0.1.0/fuse.nim(561, 8) Info: instantiation from here
~/.nimble/pkgs/fuse-0.1.0/fuse.nim(486, 8) Info: instantiation from here
~/.nimble/pkgs/fuse-0.1.0/fuse.nim(457, 24) Error: type mismatch: got (sendOk.T)
but expected one of:
fuse.mkBufT(o: mkBufT.T)
Second fear that without an example I may not even be able to start :). I compiled the rust-fuse some time ago and played with the examples there but I think it would be really helpful to have something to start with.
I am also curious if it works at all, me being on OS X.
It doesn't reproduce in my environment. Could you please try again? I worked some changes this morning.
I understand fuse is too complicated and I know it's hard to start it quickly. In my repository, there are null.nim and hello.nim and they are the only samples at the moment. As you see in the Todo, the next sample code should be a filesystem that is directly backed by other filesystem (like linear target in device-mapper). I will manage to make time for this but also hope others contribute for this. For now, I added some comment on each operation that might help you.
I consider supporting OS X and that's a reason nim-fuse's design is based on rust-fuse. rust-fuse support OS X. So, it's only the matter of time to catch up.
I am using 0.10.2 and if OderWat is using develop, that sounds likely so.
nim-fuse exploits the capability of template to make it DRY. I guess some part of them is trapped by the issue in question.
I just hope that Araq will fix this and that before that users don't try this with compiler in develop.
Btw, with some fixes the hello.nim (so-called hellofs) is working.
# cd mnt # ls -a . .. hello.txt # cat hello.txt Hello World
I updated to the newest 0.10.3 and pulled the newest nim-fuse. I now get this error:
fuse.nim(583, 8) Info: instantiation from here
fuse.nim(511, 8) Info: instantiation from here
fuse.nim(481, 8) Error: invalid type: 'T'
Compiling with 0.10.2 I get a multiple warnings and an error because of OS X. I put that into an issue onto GitHub cause I think this Forum may not be the right place to continue that talk :)
It would be helpful if you add git's hash value to identify the source code to discuss.
But, I think that's commit 406c08010e189ffff7473fa9c5feddf9632d7051
This kind of conversion to variable is often seen in my source code. This is a workaround that is needed to get addr() of the value. Maybe a ugly hack, so better solution is hoped for.
I am not sure what is happening here but seems to be relevant to template and type inference that Araq is working.
I've got a issue to Github and thanks for reporting. That's fuse-only problem and not to be discussed here I agree.
// line 481
proc sendOk[T](self: `typ`, a: T) = var aa = a # <- line 481 self.raw.ok(@[mkTIOVecT(aa)])
// line 511
template defEntry(typ: typedesc) = proc entry(self: `typ`, hd: fuse_entry_out) = self.sendOk(hd) # line 511