-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oml vs Oml-lite split #173
Comments
Not really... she can't do anything about it. Suppose she has a Now suppose a user of This wouldn't happen if you had a properly structured library where
Not necessarily. It is unclear to me what exactly is provided by the third-party libraries so it's diffcult for me to answer the question. |
@rleonid how hard would it be for |
@hammer The way things are currently structured it would be difficult. I am hesitant to say impossible, but I actually don't know how to do it without restructuring the project. The main obstacle being the While I think that @dbuenzli is making a good point about wanting |
I don't see what prevents you from having It seems you are underusing the naming and structuring capabilities of the module system. You would not even need to publish more than one package you can simply use
I wouldn't call that an idealized point, you asked for feedback about the approach, here you have it: what you are doing is simply anti-modular. In a library eco-system like |
@dbuenzli How would you address the Functions module? Writing special mathematical functions is tricky since it requires balancing the trade-offs of convergence, performance and accuracy. Without resorting to rewriting all of them in pure Would you recommend splitting up |
module Oml_lite : sig
module Functions : sig
val softmax : ?temperature:float -> float array -> float array
end
end = struct
module Functions = Oml_lite_functions
end module Oml : sig
module Functions : sig
include module type of Oml_lite.Functions
val gamma : float -> float
...
end
end = struct
module Functions = struct
include Oml_lite_functions
include Oml_functions
end
end |
Right, but |
There's no problem in adapting the thing for more than one level. You don't need to introduce modules for the other levels if they contain only modules. This means that you can simply make the split lite/non-lite at the lowest level. You can then design your names in the namespacing module: module Oml : sig ...
end = struct
module Statistics = struct
module Functions = struct
include Oml_lite_functions
include Oml_functions
end
...
end
end
In general avoid too deeply nested hierarchies, beyond two (not counting the toplevel namespace) things become a bit annoying to read and write and people then tend to |
There will be multi-level split for things such as Classification (which contains Naive_bayes that must be split). Regardless, you're advocating for manual packing the namespace modules. This is the approach that I wanted to avoid from the beginning. My main reservation against it is that it will become much more difficult to maintain as inter-module dependencies will grow, and I think the solution will not be elegant. @dbuenzli How about a deal: if I re-implement |
I'm unconvinced about the maintenance argument. If you are well principled you can keep the mapping between the namespacing module and the implementations obvious. As far as elegance goes, I personally find a language based approach much more elegant than pre-processing ifdefs... it may also make your build system simpler.
Ha ! For once I wanted to be a user... So that I can throw away toy stuff like this. |
Says the guy asking someone else to do the maintenance. 😈
Do we have a deal? I'll let you loosely interpret the terms and what you think is a comparable contribution. |
As someone who publishes a lot of packages I really care about maintenance costs, I'm really telling you what I think is best here and what I'd actually do personally. If you compare this approach to the one with pre-processing you'll get help from the compiler and it ensures that both
I'm afraid I won't have time in the foreseeable future, so I can't promise anything. Do what you think is best for the project... |
Resolved with #174 |
@dbuenzli wrote:
I agree about 1), though I am already living a miserable build life dealing with testing. Currently, the choice of
oml-lite
oroml
is about binding toC
code or not (or as some others have described it, "waiting half an hour for fortran to compile"). I think that it would be very difficult to get around this issue by not addressing the build.I also think that your second point is valid. But it is true of all software. I face similar issues with regard to
core
and lots of other downstream packages. It is ultimately, up to the second-party developer to make smart choices.Do you mean something along the lines of distributing each of the sub-packs separately (ie.
Statistics
,Classification
... etc)? I generally agree (and think this is the long term goal) but at the moment I am hesitant to start separating because there are many inter-dependencies; both in how one thinks about the algorithms (ex.LDA
can be used forClassification
orUnsupervised
learning) and how the code is written. Furthermore, one of the problemsoml
is trying to address directly, is to group lots of separate functionality that may not be thoughtfully integrated. For example, the result of a regression analysis should have hypothesis tests easily associated with it.This issue is certainly not closed. I hope that you can give
oml
(oroml-lite
a try) and we can talk specifics.The text was updated successfully, but these errors were encountered: