Something is deeply broken in OS X memory management - <AUTHOR> http://workstuff.tumblr.com/post/20464780085/something-is-deeply-broken-in-os-x-memory-management <comment><USER2> Not this again, we already went through this a few weeks ago.

Back then, I thought the conclusion was that there is nothing broken about OS X memory management, and that with every 'fix' you come up with, you will just introduce another degenerate corner case. The same holds for any OS, trade- offs are made that may have some negative effect in some cases, to the benefit of the general cases.

I don't recognize any of his symptoms anyway, and my OS X computers get pretty RAM-heavy use, with almost always a linux VM open, XCode, Safari with ~10 tabs, iTunes with a few thousand songs, etc.

Edit: Just to be sure I read through some of the links he provides that are supposed to explain what is going on and why the fix would be of any help, but nowhere do I see any hard facts that demonstrate what is going on. Only that he 'saw in vm_stat that OS X was swapping out used memory for unused memory'. I'd like to see some actual evidence supporting this statement.

<comment><USER3> The thing is, Lion runs like crap without an SSD or insane amounts of RAM for many people. It doesn't help if it works for some, or even the majority. If anything, we need _more_ people digging in OS X internals. I am sorry to use a tired analogy here, but Vista _did_ work great for many too.

I have two Macs, one brand new, one migrated from SL, and 10.7 Safari was almost unusable on both until I installed SSDs. If that isn't a negative effect in _every_ possible use case, then I don't know one. I actually guessed it was just that Lion inofficially dropped support for HDDs (by removing all caches or so).

<comment><USER4> I upgraded to an SSD while on Leopard, and was amazed at the speed. Snow Leopard continued to impress. Lion slowed things down _terribly_ (even with the SSD!), but I have good news: ever since Mountain Lion DP2, it's been fast again.

<comment><USER3> Yes, I am a fan of ML so far too.

Given that Apple has fixed none of my reported bugs in 10.7, but I can't reproduce many of them in 10.8, I wonder if it even makes sense to analyze 10.7 anymore - seems it's a done deal for Apple.

<comment><USER5> This is very good news indeed. I'm okay that they don't backport bugfixes as long as ML comes out in a reasonable timeframe.

<comment><USER6> ML will be a paid upgrade right? So people who paid for Lion are worth nothing?

</comment></comment></comment></comment></comment></comment><comment><USER7> No actual data, barely any technical discussion at all, mention of "the garbage collection algorithm" which most likely isn't even being used by most of the apps running, capped by a total cargo-cult solution... and this is #1 on the front page?

<comment><USER8> The post is (too) light on information, but I don't dismiss it immediately. Perry Metzger was very much involved with NetBSD (maybe he still is) as a developer. He might know a thing or two about memory management ;).

<comment><USER7> Metzger's post is _much_ more subdued and interesting. IMO it would have made a much better submission. Link for the curious (it's linked from this article):

[https://plus.google.com/116685507294337280246/posts/camYp28M...](https://plus.google.com/116685507294337280246/posts/camYp28M9St)

<comment><USER9> I still don't quite grasp it. He is talking about page outs, but how is disabling the dyn-pager helping with that? Shouldn't page outs only happen when RAM is full?

At my machine with 8 GB RAM and uptime of 4 days I have page outs of only 2 _Mega_ byte. And page ins of 2 Gigabyte.

P.S. I subscribe to your blog! * starstruck _

<comment><USER7> RAM serves (at least) two purposes: holding application data, and caching disk data. Sometimes it can be useful to swap application data out to disk to make more room for disk caching. Imagine if you have an app taking up a whole lot of memory that isn't actively using most of it, and another app reading a lot of data from the disk. In this case, you'll perform better if you swap out all that unused data, and use that RAM to cache disk access for the other app.

What he's saying is happening is that the OS is doing this too aggressively, and that it ends up swapping out data that's actually in use in favor of disk data which doesn't really need to be cached, which hurts performance.

By disabling the pager, you make it impossible to move application data to disk at all. This limits the amount of RAM available for disk caching, but if the OS really is caching too aggressively, that will ensure that it can never page out useful application data by mistake.

My experience mirrors yours, in that it really doesn't seem to be a problem on the computers I've used, but that's what he says he's seeing.

Glad you like the blog, but I'm just a regular guy. I put my pants on with a high speed pants installation robot just like everybody else.

</comment></comment></comment></comment></comment><comment><USER10> The core reason that this happens is that OS X uses a memory management mechanism called Unified Buffer Cache (<http://kerneltrap.org/node/315> is the only reference I can find on this).

This seems like a good idea to unify paging and disk cache memory, but it actually isn't. This means, that if you do a lot of I/O, resident pages (i.e. your programs) can actually get pushed _out_ of memory to free up RAM for the disk cache. This degenerates pretty badly in scenarios like using VMs, since you're also using large sections of mmap'd memory.

This doesn't happen on NT or Linux, because disk cache can only be turned _into_ memory (i.e. making disk cache smaller), not the other way around; the policy is "Disk cache gets whatever's left over, Memory Manager has priority"

Unfortunately, the only thing you can really do about it, is have a machine with a huge amount of RAM, which will kind of help.

<comment><USER11> > This doesn't happen on NT or Linux,

No, NT and Linux also have unified VM. What BSD had pre-UVM was pretty antiquated.

</comment></comment><comment><USER12> What really needs to happen is that Spotlight and Time Machine need to use direct i/o (F_NOCACHE) when they read data from the filesystem, this way they won't pollute the disk cache with their reads and OSX won't swap out a bunch of pages in response.

I think you could probably hack something together that does this with DYLD_INSERT_LIBRARIES (OSX's LD_PRELOAD) that would would hook the open system call and fcntl F_NOCACHE on the file descriptor before it hands it back to the application.

<comment><USER13> This is the correct solution. Time Machine and Spotlight should not pollute the OS cache.

<comment><USER14> I bet the odds are damn good that neither of them ARE polluting the OS Cache.

That they are is just speculation from someone whose taken his experience and projected it onto everybody.

Since he's a person who mucks around with random system settings (like the one in his article) there's no telling what previous damage he's done to cause this problem.

<comment><USER12> You might be right. In my testing, mdworker and friends behave like you'd want them to, I don't see them polluting the cache on my Lion machine. Haven't tried time machine yet.

EDIT: I can't get either spotlight or time machine to show any cache polluting behavior at all, at least not in the way that I run them. I used "mdutil -E /" to force a re-index of my disk, and I kicked off an initial time machine backup on a secondary drive I had lying around. I see both backupd and mdworker doing a lot of disk reads using iotop, but top shows my inactive memory not really changing as drastically as I'd expect, like if I were to cat a giant file to /dev/null.

</comment></comment></comment></comment><comment><USER15> I did this for awhile and ran into an interesting (if fatal) edge case:

I use a 1.5tb external drive formatted in exFAT to minimize cross-platform headaches, and whenever the drive is marked dirty (improper shutdown, eject, etc), OSX will run fsck_exfat on it before I can use it.

fsck_exfat isn't a huge deal -- or wouldn't be, if it didn't have a nasty tendency to leak RAM... the moment you plug in, fsck_exfat's footprint climbs up and up and up... never stopping! Pretty soon it's eaten up 8gb out of my 8gb RAM and poor ol' lappy is unusable.

I can say with authority what happens when you run out of physical RAM in OSX: _it hard locks_. Nothing works -- no keyboard, no mouse, nothing.

So, if you plug in your large, dirty (you dirty drive you!) exFAT-formatted external drive, with dynamic_paging switched off, and let fsck_exfat do its thing, your laptop freezes! Leaving the drive dirty, only to be re-scan on boot-up... freezing the laptop, leaving the drive dirty, only to be re-scan on bootup...

EDIT: this is with Snow Leopard...

<comment><USER16> exFAT is Microsoft proprietary shit.

<comment><USER17> The problem isn't with exFAT, it is with fsck_exfat, which I'm fairly certain Microsoft didn't write.

chkdsk on Windows manages to clean exFAT volumes just fine without using up 8gb+ of memory.

<comment><USER15> yeah sometimes I'll boot into Windows just to clean the drives :-(

</comment></comment></comment></comment><comment><USER18> I've experienced exactly the same thing that was described in this article. All the way though to installing more ram and disabling the dynamic pager (this is a late 2011 mbp).

Like the author I was shocked at how accustomed I was to waiting for an app to become responsive again. I was trained to wait on the OS to do it's business before I could do my work. Now things happen as quickly as I can think to do them, this is how computing should be.

</comment><comment><USER19> I've been a Mac user since the beginning, and by far my biggest frustration is the perpetual running-out-of-RAM, even when I close basically everything. I have 4GB of RAM, and frequently catch kernel_task using at least half of it.

<comment><USER20> Why shouldn't the kernel be using as much memory as possible? It's not like big disk caches or what have you cause your memory to go bad? As long as you get it back when you need it, _who cares_?

<comment><USER21> The issue is just transparency. You want to know how much memory you actually have available for use if you need it. How would you like it if your car's gas gauge was close to empty all the time because the car was caching gas for long trips?

It would seem there's a simple solution -- another number on the system monitor displaying how much memory is available for use if needed.

<comment><USER20> Flawed analogy: you use up the gas and your car stops. You use up memory and … the kernel swaps pages around. Now, if the kernel _isn't_ giving you back memory, that's a problem, but the OP doesn't actually show that this is happening.

<comment><USER21> No, it captures what I want to worry about. I do not want to be in the situation where processes that I am interacting with in real time are paging stuff out to disk. This is really bad for my user experience.

So if my memory is "full" with a bunch of just-in-case stuff, I'll gladly swap it out for real data that a real running process is using it. But if it's "full" of data in use for running processes, then I want to think twice about opening a new application. And I want my memory manager to tell me the difference between those two "full" cases.

</comment></comment></comment></comment></comment><comment><USER22> I also have major memory problems. 8GB RAM total in the system and I have 4GB sitting in inactive and it's paging out? <http://imgur.com/VE4GB> At this point the system pretty much thrashes until I start closing apps or perform a manual `purge`

<comment><USER23> I have the same issue. This is unacceptable.

</comment></comment><comment><USER24> I had a similar problems with my Mac slowing down to a crawl with certain instances of disk access.

I tried turning off spotlight (which was taking a very long time to complete) but it did not help.

For me, the problem turned out to be a failing hard drive. After replacing my system hard drive, things returned to normal speed.

I'm just posting this in case it might help someone else.

<comment><USER25> I concur. I've seen this exact behavior on two different systems when the hard drive was beginning to fail. Swapping the drive fixed the problem.

My friend had installed a new larger drive that was causing the problem, whereas there were no beach balls while booting off the original drive via USB.

</comment></comment><comment><USER26> There's a nice script[1] for tweaking OS X's dynamic pager settings to reduce the system's swappiness that helps a bit. Incidentally, if you have both an SSD and HDD installed, you can use it to move the swapfiles to the HDD to reduce wear.

[1]: <http://dropsafe.crypticide.com/article/3848>

<comment><USER27> Have they not improved the dynamic pager parameters in the last two years?

</comment></comment><comment><USER28> Thank god for this article. My wife is a photographer making heavy use of Lightroom on her 17" MBP and has been experiencing these exact problems for a year or two. We've tried everything to fix it, rebuilding the system from scratch, to no avail.

She had 4 gigs of RAM which we recently upped to 8gigs which reduced the severity of the problem.

I really, really hope this is something that gets fixed in Mountain Lion. Tasks that should take 20 seconds take 10 minutes or more.

It's good to know she's not crazy.

<comment><USER14> She's not crazy, but she is running Adobe software on a machine without sufficient RAM. Adobe installs gods own cache of really crappy stuff that starts up at boot and who knows what kind of kexts they shove in there to make your machine unstable.

I won't run any adobe software after I saw the abuse they did to my machine.

Apple basically gets a free pass if you're running Adobe. This is a company that ships crap.

Also, you're probably starving it of sufficient memory. If Lightroom is up, you're probably out of memory, even with 8GB.

I'd recommend getting rid of Lightroom and going to Aperture, or given aperture is a bit behind the curve, upgrading to 16GB of RAM and seeing what adobe-installed processes and KEXTS you can get rid of.

<comment><USER28> Moving from Lightroom to Aperture's not a possibility, given the workflow, experience, and catalog data she's built up in Lightroom over the years.

Upgrading from 4 to 8 gigs last week helped a lot. I'd go to 16 except her MBP won't support it.

I'd love to get her on an SSD but she's on a 1tb drive now and it would be hard for her to try and fit into a 512gb SSD now (especially now that she's on the D800 with huge video files and 72mb raw photo files.

It's frustrating that it will work find some of the time and not others, implying that the problem could be fixed with better memory management. I do hope that a serious Adobe competitor arises to force Adobe to make its apps faster and more resource efficient.

<comment><USER29> _> Moving from Lightroom to Aperture's not a possibility, given the workflow, experience, and catalog data she's built up in Lightroom over the years._

Forget the advice. Lightroom _is_ faster, as noted in every review of both programs. Try Aperture yourself with the demo to find out.

Working with 10+ megapixel images is always going to be slow, and with camera advances, it will get worse every time your wife gets a higher resolution camera --so comparing it with how it used to be when you have 6mp files is not exactly correct.

More memory and an SSD will definitely help.

</comment></comment></comment></comment><comment><USER30> It occurs to me that HFS might be the real culprit. A lot of the bad behaviors described here involve heavy disk use. John Siracusa has a nice round-up of all the HFS faults:

[http://arstechnica.com/apple/reviews/2011/07/mac- os-x-10-7.a...](http://arstechnica.com/apple/reviews/2011/07/mac- os-x-10-7.ars/12)

</comment><comment><USER31> You can run `purge` in a terminal to free your 'inactive' ram.

I've set up a cron job to purge frequently, keeps thing humming.

<comment><USER32> Cmd line syntax, for the lazy, please?

<comment><USER33> I made a bash script for it and I'll share it, hacker 2 hacker. Goes a little something like this:

#!/bin/bash

purge

<comment><USER34> What license are you releasing your software under?

<comment><USER33> Proprietary, nanananana

</comment></comment></comment></comment></comment><comment><USER35> Does anyone else notice extreme time-based slowdowns using multiple monitors? I've looked through forums and system logs and I can't find an immediate explanation for it. The system tends to hang when using multiple monitors for any extended period of time.

<comment><USER36> Yes, ever since Lion I need to use the 9600m in my MBP instead of relying on the cooler running and less power hungry 9400m. Never noticed the ram problem, but there are other issues with Lion that I never encountered with Snow Leopard. For instance, sleep seems to take forever now and I can't use my external monitor without the fridge magnet hack. I might get downvoted for this, but my MBP seems faster and runs better on Windows 7 than on Lion at the moment. I hope ML improves the experience.

</comment></comment><comment><USER37> [http://wagerlabs.com/blog/2008/03/04/hacking-the-mac-osx- uni...](http://wagerlabs.com/blog/2008/03/04/hacking-the-mac-osx-unified- buffer-cache/)

It's called the Unified Buffer Cache (UBC).

</comment><comment><USER38> the OS X kernel is open source. so why aren't people reading it to figure out where this bug is?

<comment><USER39> Yeah, I'm sure if you just read the Darwin kernel there's a '#define USE_LOTS_OF_MEMORY 1' in there that you can change.

The class of problems described in the original post are not the sort of thing you 'just find' by glancing at kernel source code. The problems described sound like they could be an issue of poorly tuned heuristics/thresholds, or necessitate some extra machinery inside the OS X memory manager that isn't there currently. It's not like you can send Apple a pull request on github.

<comment><USER38> yes I know, that's the point of my question ;)

everyone is all positive about "open source" until they have to dive into a few millions lines of complicated system-level C code and then...

<comment><USER40> > yes I know, that's the point of my question ;)

It's a facile point.

> everyone is all positive about "open source" until they have to dive into a > few millions lines of complicated system-level C code and then...

Does anyone doubt that 99% of open source users never read a line of the source code which they are using? The point is, they have the opportunity to, and more importantly, the 1% (or whatever) with the skills and resources are able to actually do something about it.

If you don't have the ability to change or examine the source code, then there is little incentive to do any runtime analysis which might illuminate the problem.

</comment></comment></comment></comment><comment><USER41> I've gotten a lot of his symptoms, and there might be another cause:

<http://reviews.cnet.com/8301-13727_7-20064489-263.html>

Bad blocks in the disk, causing the system to beachball frequently due to disk I/O failures when swapping out to disk.

The solution for me was to back up, reformat the disk and zero-ing out everything causing bad sectors to get remapped, and then restore.

<comment><USER42> I have to say, I was experiencing a shitload of disk thrashing on my iMac, and eventually decided to replace the drive. So I did the whole ridiculous suction-cup routine (yeah, that's Apple "elegance") and replaced the drive.

Problem resolved. Not that I don't still get inexplicable pinwheels, but nothing like before.

</comment></comment><comment><USER43> Something is quite wrong indeed. I disabled the dynamic pager, and now my system is working as it's supposed to. Snappy and responsive.

I opened all of my apps, expecting it to crash miserably: instead, the system started paging as it should, stayed responsive (though slower), and promptly returned to normal once it regained memory.

I don't know what's going on, but I can definitely say that this is how I want my computer to work.

</comment><comment><USER44> I think this is the penalty we pay for the advice from two years ago:

"Buy all your developers SSDs. It makes them more productive."

</comment><comment><USER45> Try "Free Memory"... I looked for a solution to this problem a few months ago. My computer runs better if I free the memory every few days. For example, resuming a parallels virtual machine drops from 30 seconds down to 3-4. Note, this is a 4GB Core 2 Duo with SSD.

</comment><comment><USER46> My completely non-scientific observations have found that OS X needs plenty of RAM, like any modern OS. However, any disk I/O task has a huge performance impact on the rest of the system, as described by this article. For example, something like unRARing a file will affect the entire system detrimentally, even if CPU usage is nominal. By affect I mean even the cursor can get jittery, which is normally unheard of on OS X.

This typically affects me in low memory situations, such as less than 100mb of free memory. The effect is most pronounced when switching between browser tabs, which would cause a lot of disk usage... pulling all of that data in and out of non-ram cache.

</comment><comment><USER47> I don't have any tests to prove this, but switching from a 64-bit kernel to a 32-bit one and forcing apps to run in 32-bit mode helps a lot with memory usage on OS X. You can use this app to switch apps to 32-bit: <http://www.macupdate.com/app/mac/40405/sixtyfour>

If you look at Windows 7 memory consumption with the same set of software you use in OS X, you'll notice memory usage is 1/2 or 1/3 on Windows compared to OS X. Maybe someone knows why that is?

</comment><comment><USER48> Anyone have any nice articles with tips on how to generally optimize OS X? Esp to better handle this paging/memory management problem that the OP is talking about.

I have a MBP with 4GB RAM and leave programs open all the time. After a few days, it feels very sluggish.

Aside from double my memory and changing my habits (i.e. shutting down every night), how do I fix this?

</comment><comment> DanI-S I'm (fairly) uninformed on this, but from an initial read of the post it seems like memory management may have been optimized for SSD-equipped systems, at the expense of hard disk performance?

Whether this is unintentional, part of a calculated tradeoff, or a cynical business/tactical decision is another thing.

<comment><USER14> 1.5TB of spinning rust in my macbook pro, no observations of this problem. Did see something like it when I was using an SSD that was about to fail.

</comment></comment><comment><USER49> The only winners are those "Mac cleaner, keeper" apps whose Google Ads know we are all watching beach balls.

<comment><USER50> Apple should really sell ad space on those beach balls.

<comment><USER51> Ah, so it's some kind of hourglass/throbber display. As a linux user with a whopping 1 gb of ram on my laptop, I was puzzled by what that term meant. :)

</comment></comment></comment><comment><USER52> Damm.. I turned swap off, and now I have 3 VMs running concurrently on my 2009 MBP with 8 GB RAM, and it's smooth! Before this, even one VM would cause the system to periodically become unresponsive. Ok, this is my _subjective_ opinion, and you can ignore it, but hey, it works for me.

</comment><comment><USER53> I fucking hate OS X Lion Vista. I really miss the stability of Snow Leopard. But can't easily go back.

</comment><comment><USER54> When time machine starts on my MBA ( to an external hd ) it almost freezes the Mac. Is this related?

</comment><comment><USER55> Disabling dynamic paging as suggested in the fine article seems to have made some apps that constantly gave spinning wheels before (Firefox, Time Machine backups) some extra speed.

However, it's still early days. It might just be a "washed car effect."

(Mac Pro 1,1 / 7GB RAM / WD Caviar Black)

</comment><comment><USER56> I too have noticed huge issues particularly when using photoshop or final cut pro. I figured it was the applications, but if it's the OS that's definitely a much bigger issue. I regularly restart every 2-3 hours when using those two programs heavily.

<comment><USER14> In your case, it is the applications. Final Cut Pro X still has some instability, and photoshop is crap.

<comment><USER57> If Photoshop is considered crap, the rest of Adobe software is coded by blindfolded bongo-drum players.

</comment></comment></comment><comment><USER58> Interesting tangent: Plan 9 never had "dynamic paging" (swapping to disk). It supports virtual memory, but not swap. This information is accurate as of about 6 years ago (when I stopped following Plan 9).

</comment><comment><USER59> Anyone have a radar number? This entire discussion is incredibly vague.

</comment><comment><USER60> I've had problems with mtmd (Mobile Time Machine) really slowing down writes (and all disk stuff) since the Lion pre-releases. With that off (sudo tmutil disablelocal) things are pretty smooth.

</comment><comment><USER61> Awesome. The thread is more informative and entertaining than the article! This is Hacker News!

</comment><comment><USER62> i don't understand why anyone who cares about performance doesn't at least max out the RAM, let alone use an SSD as their boot disk. sure, the SSD is expensive, but the RAM? dirt cheap. i only wish the MBP could take more.

</comment><comment><USER63> Please:

font-size: 16px; line-height: 1.5em;

</comment><comment><USER64> I have an 8-way Xeon Mac Pro w/ 20GB of RAM, almost half of which is 'free' at any point during the day unless I'm doing something really out of the ordinary.

Yet it still swaps to disk ALL THE TIME and a new Terminal.app window can take up to 5 seconds to open.

I really don't give a shit how it's not "technically" broken - that's broken from an experience point of view. And I haven't re-installed the OS (this was an App Store upgrade from Snow leopard) because that's a major pain in the ass as this is an actual workstation used to do actual work.

I can't believe this is actually advice, either - that's what Windows users used to say in the 90s. Anyway, I guess I'm just ranting. OS X is wonderful except for the fact that it sucks at managing memory to keep a system snappy.

<comment><USER65> _Yet it still swaps to disk ALL THE TIME and a new Terminal.app window can take up to 5 seconds to open._

That's not swapping. That delay is /usr/bin/login searching the system logs so that it can display the date and time of your last login.

Create a .hushlogin file in your home directory to prevent that.

<comment><USER66> No. The sequence of events concerning this in login:

0) `login -pf`

1) quietlog = 0

2) if ("-q" in argv) quietlog = 1

3) if (!quietlog) getlastlogxbyname(&lastlog)

4) if (!quietlog) quietlog = access(".hushlogin") == 0

5) dolastlog(quietlog) ->

6) if (!quietlog) printf(lastlog)

You can see from this that the "searching the system logs" (which, to be clear, is going to be really really fast: /var/run/utmpx is a small file with fixed length fields) happens in step #3, before .hushlogin is checked in step #4.

If you wish to verify, you can read the code at the following URL. Note that __APPLE__ and USE_PAM are defined for the OS X distribution of this code, while LOGIN_CAP is not.

[http://opensource.apple.com/source/system_cmds/system_cmds-5...](http://opensource.apple.com/source/system_cmds/system_cmds-541/login.tproj/login.c)

<comment><USER65> It does not use /var/run/utmpx anymore.

Look at the code for getlastlogxbyname(). It does an ASL query for last login, and that's the source of the delay.

[http://www.opensource.apple.com/source/Libc/Libc-763.12/gen/...](http://www.opensource.apple.com/source/Libc/Libc-763.12/gen/utmpx- darwin.c)

<comment><USER66> As I stated, that cannot be the source of the delay, because getlastlogxbyname is called based on a check of quietlog before quietlog is updated to take into account .hushlogin. With the exception of step #7, all of this code is inside of a single function (main), which makes it very easy to verify that the sequence of events I'm describing is correct. (I will happily believe you, however, that getlastlogxbyname is internally now using something horrendously slow to look up that information.)

(edit: I have gone ahead and verified your statements regarding getlastlogxbyname now being based on ASL. Using that knowledge, and based on st3fan's comments about the output of dtrace, I then used dtruss to verify my own assertion regarding the order of events. The result: .hushlogin in fact only affects the output of "last login"; it does not keep login from getting that information in the first place with ASL. To keep it from doing so you must pass -q, something Terminal does not do.)

<comment><USER65> You're right. ASL is the source of the slowdown, but .hushlogin isn't actually doing anything to solve the problem.

The correct way to bypass the ASL query is to set Terminal to open shells with /bin/bash (or your shell of choice) instead of the default login shell. Terminal will still use /usr/bin/login to launch the shell, but it passes the -q switch to prevent the ASL query.

When I dug into the source code a couple of months ago, I inadvertently made both changes (Terminal settings and .hushlogin). Clearly it's the Terminal settings that solved the problem and not .hushlogin. Thanks for clearing it up.

</comment></comment></comment></comment></comment></comment><comment><USER14> This claimed problem is not adequately described-- because I don't see it. Therefore there is something else going on here.

I have 8 GB of memory on my Macbook Pro, and I've never seen anything like the problems described in this article. I leave my machine up for weeks at a time, I leave the Time Machine drive connected for weeks, and never have a slowdown, even when time machine is backing up.

The only time I have memory issues is when I have too many safari tabs open for too long. Eventually safari takes too much memory. So, I shut down safari and start it back up-- it opens up all the tabs that were open and takes a lot less memory.

I'm kinda astounded that people with 20 and 32GB of RAM and 8 CPUS are saying it takes 5 seconds to open a terminal window. Have never seen anything like that.

I would venture to guess that these people who are seeing the problem are running a kernel extension or possibly have otherwise modified their machine.

<comment><USER67> Running your setup and I've seen this problem only with VMWare Fusion running. But they have KB article ([http://kb.vmware.com/selfservice/microsites/search.do?langua...](http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1038864)) which discusses what they're doing. VMWare Fusion won't let go of memory allocated to a _suspended_ VM, only to a VM which has been fully shut down. The rationale is that the user might unsuspend the VM so it's a performance tweak. But I never use my VMs this way, so I've resorted to shutting down my VMs and everything is back to being snappy.

</comment></comment><comment><USER68> > OS X is wonderful

ROFL

<comment><USER68> I guess the point of the short comment was lost: How can anyone say that any of the current crop of OS's is "wonderful"? Wonderful? Really?

Whether you use Windows or OSX (or both, as is my case) you can probably rattle off a sizable list of how these OS's have gotten screwed-up by their respective publishers. Someone saying "<OS name> is wonderful" and then going on about the reason it actually isn't is very funny.

Again, the comment was OS agnostic even though the thread is about OSX.</comment></comment>


Ask HN:  Is school essentially slavery? - <AUTHOR>

Why does society tolerate this form of slavery?<p>Shouldn't students just learn on their own -- especially those who will pursue entrepreneurship? <comment><USER2> In a world where there are an estimated 12 to 27 million actual slaves[1], none of whom are free to leave their servitude under penalty of bodily harm or death, I don't think it would be fair whatsoever to compare school (even compulsory schooling of children) with slavery. Slavery is a completely brutal and unacceptable institution, where one party has absolutely no rights.

[1] <http://en.wikipedia.org/wiki/Slavery>

<comment><USER3> I disagree.

This is like the inevitable comparison between the US government stealing our freedoms and China (or some other dictatorship). The argument isn't that they are exactly the same thing - it is that one is edging closer to the other than we would like, and we would like to draw attention to the bad similarities in an attempt to fix them.

If we never compare the way things are to the worst ways we know, how can we know if we're falling down that slippery slope until we get to the end and it's too late? Maybe upon reflection we'll realize that we're already several steps down a bad path, even if we're still far from "evil" territory.

</comment></comment><comment><USER4> "For most of your school life, it doesn't make that much difference what subject you're taught. The real lesson is the method. The medium in school truly is the message. And the medium is, above all, coercive. You're forced to attend. The subjects are required. You have to do homework. You must observe school rules. And throughout, you're bullied into docility and submissiveness. Even modern liberal refinements don't really help. So you're called an underachiever instead of a dummy. So they send you to a counselor instead of beating you. It's still not your choice to be there. They may pad the handcuffs--but the handcuffs stay on.

Which particular subject they happen to teach is far less important than the fact that it is required. We don't learn that much subject matter in school anyway in proportion to the huge part of our lives that we spend there. But what we do learn very well, thanks to the method, is to accept choices that have been made for us. Which rule they make you follow is less important than the fact that there are rules. I hear about English teachers who won't allow their students to begin a sentence with "and." Or about high schools where the male students are not permitted to wear a T- shirt unless it has a pocket. I no longer dismiss such rules as merely pointless. The very point to such rules is their pointlessness."

[http://www.soilandhealth.org/03sov/0303critic/030301studenta...](http://www.soilandhealth.org/03sov/0303critic/030301studentasnigger.html)

</comment><comment><USER5> "Inglis breaks down the purpose - the actual purpose - of modem schooling into six basic functions, any one of which is enough to curl the hair of those innocent enough to believe the three traditional goals listed earlier:

1) The adjustive or adaptive function. Schools are to establish fixed habits of reaction to authority. This, of course, precludes critical judgment completely. It also pretty much destroys the idea that useful or interesting material should be taught, because you can't test for reflexive obedience until you know whether you can make kids learn, and do, foolish and boring things..."

More: <http://www.johntaylorgatto.com/>

</comment><comment><USER6> Ask HN: Is this the worst Ask HN we've ever had?

</comment><comment><USER7> If you're talking about children, they are too young to decide whether they will "pursue entrepreneurship" and at what point in their lives. Depending on their age, they are very likely too young to decide much of anything — this is why they are in the custody of adults. School is preparation for whatever they decide to do. It is also unreasonable to expect children to "just learn on their own." If there were any indication that such a plan would work, we would all lovingly embrace such a huge cost reduction. But in countries without a primary education system, children just tend not to learn.

Higher education is not slavery because it's voluntary, which is the antithesis of slavery.

</comment><comment><USER8> The problem with thinking "students can learn on their own" is that there is an autodidact culture here at HN, so that view is skewed a bit.

Most entrepreneurs have a different mindset from these people. They want to do something big like make a revolutionary product or impact the world somehow.

Most of my peers don't want to learn on their own. They just want to get the piece of paper that says "Bachelors of _________", get a well-paying job (>60k), and live a life happily ever after. They don't care about making a company, because being employed by someone else has far less risk than making your own startup.

<comment><USER9> My thoughts exactly. I wonder if that's something that can be taught, though, or at least encouraged/nurtured. How did we, as entrepreneurs, get to be this way?

<comment><USER7> "How did we, as X, get to be this way?" is a question the human race has been pondering for millennia without really cracking the nut.

</comment></comment></comment><comment><USER10> Prison is a better analogy. It goes pretty far too, with some very important differences of course.

</comment><comment><USER11> The Twain quote is the best in my opinion... those of us who are passionate about learning will remove ourselves from the systems that impede us, or at least endeavor to minimize their impact on our lives. School, at least in its current implementation, is a supremely flawed model for many of the reasons discussed in this thread and elsewhere. The solution is not to just do away with it though - while for some of us this would be liberating, for a far greater number of people it would be harmful. Anarchy, be it political, economic, or educational, rarely generates cut and dry improvement.

As someone who has many issues with education, and has felt openly hostile toward it previously, for me adopting a relaxed attitude about it was the most important step. I realized I could go to classes, engage with professors and other students, and do reasonably well in terms of marks without allowing grades or assignments to impact my external intellectual curiosity. I've been much happier, and much more productive both inside and outside of school, since I let go of the frustration with "the system" and put the focus on myself.

</comment><comment><USER12> Slavery is what happens to you when you don't go to school.

</comment><comment><USER13> Closest to slaves are public school teachers who get relatively small pay for their work, at least around these parts of world.

</comment><comment><USER14> A six year kid can not learn on his own and also most 20 years simply feel difficult to learn on thier own.

</comment><comment><USER15> it's more like a prison.

go read the first chapter of Paul Graham's "Hackers & Painters" <http://www.paulgraham.com/hackpaint.html>

</comment><comment><USER13> Makes me wonder what kind of experiences spawn these kind of ideas.

</comment><comment><USER16> "I have never let my schooling interfere with my education."

\-- Mark Twain</comment>


What are you going to do after you've sold your company? - <AUTHOR>

<comment><USER2> Isn't this a little premature? I mean, except for PG, dshah, and perhaps a few other lurkers, very few of us have sold (or statistically, are likely to sell) a company.

That said, I'd probably work on some of the other ideas I've had. Ones that are arguably more useful and more world-changing, but have little or no revenue potential.

<comment><AUTHOR> Very true about the first statement. But I asked to see what people's aspirations in life are. If money wasn't an issue and you could have everything you want, what would you do with your time? I often ask myself this so as to know that I am always following my hopes and dreams rather than following money.

</comment></comment><comment><USER3> Best advice I've heard about what to do after selling your company is to first get your first one off the ground. If you want to go to Disneyland copy the <http://www.twiddla.com/> guys and sell it a week later on sitepoint. That ought to get you enough for a week in LA.

</comment><comment><USER4> #7 <http://www.paulgraham.com/startuplessons.html>

I don't think there'd be a lot of visible changes. For a while I'd just relax, eat right, and exercise until I got interested enough in something to work hard on it.

</comment><comment><USER5> Some people are lazy, exploit others good will and have luck, they sold their company and other people are agile and doesn't have luck. If you was lazy before, you stay lazy, and buy dream house, car or whatever ... if you are agile, you start a new company.

</comment><comment><USER6> Find a new idea..and then build a bigger and better company! The journey is the reward.

<comment><AUTHOR> I absolutely agree. I would start another one. Not so much because I want to sell it. I have all these ideas that I have written down and I want to have an opportunity to do them. Because they're your babies and you want to give them ALL life. It's always hardest to decide which one to do now and which ones to pursue later...

</comment></comment><comment><USER7> Drink, Party and start a new Company. Maybe move to a cheap warm country

</comment><comment><USER8> Start a new one.

</comment><comment><USER9> Go to Disneyland!

</comment><comment><USER10> Go to India

</comment><comment><USER11> Sleep?</comment>


Why Experts Reject Creativity (2014) - <AUTHOR> http://www.theatlantic.com/business/archive/2014/10/why-new-ideas-fail/381275/?utm_source=SFFB&single_page=true <comment><USER2> The responses to the iPhone were interesting. This article makes me wonder how many people like Ballmer and Balsillie had already been presented with similar ideas and had rejected them.

When the iPhone came out, I felt that the clones weren't so much people copying Apple but creative engineers being unshackled and being allowed to make what they wanted.

<comment><USER3> In a way the experts were right, my recollection is that the first iPhones were not _amazingly_ good at being phones. Where the experts got it wrong is the assumption that people _wanted phones_.

What it turned out that people really wanted was a small portable computer that had a camera, Web browser, music and video player built in. And that could make phone calls and send sms messages. But they didn't know that is what they wanted until Apple punted it out...

<comment><USER4> Nokia put a web browser in phone back in 1996. Phones already had all those features you listed. They were just slow and clunky to use.

<comment><USER5> But they were always phones, first.

You turn it on / open it, and it's at the phone screen. You could just dial using the dedicated hardware numeric keypad, and it would place a call. To get to the web browser, calendar, and other functions you had to go into a sub- menu, because they were secondary, not-that-important functions of the device.

If it's a phone, this is a fine design. If it's a device who only happens to have a phone feature (and personally, I barely use the "phone" part of my phone anymore), then it's actually a very annoying design. It's about as useful as if someone decided that upon startup or pressing the "home" button, it should go to Angry Birds, and all other apps/features could be accessed via a menu button after that.

It's a subtle, but important, difference in the mindset that goes into designing both the hardware and software.

<comment><USER4> [https://en.wikipedia.org/wiki/Nokia_9000_Communicator](https://en.wikipedia.org/wiki/Nokia_9000_Communicator)

When you opened Nokia Communicator, it was more like PDA or a computer than a phone. Home screen, calendar, message, etc. widgets, very much like Android phones are nowadays.

It was like a phone only when closed. Made sense that way.

[http://www.gsmarena.com/nokia_9000_communicator-16.php](http://www.gsmarena.com/nokia_9000_communicator-16.php)

Note web browser and telnet client, that was pretty cool in 1996. gsmarena mistakenly says it was introduced in 1998.

[https://en.wikipedia.org/wiki/Nokia_E90_Communicator](https://en.wikipedia.org/wiki/Nokia_E90_Communicator)

In 2007, Nokia E90 had a display that was almost like "retina", 219 DPI. The web browser was also usable at the time. It had even Flash player.

</comment></comment></comment></comment></comment><comment><USER6> In my view, there are two sides of the coin.

Experts (people who have the experience) should always explain, we tried this and this and that is why it have failed.

On the other hand, creative people should be able to justify why the situation or their solution is now different compared to what was tried before.

The rejection seems to happen if this kind of communication doesn't happen. And it cuts both ways - just like there are experts who reject creativity there are creative people who reject expertise. (Typically this is a generational conflict.)

</comment><comment> r-w I disagree with the conclusion of this article. The author conflates familiarity with lack of creativity. In order for an idea to be sold, its presentation must resonate with its audience. That means it must latch onto their beliefs as well as those facts that have been proven to them, and it must leverage those conceptual building blocks to bring them up to date with this new logical composition. With no frame of reference, how should anyone know where a product fits in? No one other than the innovator can be expected to have such a vision—after all, how often is the next trend predicted? In retrospect, analogies to past breakouts become apparent. Being analogous to pre-existing innovations is not mutually exclusive with being novel and creative; in this new age, we will soon find that all new developments are built solely at a higher level, on the foundation comprising progress thus far. We therefore cannot present this as a disrespect for knowledge, but rather an impatience for those who create things before deciding their place in this unfair, pragmatic world.

</comment><comment><USER7> This reminds me a bit of Lee Smolin's book "The Trouble with Physics". In it he defines a concept about how innovation happens. He defines revolutionaries into two categories: craftsmen, and seers. Craftsmen take current constructs and raise the bar (his example: Newton), where seers create completely new constructs that involve more imagination (his example: Einstein).

Jumping of his idea, I would say large institutions (business, academia) have a bias toward creating craftsman, and thus the point in this article that while it takes all kinds to innovate, sometimes it takes seers to really stir the pot up.

</comment><comment><USER8> This is in science the same: You can adjust a common accepted theory a bit, but putting everything upside down, even if it's logical and makes sense, will not get accepted. Really sad :(</comment>


Ask HN: Good books on debugging? - <AUTHOR> Are there any good books on debugging? I think debugging is one of the key skills of a good developer, but I have never seen a book (or blog) especially about debugging code and distributed systems. <comment><USER2> Working Effectively With Legacy Code by Michael Feathers [http://www.amazon.com/Working-Effectively-Legacy-Michael- Fea...](http://www.amazon.com/Working-Effectively-Legacy-Michael- Feathers/dp/0131177052)

Debugging with GDB: The GNU Source-Level Debugger by Stallman, Pesch, and Shebs [http://www.amazon.com/Debugging-GDB-GNU-Source-Level- Debugge...](http://www.amazon.com/Debugging-GDB-GNU-Source-Level- Debugger/dp/1882114884/)

The Art of Debugging with GDB, DDD, and Eclipse by Matloff & Salzman [http://www.amazon.com/gp/product/1593271743](http://www.amazon.com/gp/product/1593271743)

</comment><comment><USER3> While there are great options mentioned here, I would actually be suggesting that you stick to a very good systems book. A standing knowledge of lower level systems and instruction code will give great depth to your debugging skills. Nothing teaches reverse engineering better than experience.

At CMU, we used CS:APP (Computer Systems: A Programmer's Perspective). It's written by Randy Bryant, the same professor who used to teach it. I still have that book, it's updated for Ivy Bridge, and I truly believe that this book changed my approach towards debugging more than any other text. It will push you to the next curve.

Towards the end of the book you'd find some programming labs. I highly suggest you do them religiously. Many great men have failed at them.

<comment><USER4> Nice recommendation. Looks like the 3rd edition was just published this month. Bryant's blog describes the updates to the 3rd edition here: [http://csappbook.blogspot.com/2015/02/the-third-edition- will...](http://csappbook.blogspot.com/2015/02/the-third-edition-will-be-out- march-11.html)

</comment></comment><comment><USER5> I've read a number of books on debugging, it's something of an interest of mine. The best general-purpose debugging book I've read is the cumbersomely named

Debugging: The 9 Indispensible Rules for Finding Even the Most Elusive Software and Hardware Problems by David J. Agans

Amazon link: [http://www.amazon.com/Debugging-Indispensable-Software- Hardw...](http://www.amazon.com/Debugging-Indispensable-Software-Hardware- Problems/dp/0814474578/)

What I really like about it is that it gives a number of high-level approaches to solving debugging problems and is written very accessibly.

</comment><comment><USER6> Tess Ferrandez's blog is worth a look if you're doing .NET debugging (particularly outside of the IDE - she's a windbg wizard):

[http://blogs.msdn.com/b/tess/archive/tags/debugging/](http://blogs.msdn.com/b/tess/archive/tags/debugging/)

She has written some labs covering common debugging scenarios:

[http://blogs.msdn.com/b/tess/archive/2008/02/04/net- debuggin...](http://blogs.msdn.com/b/tess/archive/2008/02/04/net-debugging- demos-information-and-setup-instructions.aspx)

</comment><comment><USER7> I haven't read it, but a really smart ex-colleague is the author of 'Debug It': [https://pragprog.com/book/pbdp/debug- it](https://pragprog.com/book/pbdp/debug-it)

<comment><USER8> I have read it, and it's quite good. Was about to post the link myself until I saw that you had.

</comment></comment><comment><USER9> Any Sherlock Holmes adventure book. Technique is good. Attitude is better.

</comment><comment><USER10> "Debugging Applications" by John Robbins is an old MS Press book, now 43 cents on Amazon, that covers everything from high level code structure to a nice primer on reading x86 assembly. I have more recent books, but this is the one that taught me to gird my coding loins for a fight.

</comment><comment><USER11> "Find the Bug: a Book of Incorrect Programs" by Adam Barr: [http://www.amazon.com/gp/aw/d/0321223918/ref=mp_s_a_1_1?qid=...](http://www.amazon.com/gp/aw/d/0321223918/ref=mp_s_a_1_1?qid=1426946354&sr=8-1&keywords=find+the+bug&pi=AC_SY200_QL40&dpPl=1&dpID=51n%2B4Yc628L&ref=plSrch)

It has a bunch of examples of bugs, classified by type of bug, and gives you tools for diagnosing and fixing them.

</comment><comment><USER12> Giving tips very much depends on the language you're using and the capabilities of your debugger, having worked on large legacy VC++ projects knowing the "bad smells" and common mistakes to spot is helpful, but you'll struggle to debug projects you don't have a solid knowledge of.

To improve, try learning cracking; [https://microcorruption.com/](https://microcorruption.com/) is a CTF game based around gaining access to embedded devices, it's rather fun too. I think what the most common mistake I find is two programmers having different assumptions on how some subsystem should work, so try improving your working memory as being able to remember the seemingly ok code 10 frames ago that conflicts with what's in front of you could be the key.

try:

Working Effectively with Legacy Code Martin, R.

API Design for C++ Reddy, M.

Were both full of indispensable advice.

</comment><comment><USER13> There is a course on udacity called software debugging [https://www.udacity.com/course/cs259](https://www.udacity.com/course/cs259)

</comment><comment><USER4> Andreas Zeller, original author of GNU DDD, has a good book called "Why Programs Fail: A Guide to Systematic Debugging", 2nd edition.

[http://www.amazon.com/Why-Programs-Fail-Systematic- Debugging...](http://www.amazon.com/Why-Programs-Fail-Systematic-Debugging- ebook/dp/B0092L8LCW)

</comment><comment><USER14> You need to understand how your system works and then get a good tool that allows you to observe its behavior in as much detail as possible.

I don't believe books are likely to be particularly relevant with the diversity of tools and platforms. Google the platform name plus 'debugging tool'. Then practice debugging.

If you have to, step through every single line of code and observe the program state closely at each step.

What kind of distributed system is it exactly? If it is a highly distributed system you can mock parts of it or find/ build a tool for fine-grain inspection and integrated reporting of the state of the system.

A book is not going to be able to keep up with platform and tool development.

You want to learn to Google, find good tools, practice a lot.

</comment><comment><USER15> Software Exorcism: A Handbook for Debugging and Optimizing Legacy Code by Bill Blunden

</comment><comment><USER16> The Takipi blog deals a lot with debugging related issues: [http://blog.takipi.com/](http://blog.takipi.com/)

Some more posts worth checking out in the JVM domain:

[http://highscalability.com/blog/2015/1/7/the-ultimate- guide-...](http://highscalability.com/blog/2015/1/7/the-ultimate- guide-5-methods-for-debugging-production-server.html)

[http://www.infoq.com/articles/Advanced-Java-Debugging- Techni...](http://www.infoq.com/articles/Advanced-Java-Debugging-Techniques)

(Disclaimer: I'm from Takipi)

</comment><comment><AUTHOR> Somewhere on the internet the book "The Medical Detective" by Bertone Roueche should be a really good read about debugging. But I did not find a place on the internet where you can buy it. Here is a link to goodreads: [http://www.goodreads.com/book/show/106164.The_Medical_Detect...](http://www.goodreads.com/book/show/106164.The_Medical_Detectives)

Has anyone read this book and can recommend it?

<comment><USER17> oh yes ! heartily recommended. i have a copy from amazon, and the stories are just incredible. it is just like a magicians trick. you know it's a trick because laws of physics and all that, but quite fun to deduce.

the writing style is very engaging. some stories are fully resolved, others just conclude with a plausible hypothesis that explains the data, but due to lack of sufficient evidence cannot be confirmed.

</comment></comment><comment><USER18> Check this one: [https://books.google.com/books?isbn=0549783229](https://books.google.com/books?isbn=0549783229)

</comment><comment><USER19> Surprised this wasn't already mentioned, but the best description I've ever read of debugging is in Zen and The Art of Motorcycle Maintenance. (Unsurprisingly, it's about debugging motorcycles, but the author was a programmer so it's directly transferable)

</comment><comment><USER20> The Scientific Method of Troubleshooting (Blithe Rocher @ GoGaRuCo 2014) [https://www.youtube.com/watch?v=h9YZXuUjyOs](https://www.youtube.com/watch?v=h9YZXuUjyOs)

</comment><comment><USER21> Work on legacy systems.

</comment><comment><USER22> Robert Ward, "Debugging C". There is a second edition with a somewhat different title that I have not read, but expect would be good.

He emphasizes the use of the scientific method - observe your program's behavior, form a hypothesis as to what the bug could be, design an experiment to test your hypothesis. Just learning to be methodical rather than thrashing around mindlessly helped me tremendously.

It's out of print but I expect you could find it on Alibris.</comment>


Nim: Scripting Ease in a Compiled Language - <AUTHOR> https://www.junglecoder.com/blog/nim-early-report <comment><USER2> One thing I find annoying about Nim is the case insensitivity [0]. There was no strong reason for this "feature" and literally no mainstream language does it. Moreover it makes code search a pain.

[0] [https://nim-lang.org/docs/manual.html#lexical-analysis- ident...](https://nim-lang.org/docs/manual.html#lexical-analysis-identifier- equality)

<comment><USER3> As an admittedly amateur programmer, I think the reasoning is solid. Its difficult to read and understand code that does things like myvalue = myValue. I think they made the right tradeoff, in that value != Value (the case of the first letter _is_ used), so if you really need to have to values with the same name, you can still do it.

As an aside, is there some reason that using the same identifier with different cases is desirable?

<comment><USER4> Nothing unusual in doing e.g. `array = Array()` (although you should probably give your variables better names than that), which would break in Nim.

<comment><USER3> Right, and that's the point, aside from the fact those 2 are actually different in nim. I see what you are doing there, but that would have been very confusing when I started programming.

Question is, should the language enforce you giving your variables a better name, or should convention? I think there are reasonable arguments for both.

<comment><USER5> But does a language with Python-like syntax really have to try to be so "beginner-friendly" that it enables inconsistent casing?

The language itself can't enforce better variable names, at least not this way - Nim doesn't stop me from using "abcd" or "a0, a1, ... a100" as variable names even though it's usually a very bad idea.

No, I think a language should help keeping the code consistent in the long term - and having this strange case insensitivity doesn't help there in my opinion.

<comment><USER6> > I think a language should help keeping the code consistent in the long term > - and having this strange case insensitivity doesn't help there in my > opinion.

Not at all. Style insensitivity encourages good variable naming and there are both formatters and also the simple text completion in editors to guarantee consistency.

</comment></comment></comment></comment></comment></comment><comment><USER7> Shameless plug - I interviewed Andreas, the creator of Nim, about his philosophy and design choices here: [https://sourcesort.com/interview/andreas- rumpf-on-creating-a...](https://sourcesort.com/interview/andreas-rumpf-on- creating-and-growing-nim)

Might be an interesting read for people who are thinking about using Nim and wondering how it compares to the C family, Python, Go, etc.

<comment><USER8> > The C-family of languages has quirky syntax, grossly unsafe semantics and > slow compilers but is overall quite flexible to use. This is mostly thanks > to its meta-programming features like the preprocessor and, in C++'s case, > to templates.

> The Pascal family of languages has an unpleasant, overly verbose syntax but > fast compilers. It also has stronger type systems and extensive runtime > checks make it far safer to use. However, it lacks most of the > metaprogramming capabilities that I wanted to see in a language.

While Nim somehow is not appealing to me, this absolutely nails it.

</comment></comment><comment><USER9> You know the language has potential when the top comments on HN are all about syntax.

To generate more talking points, somebody ought to write an inverse of dumpLisp: [https://nim- lang.org/docs/macros.html#dumpLisp.m%2Cuntyped](https://nim- lang.org/docs/macros.html#dumpLisp.m%2Cuntyped)

<comment><USER10> I am confused if you this is an honest opinion or if you are saying with a touch of sarcasm. If it is the latter, a winking smiley or "</sarcasm>" or "/s" would have been nice to avoid triggering Poe's Law.

In my honest opinion, discussion on syntax is a distraction. One of the reasons I like Lisp/Clojure is that there is very little syntax. I can just focus on my problem and writing good code.

<comment><USER11> I think he meant that if the worst thing people can say about a language is that it has slightly quirky syntax it must've done a lot of things right.

</comment></comment></comment><comment><USER12> I've been considering getting into Nim for a while now as something more lightweight/terse to write thin CLI utilities in. I'm glad to hear that it's performing well for this usecase. It's a very attractive alternative to Rust for it's simplicity and terseness.

I still haven't gotten around to picking it up though, these days I just use QuickJS for anything that needs to be reasonably portable and thin.

Maybe next side project...

<comment><USER13> I would highly recommend it. Setup is incredibly easy (VSCode has great plugins for it), the language is simple to read/write and compiled Nim is very fast with small binaries. I also really like nimfmt to keep my code tidy so I don't need to worry about it. Nim compiles VERY quickly and errors seem to be easy to comprehend. It's definitely one of my go-to languages for most of my projects.

</comment></comment><comment><USER14> Is there anyone using Nim either in side projects or in production that can comment on how they like it?

I keep hearing about Nim and it sounds interesting, but I'm not sure I have the mental capacity right now to do a deep dive into the language and build something with it. I'd like to at some point soon though.

<comment><USER15> I use Nim in production. I been using it for more than 1 year in production.

I like it. For me, it started out as a faster python that prevents typos. But it has really grown on me. I really like that I can share libs on server (compiling to c) and client side (compiling to plain javascript).

Basically any C library is also a Nim library with a tiny wrapper. That's a huge ecosystem! I also like how Nim can integrate with complex C++ libs that do virtual table call backs. It can also call objective-C functions .. you know the ones with [foo a:1 b:1] crazy syntax? Python was a glue language for me, but Nim can just glue more things.

JS too! In Nim you can just compile to plain JS, that other JS can call as well. Pass plain JS objects around. I basically replaced my JS code file by file - there was no need for a huge rewrite.

I know docker and kubernetes is "the thing" right now, but I just like that I can just scp the binary over. It just feels less complex. I feel like docker solved the distribution problem for python and node... I just don't have a problem to solve any more. It's just gone.

<comment><USER16> I have some code duplication between android, iOS and a webapp / PWA. How realistic is it to look at something like nim for codesharing?

<comment><USER17> Not the parent poster but I'd say it's very realistic. I've written a few applications that target both JS (web browser) and binary (server) and it works very well. One example of this is [https://picheta.me/snake/](https://picheta.me/snake/).

I'm also working on a game that I haven't quite moved to iOS/Android yet, but that is my plan. So far targeting the desktop with SDL and HTML5/Canvas with the JS backend works very well.

</comment></comment></comment></comment><comment><USER18> Author of the article here, feel free to ask me anything if you're wanting to understand something about the article, or about Nim. I am _not_ the author of Nim.

I also want to point out that Nim does have an IRC channel (#nim) on freenode, which was helpful for understanding some of these things.

</comment><comment><USER19> Nim's syntax is everything I hate in a language.

It's not bad, objectively speaking, but its design opinions are the polar opposite of mine.

<comment><USER20> I'm half and half. I adore syntactic whitespace and it makes me sad that it hasn't become more prevalent.

However the flexible identifier rules bother me no end. But as soon as my editor of choice handles it transparently then I guess I might come round.

<comment><USER21> > flexible identifier rule

When / how has this actually impacted you?

<comment><USER20> It hasn't because I've not done more than merely look at Nim.

However it bothers me aesthetically and has put me off trying it.

</comment></comment></comment></comment><comment><USER22> How do data scientists feel about Nim? It feels very pythony, but way faster - could be a really cool language for them, similar to what Julia is trying to be.

Curious if anyone in a DS role has tried it out. I'm certainly tempted to try it out, I'm sure I'm losing lots of performance in parts of my analytics pipeline due to Python being garbage slow.

<comment><USER23> The options in python to speed up your code are vast without really having to do much, on a fundamental level. My outdated experience with Nimrod told me that it was a tad too opinionated E.g. Everything is a string in dbs is mentioned in the article.

It was an interesting language, for me it felt like a stepping stone to something better. But the docs were really bad,

<comment><USER24> "Nimrod" experience is quite outdated. There have been great improvements in documentation in the last year.

</comment></comment></comment><comment><USER25> Is Nim stable? I have vague memories that some parts of its runtime had some deep issues that weren't yet resolved, like maybe around concurrency? I see the language is at 1.0 now, does it have a stable, solid, dependable implementation and runtime?

<comment><USER24> I don't have vague memories. I use it everyday on production code on server and embedded. I find it stable, solid, dependable.

<comment><USER26> Can I ask how you got started on embedded and on which MCU? I assume you mean bare metal.

</comment></comment></comment><comment><USER27> Looks cool already but is it easy to cross-compile? I can copy a Python script from my Linux machine and run it on both Mac and Windows PCs. Can Nim build executables for other platforms nearly as easy?

<comment><USER28> In addition to compiler switches that allow you to cross compile from the nim compiler [0], you can compile to c or c++, and then invoke whatever cross- compilation toolchain to compile to more esoteric platforms.

[0] [https://nim-lang.org/docs/nimc.html#cross-compilation](https://nim- lang.org/docs/nimc.html#cross-compilation)

</comment></comment><comment><USER29> Does nim have any way to write a one-liner that includes nested scopes? Something like `nim --run="if(...) { while(...) { foo; bar;} }"`? Not knowing nim, I just made that syntax up... :-)

</comment><comment><USER30> What're compile times like?

<comment><USER18> For me, I'm seeing compile times averaging around 5-10 seconds, with outlier builds taking up to 40 seconds if the files in question aren't cached.

It feels faster than Go, but I think part of that is down to Nim's compile output being verbose by default.

<comment><USER6> Nim's compilation is much faster than Go.

<comment><USER17> As someone that compared both a while back (and a biased Nim core developer) I don't think this claim is true. Go is really fast at compilation, but honestly Nim is good enough.</comment></comment></comment></comment>


The end of Philosophy - <AUTHOR> http://www.nytimes.com/2009/04/07/opinion/07Brooks.html

<comment><USER2> The article talks as if the idea that moral judgements are based on feeling or perception rather than on reason is a recent one. As one (important) example, Hume explicitly advocated such a position in the 1700s.

It also seems to confuse moral philosophy and moral psychology. The former can use reason and arguments to attempt to justify practical principles and actions (at least somewhat) independently of how, psychologically, human agents, in fact, make moral judgements in real-life situations.

"The End of Philosophy" is a silly title because, for a start, what is discussed is only relevant to _moral_ philosophy; and secondly, whatever firm scientific results may be produced regarding moral psychology, there are still endless issues that moral philosophers can continue to sensibly discuss, for example, the semantics of (what appear to be) deductive moral arguments.

<comment><USER3> It's like The End of History; a silly title for a silly piece of writing.

<comment><USER4> "The Singularity is an end-of-history notion. And it is showing its age, as most end-of-history notions do."

\-- Bruce Sterling

(video link: <http://fora.tv/2004/06/11/Bruce_Sterling#chapter_01> )

<comment><USER5> When Francis Fukuyama said "the end of history" he meant that liberal democracy is the evolutionary end point of nation states. Meaning:

1\. any nation state that is now a liberal democracy will remain so because there is nothing more advanced for it to evolve into

2\. any nation state that is not a liberal democracy is merely not yet a liberal democracy and will eventually evolve into one

The singularity is the point at which rate of technological evolution becomes so rapid that it is essentially incomprehensible. That doesn't sound like an end of history notion to me.

</comment></comment></comment></comment><comment><USER6> To paraphrase the article:

 _Dear children, your silly worldview of objective rights and wrongs is outdated and wrong. Morality is purely subjective, a matter of taste. I provide no evidence or reasoning for my opinions but I do expect you to be challenged and wowed by their far-reaching consequences._

If morality is purely subjective, then issues such as as gay marriage become purely a matter of taste. One person has taste for self-determination and thinks that gays should marry and another thinks gay sex is gross and that it should be banned. They are both right and totally justified doing whatever they feel is aesthetically pleasing (ie murder) to accomplish their ends.

This is a problem to say the least.

Effectively this means that there is no such thing as right and wrong and what we are left with is shallow consensus (as opposed to a reasoned consensus) at best, and application of force at worst. Slavery becomes right, because I'm a sociopath with a gun.

Let's just say that I subjectively think that it is morally obligatory for people to accept an objective moral norm.

<comment><USER7> > Dear children, your silly worldview of objective rights and wrongs is > outdated and wrong. Morality is purely subjective, a matter of taste. I > provide no evidence or reasoning for my opinions but I do expect you to be > challenged and wowed by their far-reaching consequences.

If you think that there is some objective morality that is inherent to the universe, the burden of proof is very much on you to show that, not on me to disprove it. (But if you need a disproof, here's as close as I can get: I am 100% certain that you cannot give a definition of "morality" that both meshes with what's expected of the term _and_ that implies the existence of some fundamental objective framework for determining what's right and what's wrong. Just think about it for a while.

Or, alternatively [and not equivalently, but evocatively]: we're all just particles. You can give any brilliant argument you like about the morality of an action, and my particles are just gonna keep on doing whatever the fuck they want.)

As you discuss, lack of objective morality is _horrible_. It still makes me feel weird when I think about it, and I decided that "ethics" was bullshit when I was thirteen. My brain is hard-wired to believe that certain actions are "right" and certain actions are "wrong" in a sense that encompasses more than just my brain's response to those actions, so thinking about (what I see as) the truth about morality causes a dissonance between my conscious and my subconscious.

In the same way, my brain believes very deeply that everything has a cause, so it believes that there's a meaningful answer to the question, "Why does the universe exist?"

But that question doesn't have an answer. And objective morality doesn't exist. Sorry.

<comment><USER6> Why are you apologizing? Did you make reality this way? Are you God?! Or are you just condescending me?

 _If you think that there is some objective morality that is inherent to the universe, the burden of proof is very much on you to show that, not on me to disprove it._

I'm going to disagree with you on this point, because not only the existence of objective morality, but the existence of object truth of any kind depends on its falsity.

As you say, my brain makes certain a priori assumptions about reality. Among these, are the existence of object morality, the utility of the senses, and fundamental correctness of human reason. My belief in these are the default. If I am to doubt any of these things you must provide me with a concrete reason to do so.

All reasoning proceeds from assumptions and unless we make allowance for assumption, we must assent to solipsism (or something equally silly.) For, if we are to assume that all premises are false, unless proved otherwise, then what premises are true? People who hold the stance tend to make all sorts of assumptions that they don't realize are assumptions. Thus, I will maintain that rather than arguing from a 'nothing is true until proven' stance, that it is better to argue from a 'default brain state is true' until disproved stance.' Which, would then place the burden of proof on you.

* I am 100% certain that you cannot give a definition of "morality" that both meshes with what's expected of the term and that implies the existence of some fundamental objective framework for determining what's right and what's wrong. Just think about it for a while.*

As you state, expectations can be wrong. However, for the sake of sanity, it is better to presuppose that they are less wrong than more wrong. The people nearly universally agree that both theft and murder are wrong, that they disagree on whether lethal force is justified in defense of property can be attributed to bias of experience.

 _Or, alternatively [and not equivalently, but evocatively]: we're all just particles. You can give any brilliant argument you like about the morality of an action, and my particles are just gonna keep on doing whatever the fuck they want._

Except that I'm not a physicalist. If I were,I would already agree with you.

<comment><USER7> All right, I think I sort of screwed up my first post, because it failed to convey my most fundamental feeling about "morality": I think that the word "morality" (also "ethics") is, to a truly ridiculous extent, not well-defined.

That's why I asked you to define the word -- I can't argue about it otherwise. I really don't think there's any good definition other than, "A system of judging actions to be either 'right' or 'wrong,' such that actions that I am uncomfortable with are designated 'wrong'."

Well, there are variants of the above (change "I'm uncomfortable" to "some group of people, possibly directed by arbitrary external rules, is uncomfortable"), but the point is that I think any definition that roughly corresponds to the meaning we intuitively attribute to the word needs a lot of subjectivity in it.

As long as "morality" stays undefined, I obviously can't refute your premise that objective morality exists. I mean, it's your fucking premise.

<comment><USER6> _I think that the word "morality" (also "ethics") is, to a truly ridiculous extent, not well-defined._

Or rather, people are dreadfully inconsistent about what they call morality. I can give you a definition of ethics, morality is trickier so I may be able to only summarize a few points.

Ethics is a system of determining _right action_ for individuals and groups of individuals from a set of commonly held values. For example: if equity is a value, then preferential treatment becomes a wrong. Ethics works by finding common values and working from them. The fact that value is subjective has no bearing; ethical systems merely look for a common denominator and work from there. Different ethical systems are the product of applying different philosophical methodologies to different values sets.

Morality is very different. It is the object of the assumption that there is a universal set of rules and values to which all human beings must, for some reason or other, assent. What this universal code consists of, isn't necessarily universally accepted, but what is universally accepted, or nearly so, is the assumption that there is a universal code. That a physicalist, or mechanistic account of the universe cannot account for this is evident. That very few human beings actually accept a physicalist or mechanistic worldview, even if they claim to do so, is also evident. It presupposes some kind of telos, or universal purpose.

So what morality is, is this: an objective standard of behavior that is (instinctualy) assumed by everybody, agreed (in total; the vast majority hold a large number of principles in common and differ only on application, hence the need for ethics) upon by few, and can only be fully accounted for by some kind of metaphysics.

Edit: spelling and word usage

</comment></comment></comment></comment></comment><comment><USER8> Am I missing something or does this have nothing to do with "new atheism"?

"It challenges the new atheists, who see themselves involved in a war of reason against faith and who have an unwarranted faith in the power of pure reason and in the purity of their own reasoning."

It seems to me that the position of "new atheists" is that science is the only (known) universal means of answering the questions that it is capable of answering. The contents of the article (though not scientific) have been shaped by scientific insights. Doesn't it sort of back up the idea that we can do morality without god? if anything, wouldn't that give the "new" atheists some backing?

<comment><USER9> Sam Harris covered this stuff in The End of Faith. It's depressing how few critics of "new atheists" have read the people they have beef with; then again, it's even more depressing how few atheists make successful communication a priority.

<comment><USER10> They don't have to proselytize.

<comment><USER9> True, the income and security brought in by followers is a powerful incentive. Whereas if you communicate clearly about atheism all you get is fewer people hating you for no damn reason.

<comment><USER10> I am glad that I live in a country more tolerant to atheism. Berlin has even been described as the world capital of atheism in the Economist.

"[The former chancellor of Germany, Schroder,] did not add the optional phrase So wahr mir Gott helfe ('so help me God') when sworn in as chancellor for his first term in 1998." (<http://en.wikipedia.org/wiki/Gerhard_Schr%C3%B6der>)

</comment></comment></comment></comment></comment><comment><USER11> _"Think of what happens when you put a new food into your mouth. You don't have to decide if it's disgusting. You just know. You don't have to decide if a landscape is beautiful. You just know."_

Speak for yourself, Brooks. Apparently he was the kind of kid who put ketchup on everything and never really grew out of it.

</comment><comment><USER12> I was thinking this sounded familiar and then I realized the main source, Jonathan Haidt, did a similar TEDTalk on the roots of liberal and conservative morality. I thought it was pretty interesting:

[http://www.ted.com/index.php/talks/jonathan_haidt_on_the_mor...](http://www.ted.com/index.php/talks/jonathan_haidt_on_the_moral_mind.html)

</comment><comment><USER13> I don't agree with his premise that people can't use reason to come to good moral principles, and then act on them.

Figuring out morality his way--by emotion--would be abdicating your power to make positive change and leaving everything to random influences upon your life. A woman was mean to me as a kid? Well, I'll hate women. Everyone I know goes to church, and I have come to love Jesus? Well, that must be the right answer, then. That's what happens if you go by emotion.

<comment><USER14> On the other hand, you're an evolved being with innate biases. There are solid natural reasons that most people share similar moral intuitions (read: emotions). If these intuitions did not exist, there would be no axioms from which to deduce other moral actions.

Brooks' premise is naturalistic, that man is more complex than an avatar of pure reason. I think he's right.

<comment><USER8> He just messes up and shows his ignorance/stupidity when he tries to say that "man is more complex then an avatar of pure reason" implies "the processes by which man was created are more than is understandable by pure reason". believe what you want but thats a shoddy piece of reasoning.

<comment><USER6> Strictly speaking, everything is more than is understandable by pure reason.

<comment><USER15> How so? Isn't it just a matter of having enough "reasoning power" and information? What do "everything" and "understandable" mean in this sentence?</comment></comment></comment></comment></comment>


Edward Tufte on iPhone Visual Design - <AUTHOR> http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=00036T

<comment><USER2> "To clarify, add detail".

If only more app designers used the style of analysis that Tufte demonstrates in the article to critique their own "chartoon" interfaces.

His key insight is that apps can really benefit by removing user interface clutter (appearance/disappearance through user context, low contrast colours or "intuitive" gestural controls), maximising usable information density (color, texture, images, text, zebra-striping all targeted at conveying information, not simply design) either in breadth of scope or detail for a smaller number of items.

I've been a bit disappointed in the current crop of iPhone designs since I saw this presentation last year. They don't need the Tufte aesthetic or sparklines, all they should be is not cartoony, information-lite, or _ugly_ apps.

I'm interested in recommendations for tight, good design in recent iPhone apps. Are there any good candidates?

<comment><USER3> Ego: <http://ego-app.com/>

<comment><USER2> I took a look, but ... um all I see from the brochureware site is a cartoony interface with low information density, no history or trending (surely that's interesting for your egotistical users?).

Without installing it, it looks like all the other poorly-designed apps out there.

</comment></comment></comment><comment><USER4> The thing with sparklines is that, while curves seem to hold a certain fascination with a lot of people, I just don't see all that much utility in them, certainly not in my iPhone usage. For stock prices I consider curves less than useful, since it's natural but generally foolish to want to extrapolate from them. For temperature, I may want the highs and lows and perhaps a general trend (derivative), but a sparkline offers only a very low- fidelity version of that information.

</comment><comment><USER5> Tufte makes many good insights, but I always struggle to get over the incredible ego in his presentations. He has a tendency to make sweeping aesthetic judgments based upon what, in my opinion, are simply his personal tastes, which he then passes off as arguments about "information density."

Many of the interfaces he criticizes for being "cartoony" are quite reasonably designed for the typical end-user, and probably more effective at communicating the basic information. People typically use the Weather app to find out what the temperature is outside right now. Adding "detail to clarify" is not helpful when no clarification is needed. It's 62 degrees out. Got it. We're done.

Similarly, I highly doubt many people are using the Stocks app on an iPhone to attempt to analyze thousands of points worth of historical data.

It also bears considering that many of the freebie apps bundled with the iPhone have a design goal of _helping to sell iPhones._</comment>


2021 Ford Mustang Mach-E SUV - <AUTHOR> https://www.ford.com/suvs/mach-e/2021/ <comment><USER2> Looks to be similar specs and price to Model Y. It will be interesting to see if the Ford dealer network really embraces and markets this.

Seeing them officially launch Mach-E does make the electric truck going from demo to reality much more believable ( [https://www.teslarati.com/ford-f-150-ev-1-million-lb-tow- dem...](https://www.teslarati.com/ford-f-150-ev-1-million-lb-tow-demo- explained/) ).

<comment><USER3> > _Looks to be similar specs and price to Model Y_

I'm not going to hold my breath regarding _any_ specs until this thing is the showrooms. Another thing Tesla pioneered, and evidenced on this page, are advertising car specs as "targets". Hopes and dreams are irrelevant on the road.</comment></comment>


Global pool of IPv4 addresses set to run dry in weeks - <AUTHOR> http://arstechnica.com/tech-policy/news/2010/12/global-pool-of-ipv4-addresses-set-to-run-dry-in-weeks.ars?utm_source=rss&utm_medium=rss&utm_campaign=rss <comment><USER2> This comes into my mind: "When there's no more room in hell, the dead will walk the earth." :)</comment>


What happened to the Dinosaurs? - <AUTHOR> https://www.google.com/search?q=what%20happened%20to%20the%20dinosaurs

<comment><AUTHOR> Knowledge graph fail :(</comment>


Swimming in a Nuclear Fuel Rod Pool - <AUTHOR> https://what-if.xkcd.com/29/

<comment><USER2> This is not reddit, stop with the reposts</comment>


Show HN: Simple Social Reading and Writing App - <AUTHOR> https://plottio.com/

<comment><USER2> This is an interesting site. I assume the social part consists of liking and sharing?

It would be great to have additional description on how to navigate the page: For instance, how are editorials different than the front page? The first two editorials describe the Plottio release - maybe it would be useful to separate these descriptions out into a new "about/FAQ" section?

</comment><comment><USER3> It seems that there is a need for social writing. Twitter is too limiting for that in terms of the number of characters. Good simplistic design, the layout however has is a bit restraining, could be improved

</comment><comment><USER4> Add some description on the front page, however the articles are really nice.

</comment><comment><USER5> Nice and clean editor.</comment>


Munich Switching to Windows from Linux - <AUTHOR> http://news.softpedia.com/news/Munich-Switching-to-Windows-from-Linux-Is-Proof-that-Microsoft-Is-Still-an-Evil-Company-455510.shtml

<comment><USER2> Maybe.</comment>


Google News spammed with drug spam, dating sites and more - <AUTHOR> http://searchengineland.com/google-news-spammed-drug-spam-dating-sites-276832 <comment><AUTHOR> In the article Google claims they have fixed the problem, but Google News Canada is still filled with viagra spam in the health section

[https://news.google.com/news/headlines/section/topic/HEALTH....](https://news.google.com/news/headlines/section/topic/HEALTH.en_ca/Health?ned=ca&hl=en- CA)</comment>


Ask HN: What Theory, Phenomenon or Idea Blows Your Mind When You Think About It? - <AUTHOR> <comment><USER2> Butterfly effect, and as a result of it the theory that whatever we do is the result of chemical reactions happening inside of us. That means a person's behavior can be simulated given all of his state variables, which may be millions in number. So basically, nothing is random; everything in this universe can be predicted.

</comment><comment><USER3> Here's a recent AskReddit thread on same lines

[https://www.reddit.com/r/AskReddit/comments/779sy4/what_theo...](https://www.reddit.com/r/AskReddit/comments/779sy4/what_theory_phenomenon_or_idea_blows_your_mind/)

</comment><comment><USER4> Bell's theorem.

[https://en.wikipedia.org/wiki/Bell%27s_theorem](https://en.wikipedia.org/wiki/Bell%27s_theorem)

</comment><comment><USER5> Darwin's Theory of Evolution by Natural Selection.</comment>


Number 1 Virtual Reality Number 2 Experience - <AUTHOR> http://www.poopvr.biz/ <comment><USER2> It's as if you're right there!

</comment><comment><USER3> this is amazing</comment>


A rant on Puppet - <AUTHOR> https://medium.com/@keymone/disconsolate-puppeteering-3e22b468b1d4 <comment><USER2> > Configuration management was a new field and major competitors at the time > were (and still are) Puppet and Chef.

No, it was a field dozen years old already. And major competitor was (is) also CFEngine, though they suck heavily at marketing, so they're usually omitted by operationally undertrained people.

> Ruby is a beautiful language. [...] The Puppet language on the other hand is > gross.

If we talk about persoanl opinions, I call it the reverse. Puppet is OK and Ruby is atrocious.

> It almost seems as if [Puppet language] was deliberately designed to be > removed from its Ruby roots.

So first you believe declarative tool fits better than imperative (stated earlier in the rant), but now you complain that Puppet moved in different direction than Ruby? Make your mind already.

> [...] calling Puppet functional is a major insult to most other functional > languages out there.

Calling Puppet's language _functional_ is a major insult to caller's knowledge about programming languages. It's _declarative_ , and it's _not even a programming language_ , it was not meant to be Turing-complete.

> Building a functional language without builtin support for closures and > adequate syntactic- or library-provided functional primitives like map, > reduce, filter, etc is just plain bad.

What made you think it's a programming language? It's not.

\---

The rest of the rant is a list of actually valid problems. From what I know, most of these don't occur in CFEngine, which also uses simpler architecture in typical deployment (agents are more autonomous, not tied as much to their master as in non-masterless Puppet).

<comment><AUTHOR> > No, it was a field dozen years old already

valid point, what i meant was that it was new field to me. fixed it, thanks.

> first you believe declarative tool fits better than imperative ... but now > you complain that Puppet moved in different direction than Ruby? Make your > mind already

where do i even begin.. a) i was talking about functional/declarative approach, not tool; b) ruby is much more mature, coherent and pleasant language to work with - working hard to move in opposite direction is what i'm complaining about; c) while being very much imerative/oo, ruby still beats puppet in being functional and declarative.

> Calling Puppet's language functional is a major insult to caller's knowledge > about programming languages. It's declarative, and it's not even a > programming language, it was not meant to be Turing-complete.

what it was or wasn't meant to be i'll leave for your imagination, i'm concerned with what it _is_ in practice. name me one feature of declarative puppet language that definitively rules out possibility to classify it as functional language?

> What made you think it's a programming language? It's not

i could go this way: have i used the word "programming" even once? but this is probably more efficient way to settle the issue:

> The Puppet language is more declarative/functional in its style than > imperative/object-oriented, and is more likely to evolve in the functional > direction instead of becoming more imperative and operating on mutable > objects. - Henrik L

<comment><USER3> > name me one feature of declarative puppet language that definitively rules > out possibility to classify it as functional language?

Out of order operations? IIRC puppet is free to reorder operations, and thus you need to explicitly declare any dependencies between operations, and the runtime has a solver to decide what order is appropriate.

But it's kind of a silly dichtomy. Your article screams "I wish I had used Chef." It's technically a functional language, but looks very declarative:

      acme_certificate site do
        crt     "/etc/apache2/ssl/#{site}.crt"
        key     "/etc/apache2/ssl/#{site}.key"
        chain   "/etc/apache2/ssl/#{site}.pem"
        wwwroot '/var/www/website'
      end

There's two general options for creating a DSL: define a formal grammar (Puppet) or extend an existing one to needs (ruby+chef). The latter gives you easy access to a community of existing developers, but ties you heavily to the language and runtime you extended. A formal grammar is more work to create, and more work to learn, but allows for multiple implemenations in languages and runtimes other than Ruby.

When you're courting the likes of Apple, Google, and Facebook, suddenly the scalability of the solution matters. Chef Server is in Erlang, which is neat, but chef-client will basically always be a slow ruby app.</comment></comment></comment>