Hacker Newsnew | past | comments | ask | show | jobs | submit | themckman's commentslogin

If you’re looking for a service manager written in a lisp, there’s always GNU Shepherd. Written in and configured with Guile scheme.


For those interested, some of the underlying libraries that make up Docker for Mac (and, I think, Windows) are written in OCaml (or have components written in OCaml): VPNKit[0], DataKit[1] and HyperKit[2] (qcow2 support is implemented in OCaml).

0: https://github.com/moby/vpnkit

1: https://github.com/moby/datakit

2: https://github.com/moby/hyperkit



To be fair, GitHub attributes 1.5% of hyperkit’s code to ocaml


The 1.5% that's in the hyperkit repo is the shim to the Mirage block layer. The qcow2 implementation that's normally linked in is from https://github.com/mirage/ocaml-qcow .


That's a great question and one that I've struggled with myself. Best I can do is tell you to find a guitarist who you respect and appears to play without effort, find videos of them playing and try to emulate what they do. Practice with a metronome at very slow speeds and really focus on the motions and positioning required as you move from note to note and string to string. Arpeggios work really well for this type of practice because they're going to require you to hybrid pick and sweep to play them really fast.


rip


Yeah, I was on phone so I did not explain. The characters are made to be leaning forward, so the hitboxes are very wide. When they jump, they remain as is. Hence, when you can clearly make the jump, you still "hit".


> Apparently, every computer science problem has easy to understand solution that’s easy to implement but awfully slow in practice.

I have been doing some data structures/algorithms review as I haven't really used much of that knowledge from my CS degree and, frankly, wasn't that great of a student when I was learning it. I've obviously focused mostly on understanding theoretical performance (Big-O) as I've been implementing and playing with things, but I'd like to know about good resources for things to consider about performance on real systems. I hear about things like cache misses, memory layouts and branch mispredictions, but don't really know how to apply that knowledge or, maybe more importantly, measure the effects of optimizing for some of those things over others. I'd appreciate any advice anyone has to offer.


That Big-O thing is mostly theoretical. Most useful application is job interviews.

It might stop you from doing some things, like bubble-sorting 1GB datasets, or inserting many elements to the start of a large array.

However, in other cases it’s just fine to bubble-sort (for very small collections), or insert many elements to the start of the array (when you’re reading much more often so the profit from memory locality while reading outweigh the losses from relocating those elements while inserting).

Modern hardware is extremely complex. No amount of knowledge will help you to 100% predict the performance effects of your changes. Two advices.

(1) Learn to profile your code. Both externally, using a sampling profiler that will tell you where’re you spending the CPU time, and internally using e.g. std::chrono::high_resolution_clock that will tell you the performance effect of your changes.

(2) Don’t forget about rollback feature of your version control, and don’t hesitate using that as necessary. I routinely discover some of my changes I viewed as performance optimizations actually decreased performance. The reasons include branch misprediction, compiler optimization issues, cores competition for L3 cache, RAM bandwidth, thermal issues…


For a dose of real-world big-O I recommend following http://accidentallyquadratic.tumblr.com


I don’t think engineers working at Ericsson and Apple (the companies listed in the copyright section of that source file) forgot about big-O. What I think happened, when they wrote that, their assumption was people won’t be using those to pass 16MB blobs. And for small messages, O(n^2) works just fine.

I can understand those people. HTTP is better than Web Sockets for large chunks of data. With HTTP, servers and proxies may cache, clients may resume downloads, clients may check for changes with if-modified-since header, and so on.

The problem here isn’t with big-O, it’s with changing world.

If in the future someone will send gigabytes in that event, the current version will break despite O(n), because RAM is finite. Relatively easy to fix, you just need to save data to a hard drive instead or RAM.

Does it mean it’s a good idea to do so now? Don’t think so, it would be over-engineering and premature optimization, and the current version is currently fine. Just like the original O(n^2) code was fine for small messages.


One thing I've noticed recently at SEA is that there appears to be some sort of privatized PreCheck. I've had some guy come around with brochures for the company offering minimal lines/waiting to get through security if you signup for whatever the program is. Unfortunately, I'm having a hard time finding the company online.


These guys https://www.clearme.com/ ? Seems weird to me, and quite expensive for what they offer...


I presume this is because you actually click the trackpad rather than turn on tap-to-click. Gotta turn on that tap-to-click. It doesn't take too long for my wrist to start hurting whenever I used someone's MB without tap to click.


tap to click sometimes isn't accurate enough, especially when it comes to copying and pasting. Also the force click thing.


> assured doom

This part of your statement is actually a little bit of the problem here, too. Can you define more clearly what you mean by this?

I'm very interested in exploring the issue better, but having to constantly sift through piles of hyperbole from both sides, it makes it very hard to remain interested.

My trivial understanding of everything goes: greenhouse gasses cause warming and we're the primary source of their increase in the past century so, therefore, we're causing the planet to warm. That's easy enough to understand. But after that, I find that I'm either an idiot because, duh, its all a hoax or that our species will be extinct tomorrow if I don't do something yesterday.

It's incredibly tedious to try and gain a better understanding of everything.


I'd like to answer, but you didn't ask an actual question, so i'll take a blind stab.

Short version: CO2 causes general warming. Ice caps on the pole are necessary to keep the planet cool by reflecting a lot of the incoming light. General warming will cause ice caps to melt, which causes more energy from the sun to be absorbed, which causes even faster warming. Permafrost areas will also thaw, releasing CO2 and methane, resulting in even more warming. Strong heat increases can damage rain forests, reducing the CO2 absorption, also speeding up warming. Result: Best case scenario: Loss of coastal regions to sea rise. Worst case scenario: Earth becomes a second Venus.

Edit: To downvoters: If i got facts wrong, please do correct me. The above is my understanding of the sitation and i may have gotten some wrong.


> > assured doom

> This part of your statement is actually a little bit of the problem here, too. Can you define more clearly what you mean by this?

That was my question. I appreciate your summary of the situation and I think your worst case assessment answers my question. Unfortunately, there's an incredibly huge gap between "loss of coastal regions" and "Earth becomes a second Venus". One situation sounds highly surmountable while the other sounds like the certain extinction of our species. When you use phrases like "assured doom", I tend to think of outcomes more like the latter and I find that type of rhetoric almost as unhelpful as denying the whole situation. It just doesn't help anyone.

I apologize for picking on you specifically, you're just the first one to express this kind of sentiment I came across.


Unfortunately, there's an incredibly huge gap between "loss of coastal regions" and "Earth becomes a second Venus"

And you are basing this on what, exactly? Because the answer right now to that question is "we don't know how huge that gap is". And we do not have a second Earth to test your theories on. Are you really willing to take the risk of assured doom based on your belief that "the gap between now and assured doom is incredibly huge"?

Here's the thing with dynamic equilibrium: it is only locally stable. We do not know how exactly how resilient our ecosystem or our planet is to rapid changes. Some of us are not willing to find out, because we only have a single destructive test at our disposal.


> And you are basing this on what, exactly?

I made that statement based on my limited ability to extrapolate how our species might deal with the two scenarios. It sounds much, much easier to me, while still being incredibly challenging, to deal with large population displacement versus dealing with our planet becoming entirely uninhabitable.

Now, if I understand what you're saying, it sounds like our understanding of the probabilities of the two scenarios occurring isn't exactly known. While the two scenarios, at face value, sound incredibly different (to me at least), the likelihood of one happening over the other could be very similar. I agree that we should absolutely take that position seriously and that we should absolutely do things to guard against the possible outcome where our planet becomes uninhabitable.

All that I'm asking is that we say it like that. Lets say that instead of speaking in absolutes (e.g. "its a hoax", "we're doomed"). That's all I'm taking issue with. It doesn't help the discussion no matter what side of the argument those kinds of statements come from.

> And we do not have a second Earth to test your theories on. Are you really willing to take the risk of assured doom based on your belief that "the gap between now and assured doom is incredibly huge"?

To be clear, I don't have any theories I'd like to test nor do I know what I might be willing to risk. As I said in my original comment, my understanding of everything is incredibly rudimentary and I'm trying to do a better job seeking information to help me answer questions like that.


> if I understand what you're saying, it sounds like our understanding of the probabilities of the two scenarios occurring isn't exactly known

Incorrect.

A complete planet-devastating runaway scenario is much more likely, as it requires merely that humans continue to operate as they are doing right this very moment.

The best case scenario only comes about if we get our shit together.

That's the gap that separates worst and best case: Humans change nothing <---> Humans make a supreme effort. Probabilities follow directly from the probabilities of these two things.

Sorry for not having stated that clearly.


Now, if I understand what you're saying, it sounds like our understanding of the probabilities of the two scenarios occurring isn't exactly known

No, what I'm saying is that we don't even know whether these really are two separate scenarios. We can't afford to plan for a large population displacement because by the time we get to that point, there may be nothing we can do to prevent our planet from becoming uninhabitable.


'Unfortunately, there's an incredibly huge gap between "loss of coastal regions" and "Earth becomes a second Venus"' … maybe there's not. And that's part of the problem. Psychologically people perceive differences as "linear". It's part of how our brains are wired: to go from A to B draw a mental line and try to walk it at a constant speed. The greater the difference, the longer the line, thus the longer it takes to get from A to B. Hence the "huge gap" sentiment. But climate is not a linear system. Going from A to B could be a tiny step. Or oscillating, or dampening, or all sorts of funny things. Modelling of, for example, oceanic plankton (which gives more than 50% of the atmospheric oxygen) showed that the difference between "happy ~20% oxygen in the atmosphere" to "no oxygen ever again" is a small temperature change [1,2]. Non-linear systems are very hard. But they are fact, not fiction. That one last metric ton of CO2 could really be the difference between "life as usual" and "goodbye complex life on Earth". Communicating that fact is unfortunately even harder. Because people cannot perceive these changes, they're stuck in the linear mindset. And this worries me, because when we realize we need to really do something it's probably already far too late. If it isn't already (but in that case, science won't matter…I'd rather turn the page to "existential philosophy in the face of extinction").

To me it seems like simple risk management, even with a small probability the loss would be near infinite, whereas the loss of "doing something" is probably negligible. (carbon tax, energy transition, discouraging procreation, anti-consumerist lifestyle … probably all beneficial for humanity from a birds-eye view)

[1] http://www.wolfandwildlifestudies.com/downloads/oxygendeplet...

[2] https://link.springer.com/article/10.1007/s11538-015-0126-0


In a way i can understand you, in another way: Consider what "the entirety of Florida, New York and California is forced to move inland" will mean in practice. Then consider what the same would mean for less affluent countries.


I was kind of hoping it would be an article about all the Lisps and Schemes.


That would bring out of the woodwork all the people who disagree that the lisps and schemes have a common syntax as well as all the people who disagree that lisps have a syntax at all.


> People should be rewarded for doing good things, and given disincentives for doing bad things. That's a powerful concept and I think the world would be a better place if people would get behind it in politics.

I remember seeing a clip from Bernie criticizing Trump after the news broke about him "saving" (there's obviously a lot to be discuss about what actually happened) the Carrier jobs, basically saying, American companies should want to keep their jobs in America because it is the right thing to do. After hearing that, I remember thinking to myself, "Yeah, you know, sure. You're right Bernie. Companies should want to do that because it's the American thing to do, but why is it such a bad idea to give companies incentive to stay?" And for the most part, I believe that's what Trump has been talking about with regards to keeping jobs in the US. It sounds to me that he is just trying to make it more expensive for companies to move their jobs overseas than to keep them here by the way of this import tariff he keeps touting. Now, of course, I have no idea how any of this plays out and turns into actual law, but the basic idea makes sense to me.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: