You should rather ask what the difference to almond is (which is also from jburke and useful for bundled loading - I think this is more similiar to define.js).
almond: 275 LOC
As to a reason why someone would write his own AMD loader:
I once wrote one, because I want'ed to be able to pass objects as array elements to the require parameter, to forward them to the callback function. Something similiar to this:
Thus I got something similiar to Function.bind() for free.
Also I could implement a global requirement list. A synchronous script in the head could add entries to this list and thus prevent the execution of any asynchronous script, which was not in the list. Thus those in the list could be loaded asynchronously. After all of them where resolved, all the others could be loaded.
I guess I could open source it, if I feel like it. :D
Edit: Fixed LOC numbers. I also just checked my implementation: Only 168 LOC, while nearly implementing AMD (without relativ paths!), tuned for Closure/uglify.js/etc. and compatible to IE6, but with those 2 features above. I guess that's pretty good too…
define.js: 259 LOC
You should rather ask what the difference to almond is (which is also from jburke and useful for bundled loading - I think this is more similiar to define.js).
almond: 275 LOC
As to a reason why someone would write his own AMD loader: I once wrote one, because I want'ed to be able to pass objects as array elements to the require parameter, to forward them to the callback function. Something similiar to this:
Thus I got something similiar to Function.bind() for free.Also I could implement a global requirement list. A synchronous script in the head could add entries to this list and thus prevent the execution of any asynchronous script, which was not in the list. Thus those in the list could be loaded asynchronously. After all of them where resolved, all the others could be loaded.
For instance this is incredibly useful, if you wan't to load IE shims, for things like this: https://developer.mozilla.org/en-US/docs/Web/API/Element.cla... etc.
I guess I could open source it, if I feel like it. :D
Edit: Fixed LOC numbers. I also just checked my implementation: Only 168 LOC, while nearly implementing AMD (without relativ paths!), tuned for Closure/uglify.js/etc. and compatible to IE6, but with those 2 features above. I guess that's pretty good too…