4 ms·
Several issues with this post: > It's time to be using all of those high-level languages that are so fun and expressive But then soon says: > Something is wr
by Alupis 12y ago
Several issues with this post:
> It's time to be using all of those high-level languages that are so fun and expressive
But then soon says:
> Something is wrong if most programs don't run instantaneously
Well, most higher level languages are getting interpreted, which require some cpu time to startup. Even with something not-so-high-level-but-sorta-high-level like Java or C#, you still have an abstraction level (JVM/CLR) that must first boot, then interpret, then execute.
> Highly optimizing compilers aren't worth the risk
Today's optimizing compilers are truly works of genius, and can perform optimizations on code un-thinkable by most programers. Even if they were thinkable, the source code required to produce the same machine code without compile-time optimizations would be hairy to say the least, and mostly unmaintainable (unrolling loops, bit-shifts instead of multiplication, etc). Not to mention 2-4x performance improvements is nothing to shake a stick at.
> Design applications as small executables that communicate
I don't have any particular qualms with this statement in principle, however with some enterprise apps this simply isn't feasible. Sure I may use a great many separate apps, all working together in orchestration (my database, authentication server, some 3rd party libs, etc), however for some apps, a great deal of the codebase will end up being a monolithic piece, and that is just fine so long as it's maintainable and extensible.
> Don't write temporary files to disk, ever
This depends on what the temporary file is (and how "temporary", temporary really means in context). If I'm writing a program that will generate some XML document then ultimately send that off to some remote server, I might want a local copy kept in the working directory so that in the event something goes wrong, I can look at the file and see what the last produced content was (or wasn't).
> Everything is so complex that you need to isolate yourself from as many libraries and APIs as possible
This seems to be in the context of writing system-level code. Even in that context, if a library has done something already that will be useful to you, use it. Taken to the extreme, this could imply one should re-write portions of libc into their app to avoid any external API calls in a vein attempt to guard against external dependencies and a potentially changing API surface. In my projects, I typically have a loose rule that if something is relatively maintained and recent, and it helps me get my job done quicker, I'll use it. That is a very loose definition, but typically prevents me from including some lib that hasn't been updated since 2002 just to parse some XML document.
> C still doesn't have a module system
Any why should it? It's a low-level language usually (but not always) reserved for low-level (ie. system) programming. This is not the typical language of choice to write your pluggable enterprise app in.
- derefr 12y ago> Even with something not-so-high-level-but-sorta-high-level like Java or C#, you still have an abstraction level (JVM/CLR) that must first boot, then interpret, then execute. There's no reason those shouldn't be resident daemons. Heck, if they were, why should the OS be anything other than a hypervisor for managing those, plus some abstractions like a "container" interface that each runtime execution driver implements? We could have had something like Microsoft Research's SingularityOS a decade ago if we had approached the problem from the other direction—pushing the runtime lower in the stack, instead of trying to write a kernel that does everything. Imagine your laptop booting into Xen, and then loading a Smalltalk image that contains the desktop, while in parallel booting up some background daemons into virtually-isolated Erlang nodes. > Sure I may use a great many separate apps, all working together in orchestration (my database, authentication server, some 3rd party libs, etc), however for some apps, a great deal of the codebase will end up being a monolithic piece, and that is just fine so long as it's maintainable and extensible. The author's complaint was less about factoring of components and more about the way we (still) do IPC. As in, why are we directly-and-unsafely sharing allocated memory handles between families of processes (i.e. using threads) instead of just having processes push information to one-another's inboxes over sockets? Anything that's currently threaded could be done with message-passing instead. And like the article said, it'd be only a 2-4x difference in overhead, minuscule compared to the speedups over the past decades.
- Alupis 12y ago> There's no reason those shouldn't be resident daemons Well, you can blame OS vendors for that. But would it be practical even if implemented? For a system that will never execute Java code, why would a JVM daemon be running in the background? Even if it were a daemon, it would still require spool-up time to interpret the first byte-code down to machine code before the built-in jvm optimizing compiler could kick in and compile down to native machine code. > hypervisor for managing those We do have similar things now-days, but it's worth considering that your OS does a lot more than just simply execute other code. But again, there's a practicality issue trade-off. Containers aren't exactly easy, and it's unlikely that even today's implementations will be the last attempts that get it 100% right. (BTW, Xen requires a Kernel, and for the sake of argument, your laptop does not require anything but the kernel to boot (actually less, you can boot raw binary machine instructions), the rest is convenience for the user). > why are we using processes that share mapped memory allocations (i.e. threads) instead of just having processes push information to one-another's inboxes over sockets Sockets still have overhead. IPC can be achieved in a number of ways, some better than others, and some better in certain circumstances. Why bother opening a socket when my program consists of only a small handful of child processes all running on the same host and only require very small amounts of communication (such as a keypoller subprocess)? Message queues are fine for sending basic messages around, but even a message queue is unnecessary if I can pass the info into the child process as I spawn it. Why over-complicate things if not necessary? > a 2-4x difference in overhead, minuscule compared to the speedups over the past decades. That is, of course, relative. I think some large projects would argue a 2-4x improvement in compile-time, for example, is a dramatic time savings. If we snubbed every 2-4x performance improvement, we'd still have performance on the scale of 1984.