Lurker News

Comments (86) 18 threads

lunixbochs3 replies#
Note: this was implemented without referencing any ZFS source code and should not be subject to the CDDL.
josteink2 replies#
So we port this python to something not slow, and all the kernel-people can shut up about ZFS being terrible ;)
j88439h846 replies#
Dont forget, pypy is fast.
spullara16 replies#
Faster that CPython doesn't mean it is fast.

Continue this thread — 16 replies

cure12 replies#
PyPy is faster than Python, yes. But Go, C and many other (compiled) languages are way faster than PyPy. Plus, if you use a language like Go or Rust then you avoid Python's GIL and you'll have much more reasonable memory usage. Best of all, deploying is a matter of copying a binary, rather than having to deal with the absolute disaster that is Python packaging.

Continue this thread — 12 replies

tanilama#
Only when comparing to CPython
fragmede4 replies#
pypy is fast, but even were this written in C, there's still the kernel-userland boundary to contend with.

Continue this thread — 4 replies

GuB-42#
Maybe plenty fast for most applications but a filesystem is not one of these IMHO, especially for something as naturally resource hungry as ZFS.

A good filesystem implementation requires tight memory management and good control of what happens at the OS level. I am not saying it can't be be done in python, but it clearly isn't the right tool for the job.
I meant that for a production implementation. Python is perfectly fine for a proof of concept, in fact, it may be better than jumping straight down to C. But keeping it for production is foolish IMHO.

mehrdadn1 reply#
I routinely fail to get speedup on PyPy. In fact I frequently get slowdowns. I imagine it's only fast if your code is slower than it needs to be to begin with.

Continue this thread — 1 reply

aidenn0#
I can Port from Python -> Common Lisp at a rate of ~100 LoC per hour, and that's a pretty friendly port (the yield expression is the only thing that can't be just done line-by-line; truthyness is the only real "gotcha" as there are a lot of "false" values in Python, but only 1.5 in Lisp[1]).

1: I say 1.5 because there is only one false value, but it has 2 idiomatic meanings: nil (equivalent to python's None) and the empty list.

newnewpdro2 replies#
Would the CDDL matter for a python implementation that will never become part of the kernel?
dr0verride1 reply#
It's clear to me that the solution is to integrate python into the kernel.
yjftsjthsd-h1 reply#
I assume you mean this as a joke, but I would point out that at least one of the BSD family has gone and baked lua into their kernel. Granted, lua is rather meant for that kind of thing and python isn't, but it is entertaining to point out an interpreted language that has been stuck into a unix kernel:)

Continue this thread — 1 reply

CaliforniaKarl2 replies#
You'd want a reverse-engineering lawyer, so be certain. But my (IANAL) guess is: If this is a proper reverse-engineered implementation, you could then convert _this_ implementation to C, and contribute _that_ into the kernel.

Except, it seems this is BSD-licensed, so I'm not sure how that would work in the kernel (which is GPLv2).

lunixbochs1 reply#
BSD is a subset of GPL's restrictions, so you can include BSD-licensed code in a GPL work.

Continue this thread — 1 reply

loeg#
BSDL code is fine in the GPLv2 kernel. E.g., most of the DRM drivers are dual BSD-GPL licensed.
lelf1 reply#
Bad title. It’s not a ZFS implementation, so hold your horses.
AHTERIX5000#
What do you mean? Can't you mount & read ZFS filesystems with this one?
ivanbakel3 replies#
Pierre Menard, author of The Filesystem.

But I'm surprised this is possible without a specification - how can you test a filesystem through hexdumps? The effects of some operations are going to pretty far-reaching, surely?

randrus#
Might be interesting/useful to aim for zfs send/receive compatibility :)

And thanks for the Borges callout.

aerovistae1 reply#
One of my favorite short stories, and nobody else has ever read it. So glad to see someone else reference it.
hueving1 reply#
Link?
cryptonector#
There are lots of blog posts, lots of docs. There's ZFS code in GRUB that is GPL, etc.
mfsch3 replies#
Does someone know whether it would be legal for someone to go through the ZFS code and write a specification of the features this author hasn’t figured out yet? I.e. could someone write a detailed description of the missing functionality that doesn’t include any details about the implementation so other people can implement it in non-CDDL code?
ummonk#
Edit: yeah that is how you avoid copyright infringement https://en.wikipedia.org/wiki/Clean_room_design

Original comment: I could swear this was actually the standard practice for writing an implementation of an unknown file format or interface without infringing on copyright. But I don't remember the term for it.

atomicwrites1 reply#
That's called a clean room implementation and was the standard way to make x-compatible products (like for example, the bios on an IBM PC clone). Not sure what the current legal standing of that method is.

EDIT: Ninjad because I left the reply in a tab without posting.

zymhan#
Reverse engineering is legal in the US, but you had better have detailed records proving no one who knew the insides of the original product ever influenced the clone. And be prepared to explain that in court.
Someone#
The on-disk format is available (http://www.giis.co.in/Zfs_ondiskformat.pdf)

That PDF says ”Unless otherwise licensed, use of this software is authorized pursuant to the terms of the license found at: http://developers.sun.com/berkeley_license.html”*. That link is broken, but it seems that’s Berkeley license (whatever that means for a specification, and for which variant?)
According to http://open-zfs.org/wiki/Developer_resources, its outdated, but still useful.
I think I would use that, rather than spend months diffing disk images.

AlexanderDhoore4 replies#
What?! How?! Why?!

This is the greatest thing ever. I wish I could just write code for the fun of it. Every time I wonder whether people will use it and give up before I even get started.

mirceal2 replies#
why not? writing code can fall into one of a few bucket. one of them is play.
anon4242#
Exactly! Write code that you find interesting and/or need for something and then share it. If someone uses your stuff, then great, if not, at least you've become a slightly better programmer! It's a win-win!
ehsankia#
Absolutely, some of the most fun I've had coding was reverse engineering/implementing known protocols. Although something this big may be a little overboard :)
max0563#
I had this problem too. I’ve been able to get over it by from coming up with a scenario, even if it’s completely fabricated, where what I am doing can be useful. I also make sure that I incorporate something new that I want to learn in the project. Whether it’s a language, library, whatever. Then I give myself a date I can quit. Normally it’s about two months. This makes me really consider whether I want to take something on because if I do I force myself to dedicate two months of time to it. If I enjoy it still at the end of two months then I continue otherwise I move on to another idea. At least in that time I because a little better at whatever I was trying to do. That’s the real goal anyway.
js2#
I wrote this to scratch my own itch but mostly just for the fun of it and some people ended up using it.

https://github.com/jaysoffian/eap_proxy
This was a really simple project but tickled all my fancies: Python, low-level, networking, reverse engineering, system administration.
Just do it! Who cares if people use it?
Alternatively, contribute something to some open source project you use. I’ve done that too. Just small stuff here and there but that’ll guarantee someone uses your code if that’s what’s important to you. It only takes 39 commits to get on this page:
https://github.com/git/git/graphs/contributors
:-)

craftyguy#
> What?! How?! Why?!

The readme literally answers this..

Load more comments