Ask HN: This is my first open-source project. Feedback?
github.com
github.com
It's also relevant to look at this:
http://hackage.haskell.org/packages/archive/astar/0.2.1/doc/...
Notice how A* is implemented without any explicit graph object: everything is functions.
This is a model worth thinking about. There are an infinite number of graph libraries for Java. If your value-add is a query language on top of graphs, why not skip the graph representation and let someone else maintain that so you can focus on the query language?
I think I'm not alone in learning to use new languages and libraries primarily by inhaling example code. Why not provide a couple relatively trivial programs, and then a couple non-trivial ones to demonstrate some particularly powerful / elegant aspect of your approach? It's good advertising too.
Also, github lets you use README.md with markdown formatting, to make the readme more legible / fancy.
I wrote a card game (Ambition) back in 2003 and I'm considering OSing the rules to that, in Scala. That might be a better read for intro Scala because the space (in a card game) is more closed. This is more abstract, with the NodeT's and EdgeT's.
Odersky's Scala book, by the way, is really good.
http://www.artima.com/pins1ed/
The 2nd edition is an excellent learning and language survey resource. Also, the books' index is superb.
Visually, having a decent README sets the project apart, and makes it look more "put together." Anecdotally, I can say that when I'm looking for a library to solve a particular problem, I'm probably going to stick around and read more about the repo that has beautiful markdown documentation, all else being equal. Maybe I'm just vain, though... :)
Otherwise, cool project. I too am also interested in graphs and Scala, so I'll be watching your project. Have you looked at flockDB from Twitter?
I generally split files around 500 lines, but for FP languages that may be a bit big.
Haven't looked at FlockDB. Twitter does a lot of cool stuff-- and they use Scala. I may consider applying if I decide to move out to CA.
Make a screenshots/ folder and link to them from your README.
Mostly, I want to see if static typing is right, architecturally, for a general-purpose graph library. Is writing [NodeT, EdgeT] on each graph type going to drive me insane?
I also decided that after 5 years being a "company man" and putting 60 hours per week into corporations that not exist one day, that I should get over my FOE (fear of embarrassment) and contribute to open-source.
I tend to prefer explicit type annotations and unit tests (later) over comments except when I feel like there's something non-intuitive that's not at all obvious from the code. Comments are also critical for future-safety against "fixes" that "look right" but will actually break the code.
I tend to have a "60-second rule". If it took 60 seconds for me to figure this out, then I should comment. For example, I commented the need for a curried function signature in Utils.mergeMaps because it wasn't at all obvious, and I kept getting type errors till I got it right.
Personally, I think the worst thing about what I have right now is that it really deserves to be split into more than one file, but I'm delaying the build system question (I dislike Maven, SBT seems neat has a bad reputation) for a little white.
Tests are a great way to show what your library can do. I recommend adding those before you worry about documentation. (How do you know your code, as posted, works?)
One thing I have to decide on this project is whether I'm going to follow the convention (which I don't like) of putting "test/" in a separate directory from "main/". I dislike it because I think unit tests should be included inline if short and relevant to the purpose of the function.
Generally, my testing practice is to REPL-test and then include the tests in code for posterity. It makes the testing process more playful to start in REPL testing. I know it's the opposite of TDD but it works for me.
And since you're writing a graph library, there definitely should be a detailed commentary on the implementation of the graph (e.g. representation of the graph structure, memory complexity of the representation, and time complexity of common operations). Once you start working with larger graphs, using the correct representation and algorithms for your task makes a huge difference and it is something that must not be hidden from the users.