3 ms·
There was a recent article about Julia that discussed how a printf in C translate to very few instructions in assembler. Also I would like to point that "trans
by narag 10y ago
There was a recent article about Julia that discussed how a printf in C translate to very few instructions in assembler.
Also I would like to point that "translates" is a little misleading word. There are two ways of implementing an abstraction from a higher level system to a lower level one.
You can generate code or you can write a runtime framework that does the work dynamically. Although from the higher place both may seem the same, there's a huge difference between them that has consequences.
- smitherfield 10y ago>There was a recent article about Julia that discussed how a printf in C translate to very few instructions in assembler. I wouldn't doubt it; compilers have become amazing at optimizing. But printf is hundreds of lines of C, at very least: http://opensource.apple.com//source/Libc/Libc-1082.20.4/stdio/FreeBSD/vfprintf.c http://opensource.apple.com//source/Libc/Libc-1082.20.4/stdi...
- narag 10y agoWell, hundreds is not the same as thousands ;-) And most important, a call is not the same as the implementation of the called function, my point to begin with, please see my comment in the context of yours.
- smitherfield 10y agoPer cloc it's actually 1093 lines of C (plus some more in the printf.c file), and generally speaking hundreds of lines of C is the equivalent of thousands of lines of assembly. In any case, the complexity of the called function is exactly what we're discussing — it's why the author objects to "User.create(params[:user])"
- deleted 10y ago[deleted]
- MegaDeKay 10y agoThe link to that article is below. printf in C tranlates to a few lines of assembly in preparation for a call to sprintf. That in turn will have a lot more instructions in assembler. http://zverovich.net/2016/05/13/giving-up-on-julia.html http://zverovich.net/2016/05/13/giving-up-on-julia.html
- hackerboos 10y agoIndeed and OP is mixing up language implementation and standard libs with a framework.