11 ms·
New implementation of Git in OCaml
- avar 9y agoThis implementation is freely licenced enough that the BSDs and others that don't use Git for license reasons could use it. It would be interesting to see an alternative implementation like this get enough feature parity that projects like the BSDs could migrate and still be protocol and worktree compatible so most users could continue using the GPL2 implementation. Edit: Seems people here are unaware that the BSDs treat GPL software like cooties, see e.g. [1]. They wouldn't start using source control that gave them less freedom than SVN, an with CVS there's the expectation that OpenCVS might get finished. 1. https://wiki.freebsd.org/GPLinBase https://wiki.freebsd.org/GPLinBase
- k__ 9y agoWhat's the problem with using GPL software if you don't want to change it?
- yorwba 9y agoAFAIK, software for the BSDs is usually maintained in-tree, and patched to integrate with the rest of the distribution. I don't think including GPL-licensed software would be compatible with the BSD license of the overall project. That doesn't mean you can't use anything GPL, just that it can't become part of the system.
- _delirium 9y agoAll the BSDs have traditionally included GPL'd software in the base system, so I don't think many people share this view (it's a possible interpretation of the GPL, but not a common one). As one major example: every BSD until recently included gcc in-tree, and OpenBSD and NetBSD still do.
- loeg 9y agoFreeBSD sees this as a necessary evil and aims to move to zero GPL code in base, eventually (when ports GCC works well enough for 2nd tier architectures and Clang/ias / elftoolchain works well enough for 1st tier architectures).
- user5994461 9y agoYou can't use GPL code in non GPL software.
- perlgeek 9y agoI thought you can't link to GPL Software in non-GPL software? Shipping an unmodified copy of git and calling it should be fine even in proprietary code, no?
- marcoperaza 9y agoThis is an open question. The GPL itself does not define what constitutes a derivative work. The FSF does, however, promote the view that linking does create a derivative work, while simply calling an external binary in usual cases does not. But that can't function as a hard rule. Because I could just make a wrapper binary that handles all of the scenarios I need a GPL'd library for, and then call my wrapper executable from my proprietary code.
- jahewson 9y ago> Because I could just make a wrapper binary that handles all of the scenarios I need a GPL'd library for, and then call my wrapper executable from my proprietary code. Yes, you can literally do this. It's not a derived work because your code is entirely independent of the GPL'd code and the GPL can't possibly cover code that you wrote independently. Simply interacting with some external GPL'd program does not expose your code to any GPL requirements.
- marcoperaza 9y agoYou can't just work around the GPL by placing a command-line interface as a shim between your code and the function call interface of the GPL'd library. I'm talking about a contrived binary that just calls library functions, forwarding command line parameters to the arguments of that function as necessary.
- toast0 9y agoWho says they don't want to change it? Integration with OpenBSD pledge or FreeBSD capsicum could be useful.
- gribbly 9y agoHmmm... in what way does Git being GPL/LGPL cause licence problems for the BSDs ?
- teamhappy 9y agoI guess you'd want to be able to include it in your distribution. FreeBSD for example includes svn (or svnlite or whatever) so you can fetch/update the source and do a buildkernel or buildworld without having to install any ports.
- gribbly 9y agoBut you can include Git in the distribution, it's a self-contained program, it's license won't affect anything else it ships alongside with.
- teamhappy 9y ago> The FreeBSD Project aims to produce a complete, > BSD-licensed operating system allowing consumers of the > system to produce derivative products without constraint > or further license obligations. https://www.freebsd.org/internal/software-license.html https://www.freebsd.org/internal/software-license.html Also https://www.openbsd.org/goals.html https://www.openbsd.org/goals.html and https://www.netbsd.org/about/redistribution.html#why-berkeley https://www.netbsd.org/about/redistribution.html#why-berkele...
- gribbly 9y agoOk, so it's license philosophy rather than any actual license legality problematics, I can understand that.
- michaelmrose 9y agoIf someone wanted to produce a FreeBSD derivative would they really need to be able to ship a modified version of git?
- rjsw 9y agoThere isn't one single reason for avoiding use of GPL software that is true for all BSD variants. Requiring OCaml in the base operating system could equally be a reason to avoid this, whatever licence is used.
- throwawayjava 9y ago> Requiring OCaml in the base operating system I'm not sure I understand this concern in the majority use cases. Why would you need an OCaml compiler installed?
- messe 9y agoThe base system is usually capable of compiling itself. If the source for your base system is stored on a remote git repository, and your implementation of git in your base system is written in OCaml, you're going to have to use an OCaml compiler to recompile it.
- int_19h 9y agoBut you don't need source control to compile the base. You only need it to retrieve the base sources - and even then only when you want to get the latest, since the installer comes with a tarball of /usr/src.
- doozy 9y agoUnfortunately OCaml itself has its own weird licensing issues being distributed under a combination of the QPL and GNU licenses. Every few years I take a look at it, notice the license and move on. There's no reason whatsoever for a language not to have an implementation under a permissive license.
- Drup 9y agoThe QPL is not used anymore. The OCaml compiler is GPL, the OCaml standard library is LGPL with the OCaml linking exception and the license of produced binaries is whatever the author wants. If you still have issues with that .. I would really like an explanation.
- xfer 9y agoPeople just want reasons to complain about languages, see also: racket, when they have nothing to complain about they pick the license.
- moron4hire 9y agoNo, there's no reason to avoid the GPL for languages, because you aren't building a derivative work of the language itself, so it's licensing has no bearing on your software.
- steinuil 9y agoThat's not entirely true; GCC (and almost every other GPL-licensed compiler) has a specific exception for its runtime libraries that lets you distribute their compiled version under any license [1]. But for example, Ada Core's GNAT is licensed under GPL but doesn't have that exception, which makes the binaries it outputs be licensed under the GPL as well, to make you buy the Pro version of the compiler. https://www.gnu.org/licenses/gcc-exception-faq.html https://www.gnu.org/licenses/gcc-exception-faq.html
- deleted 9y ago[deleted]
- SwellJoe 9y ago"with CVS there's the expectation that OpenCVS might get finished." Good lord. Surely, no one is working on reimplementing CVS in 2017? The CVS repository (https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/cvs/ https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/cvs/) seems to actually have quite a bit of recent activity, so it seems to be a serious project that someone intends to deploy in the real world. There are a handful of things that the OpenBSD project does that I feel are quixotic (continuing to use CVS for everything, in general, is one of them), but this one takes the cake. CVS was good when compared to what came before (and in some regards even compared to Subversion), but there's no comparison with git (or any of the modern DVCS, really).
- loeg 9y agoIt might be easier to just write a permissively licensed 'gitlite' that can checkout sources (and maybe even update a clean tree). That is the potential solution I've heard discussed in BSD land.
- sandGorgon 9y agoI was in two minds about attending FunctionalConf in Bangalore, India ... but after seeing this PR, I'm there. https://confengine.com/functional-conf-2017/proposal/4052/git-under-the-hood-with-ocaml https://confengine.com/functional-conf-2017/proposal/4052/gi...
- joshmarlow 9y agoIf OP interests you, then this may too: https://pijul.org/ https://pijul.org/ IIRC, when I last looked at this, they were doing dual implementations in OCaml and Scala, but now it looks like it's being done in Rust.
- gragas 9y agoI'm unconvinced. >Means no more downtime, no possibilities of censorship, be it from states or from companies. Wrong. >historically, patch-based systems have been very simple to learn and use, but slow, whereas snapshot-based systems can be extremely fast, but are usually hard to use for more than simple operations. As an example, cherry-picking is not intuitive in git/mercurial How is cherry-picking not intuitive? >Category theory has certainly been an inspiration for Pijul, but categories are neither algorithms nor data structures in themselves. In order to get the semantics we wanted, especially the handling of multiple files, rollbacks and unrecords, designing and implementing new algorithms and data structures was at least as useful as learning theoretical stuff. Yet another thing with relatively little practically use, but hey, it uses category theory! It must be good! Oh look, it's also functional! All of that said, props to Pierre-Étienne for putting in the time and effort to make this. He probably learned a lot.
- yen223 9y agoI've been using OCaml for a couple of side projects, and I have been absolutely blown away by the amount of power this language provides. It strikes a nice balance between high-level expressiveness, while not sacrificing on performance. I feel like OCaml is one of the programming world's best kept secret - if it had better tooling and better marketing, it could have taken over the world. I'm cautiously optimistic about ReasonML for this reason.
- noir_lord 9y agoHave you seen https://github.com/BuckleScript/bucklescript https://github.com/BuckleScript/bucklescript ? It's outputted js is fantastic.
- josteink 9y ago> if it had better tooling and better marketing It would known as F# :)
- thesmallestcat 9y agoVersion incompatibility is a big problem for OCaml. Every time I try to use it seriously, the recommended tools never seem to work together on anything but the latest version. It's like Rust, but without the "young language" excuse. My impression is that INRIA is too eager to add features and tweak the language. Next, everything builds so slowly, and just trying to set up Core, utop, and ocp_indent is a trial in patience, watching the same dep build again and again, confusion about OPAM switches.... nope nope. OCaml/OPAMs's got a distribution problem. They've pushed the complexity off to the end user and the experience is terrible. Jane Street planting their flag on the language and encouraging massive dependencies like Core, or shit like "corebuild" is even worse. I would never depend on anything OCaml-based on it unless it could be installed by my OS' package manager (Arch/AUR doesn't count, because it builds). That rules out most popular OCaml tooling, and ruins the development experience. I'd prefer OCaml to Haskell, I find it more practical, but I feel much better depending on Haskell-based software, which generally "just works." As much as they're a wart, Haskell syntax extensions are a real benefit. You can build new fancy Haskell software with older GHC versions.
- altotrees 9y agoThis is fantastic. I have played around with Clojure and Haskell a bit, but really want to get into functional programming more. Not to hijack the thread, but I guess I am having trouble getting started. Any good resources for novices out there? Edit: for the record I have Googled the topic and am overwhelmed by how much is out there. Looking for personal recommendations.
- yen223 9y agoI highly recommend https://fsharpforfunandprofit.com/ https://fsharpforfunandprofit.com/. F# is spiritually similar to OCaml, so there's a lot of crossover there. This is geared towards "enterprise" developers, and so tends to be more pragmatic than most other resources. For what it's worth, I got a surprising amount of mileage from learning Idris[0], of all things. Even if you ignore the dependent type system, it is still essentially Haskell but with a lot of the warts removed, making it much simpler to grok. Beyond that, the usual recommendations apply: Learn You a Haskell[1], and Real World OCaml[2] were what got me started. [0] http://docs.idris-lang.org/en/latest/ http://docs.idris-lang.org/en/latest/ [1] http://learnyouahaskell.com/chapters http://learnyouahaskell.com/chapters [2] http://dev.realworldocaml.org/ http://dev.realworldocaml.org/
- gilmi 9y agoIf you want to learn Haskell the most recommended book nowdays is Haskell Programming From First Principles[0]. [0]: http://haskellbook.com http://haskellbook.com
- nuclx 9y agoReal World Haskell[0] is the best freely available resource imho. If some concepts remain unclear, Learn You a Haskell[1] is a good complement, though it doesn't go as deep as Real World Haskell. For example there is no coverage of monad transformers, which is a pity. Typeclassopedia[2] is a great overview of common category-theoretic abstractions used in Haskell programs. [0] http://book.realworldhaskell.org/read/ http://book.realworldhaskell.org/read/ [1] http://learnyouahaskell.com/chapters http://learnyouahaskell.com/chapters [2] https://wiki.haskell.org/Typeclassopedia https://wiki.haskell.org/Typeclassopedia
- logingone 9y agoI thought there might be some comments on darcs in here. I've only just started learning OCaml so haven't yet used darcs, but am looking forward to trying it out.
- sddfd 9y agoWhat is the benefit of having an OCaml implementation of git, besides that it's written in OCaml? Edit: I get it now: it's an OCaml library that allows you to interact with git repositories and provides many (most?) operations.
- gragas 9y agoThis is a +19k -8k line pull request. That is dumbest thing I have ever seen. For having written something that interfaces with git, this person obviously doesn't know how to use it effectively.
- dr_win 9y agoThe pull request currently contains 81 commits. It is NOT a single monolithic commit.
- gragas 9y agoI'm probably too harsh, but I can't think of a single developer who would welcome such a large PR with open arms.
- Dinoosaure 9y agoOP of this PR here. When Thomas Gazagnaire started ocaml-git, it's like a PoC for Irmin and a MirageOS system. He did not think about the memory consumption of an implementation of any Git operation for example. In this case, he saw a limitation about the Garbage Collector of git (which can use a lot of your memory) and the push command. It's like just: "I want to understand what is Git (in the specification) and I will do". So, the big goal of my work (payed by the MirageOS team) was to switch to a non-blocking (memory predicted) implementation of Git. I did not have any criticism about this approach. Sometimes you just want a project to work and ocaml-git was developed in this mind. However, ocaml-git is used now by some big companies (like Docker, Tezos, etc.) and need a strong prediction about the memory consumption first. Then, the push command is a big lack of the last implementation. And, finally, the GC and encoding of the PACK file is the key to solve all of these problems. As I said in this PR, I worked with Thomas Gazagnaire and some others peoples of the MirageOS eco-system to improve ocaml-git, implemented the Git GC, Git push and tried to avoid any problem about the memory consumption in a server context in the low-level API. So, yeah, it's a +19k -8k PR, of course. But it's not like a OCaml's noob and tries to restart the world like: yeah, I recoded Git in OCaml in my only opinion and don't care about what was it happens in the OCaml world, Haskell world and industrial world, like just for fun. In this PR, I explained IRL and in comments what happens. Why I did this choice compared to something else. The point of Thomas Gazagnaire (who reviewed my PR) and my point. What the MirageOS team expect and what I did. So, clearly, yeah you did not read my comments and just see a big PR like a noob to try to strike all of this project but this is not what happened unfortunately for you. It's a result of a big discussion between Thomas Gazagnaire (specifically), others peoples and me to find the best for all (in the implementation and in the API). Now, I can say this PR will be merge. I need to polish some details, improve the API and test it. So, yeah this big PR will be merge because it's what expect the creator of ocaml-git, what expect the MirageOS team, what expect my boss and what expect others users of this library if you just interest by the issues.