Skip to content

Instantly share code, notes, and snippets.

@joliss
joliss / dependencies.md
Last active August 29, 2015 14:03
Why flat dependencies are important

Deep dependencies (npm style) are great when (1) you are relatively memory/bandwidth unconstrained, and (2) your programming style is purely functional. (1) is pretty obvious, so I want to elaborate on (2):

With an object-oriented programming style, you are often passing around instances of your class.

var widget = new Widget
widget.groupWith(otherWidget)

You clearly don't want widget to interact with slightly different versions of itself through otherWidget. (Trying to do so would require that we are extremely disciplined with what the Widget::groupWith method calls on otherWidget.) Asking for this to work is, in my opinion, a fundamentally bad idea from an architectural point of view. Ideally, it should not be possible for two versions of the Widget class to exist in the same app. Bundler on Ruby enforces this, and it's awesome.

salmondesign-hush $ gdb --args node `which broccoli` serve
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
$ while sleep 2; do touch app/index.html; done &
$ ember serve
...
...
Build successful - 129ms.
Slowest Trees | Total
var fs = require('fs')
fs.mkdirSync('physical-dir')
fs.symlinkSync('physical-dir', 'symlinked-dir')
process.chdir('symlinked-dir')
console.log(process.cwd())
process.chdir('..')
fs.unlinkSync('symlinked-dir')
fs.rmdirSync('physical-dir')
New python executable in default_env/bin/python
Installing setuptools, pip...done.
Downloading/unpacking git+https://github.com/scipy/scipy
Cloning https://github.com/scipy/scipy to /tmp/pip-ulCB5M-build
Running setup.py (path:/tmp/pip-ulCB5M-build/setup.py) egg_info for package from git+https://github.com/scipy/scipy
Running from numpy source directory.
/tmp/easy_install-5mmVDt/numpy-1.8.1/numpy/distutils/system_info.py:1521: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
version: 0.1.1
Livereload server on port 35729
Serving on http://0.0.0.0:4200
Build successful - 271ms.
Slowest Trees | Total
-------------------------------+----------------
Concat | 70ms
JSHint - App | 36ms
@joliss
joliss / gist:051a5cdcf7b57cf68feb
Last active August 29, 2015 14:13
Why it's hard to map ES6 modules 1:1 into CommonJS or AMD

Why it's hard to map ES6 modules 1:1 into CommonJS or AMD

Originally from an email, gisted here for posterity:

I was able to remember the example where "naive" 1:1 module transpilation fails: