HNHacker News
TopNewBestAskShowJobs

leovonl

163 karma · joined January 12, 2015

submissionscomments
leovonl··on Live slow, die old: Mounting evidence for caloric restriction in humans
There is mounting evidence that fasting and a few dietary approaches (like the ketogenic diet) are useful tools for dealing with a whole sort of issues, from autoimmune diseases and generally any excessive inflammatory responses (including CHD).

Calorie restriction OTOH is something that gives mixed results, and I suspect it may be related to the diet adopted and how it is implemented (ie, LCHF vs LFHC, fasting vs frequent small meals).

I suggest anyone interested in food/health to spend some time on google scholar searching about these approaches, it's enlightening.

leovonl··on Ask HN: What are some poorly written but very successful open source software?
If you consider:

1) Most of Linux source code is composed of drivers;

2) Most drivers for Linux have really bad quality code, with very few exceptions;

Then Linux is a perfect example.

leovonl··on Whole Foods is struggling
Different perspective: I live in Canada, next to a Whole Foods (Unionville).

If you compare prices of organic food and quality, Whole Foods is better and chair than any other place. Maybe downtown Toronto would be cheaper, but then I won't travel 35km for groceries.

The only thing I really dislike is the lack of true organic meat selection (only ABF) and they don't have things like lard.

leovonl··on H-1B visas mainly go to Indian outsourcing firms
Funny, you'd think non-immigration visas for USA would be much stricter than for Canada, but lately I've been realizing that's not the case at all. That's specially true for rules applying to the companies (like salary requirements).
leovonl··on U.S. is still the best country for immigrants
He's comparing Reading/UK and Bochum/DE with those areas in the USA. "Oh wow USA is so cosmopolitan" /facepalm

Also, he's essentially mistaking immigration and work visas.

Just the fact that he got surprised by the UK tier visa system already tells a lot. 15 minutes of reading the gov.uk website and anyone can find out if qualifications are met and what needs to be done.

leovonl··on U.S. is still the best country for immigrants
Sorry if I offend anyone, but this text is utter crap.

There's a bunch of anecdotal evidence (experience which varies a lot depending on your particular conditions), over-generalization (please, England? it's the worst visa system, of course you had trouble with them) and the text leaves me with the feeling that he didn't planned any of this.

"Now that I'm on the UK let's see how the visa goes..".

In fact, if you look at this guy's Linkedin profile, that impression really seems to match reality.

Last, but not least, USA may not that restrictive to enter in a non-immigrant high skilled visa - the same way as Canada and a lot of European countries. Immigration, OTOH, is a whole different thing.

leovonl··on Crystal vs. Node.js vs. Golang vs. Julia vs. Rust vs. LuaJIT vs. C Fibonacci Benchmark
If you compile the Rust example with optimization (-O) it just throws the result away, which gives the ~0.030 time chrisdouay found.

However, if you add a println!() around it, it has to calculate the result. Here's the running time:

    > time ./fib
    1134903170

    real    0m2.242s
    user    0m2.240s
    sys     0m0.000s
I tried the C example as well (with -O2) and found this:

    > time ./cfib
    1134903170

    real    0m4.671s
    user    0m4.670s
    sys     0m0.000s

So.. which one is faster again?

This "comparison" unfortunately seems too naïve to not be on purpose - no analysis, no real discussion, not even some reasoning about the defaults and why the big difference in numbers. It seems to be just looking for views/comments (even if negative) without any intention to produce real content. What worries me are the ones that will take this for a real benchmark and just "share on facebook" and spread more disinformation.

leovonl··on Why does a college degree cost so much?
> Why does a college degree cost so much in USA?

FTFY

Not excluding the fact that some private institutions (and even some public ones) in other contries charge a considerable tuition as well, but that usually is handled differently (fee reduction, scholarships, etc) than in the USA (long-term loans).

leovonl··on Taking PHP Seriously
The biggest issues I see with the language didn't made into this list: for instance, I can think about more serious issues like accessing the wrong variable name does not returning an error, assignment and initialization being the same (thus also suffering the same issues related to wrong names), various surprising type conversions, defaults, and so on. I guess it all boils down to the mindset of the language itself, as the article says.

However, I disagree that "other languages do not work like that thus are not as easy to test". You can implement this in any way you like in any other language. You can implement your webserver by forking a new process at every call. You can even use a worker that communicates to a different hot-swappable process. It can efficient as you want - copying the whole data around, sending file descriptors, etc. The alternatives are endless.

PHP may be "interpreted and hot-swappable" by default, but that's an accident from it's design and it only works like that - if you try to use it as a long-running process, you'll run into a lot of issues. It's also terribly inefficient - have you ever developed a web interface for an embedded platform? A really embedded one, like 32MB of memory, shared with the application itself?

I guess in the end it boils down to the duct tape analogy: it's terribly fast to prototype something with duct tape and scraps and you can join a multitude of materials in a very simple way - just put everything in place and cover with enough tape to hold it together.

Surely, it works.. but that's about it.

leovonl··on Tell HN: I think you're downplaying the PHP community
See, the thing is: I spend much of my time trying to show people that good tools can be used to make good software. We have MUCH misinformation, and people don't even understand that you can prove a software right using theorem provers, don't know anything about type system - "C has types but they don't work" - and etc. I've heard arguments like this all the time, and that really sucks, because then you get limited by tools "you can hire people to work with".

In fact, I've been hearing for 10 years things like "what, OCaml? where do we hire someone to work on this?", "Haskell? nobody uses that", and more recently "we cannot use Rust as we don't have anyone that can possibly understand this". Saying "PHP is just another language/tool" is just throwing the towel without trying to understand anything.

What would you think if someone said "coal is just another fuel, stop trying to push electric, let me use coal and go on with life"? Well, a lot of people believe this, but let's pretent there's a consensus on this, shall we?

So, the question is: you CAN use PHP for doing web development. You can also use coal as a fuel. Not only that, but all libraries are written with this in mind, all code bases and fragments of code are focused on web development, etc. Coal is also combustible, a lot of manufactures dominate the technology, it's cheap, so.. hey, energy!

Even if the language is pure crap - as coal is as a fuel - people will only hit the crappy parts when their system is already implemented and being used by more people. "Hey, this language has a lot of issues" - "hey, this coal thing really polutes". Too late. You already have a full system implemented, you have experience with the language - or energy production technology... so you just change your workflow to accommodate this. Or you just never realize it - "whatever, no big deal" - and keep using it, as you see the advantages as more important.

There's tons of factors that contribute to the PHP popularity - the same thing with C, Perl, etc. Doesn't mean the language is good, and also doesn't mean everyone has to agree with you that "it's just another tool, let's go back to business".

So yeah, no.. I won't let you go on with PHP, sorry. I want better tools, better systems, and I want to spread knowledge. I guess we are going to agree to disagree on that.

leovonl··on Is Facebook’s Massive Open Office Scaring Away Developers?
I guess the main point is balance - not everybody agrees about the exact point where it is, but everybody agrees the extremes are bad.

An isolated room in a corner is not good - though it may be useful for "development sprints". An "auditorium" shared between sales, development, marketing, and sometimes even support - people which talk on the phone all the time - is terrible.

Best productivity I ever achieved was during a time I shared a room with 2 co-workers that shared similar knowledge but worked in slightly different areas of the product line, and one was not even working in the same project as me. So we did exchange ideas, but each one was doing each one's part of the equation independently.

I considered some other opportunities before joining my current employer, and some of them were discarded due to (among other reasons) the huge open offices with 30-40+ employees on the same floor.

leovonl··on Go success stories from around the web
I don't want to disdain the success of Go, and I think the whole building of the community from the ground up is an achievement that few can say they were able to do.

However, what I dislike about all this is the generalization issues (like I saw on "Moving from Scala to Go"), which misses the point of history, and what to expect next.

First, saying "look how Go simplified our code by not allowing anything too complex" and using that example is very biased against someone that usually programs using applicative functors and don't really see anything overly complex in that code - besides some overly compacted structure which makes reading a bit hard. And that comes from someone that is not a Scala programmer, BTW.

In fact, from the "applicative functor" guys, most OO code would be deemed overly complex - and TBH with some sound arguments - but the "improved Java" camp would think that reasoning about shared mutable state is easier...

Second, the article tries to reason that it's a matter of being opinated, but it's not a matter of just being opinated: it's a matter of having that particular opinion, which means using simplified concepts without any ways to really elaborate them further, and having a more lax approach about exact semantics, types, etc. Very nice for beginners, as you don't really have much to learn, but most programmers that like it now would start hitting that expressivity ceiling soon.

Which brings me to the history part: it's funny to think that Java was born in a very similar way: no generics, tried to follow the most popular paradigm of the time as closely as possible and stay simple.. then people started using it, requesting improvements, and it became more and more complex after each release - until everyone realized that the very same thing that got everyone using it (simplicity) was not really there, as the complexity moved from the language to your code. Boilerplate over boilerplate, ever-increasing tightly-coupled frameworks, and there you go.

If I had to guess, I'd say 10 or 20 years in the future we may see the same happening with Go (if it tries to become more expressive) or it being put aside as a niche language (if it stays the same). But only time will tell it's fate.

leovonl··on On DRY and the cost of wrongful abstractions
The DRY principle issues usually apply very well to OO programming and the whole "framework" concepts, where individual libraries or pieces of the code cannot easily be reused for different projects.

Another big issue in the framework case is the inversion of control, which further restricts how the reuse can happen and makes it very hard to reuse the code differently in an efficient way.

leovonl··on Why I’m dropping Rust
I've been observing in some stronger critics about Rust a persistent focus on OO features, usually the ones that programmers tend to rely upon and which they feel to be "lacking" in Rust - usually requiring a different structure or abstraction which the programmer is not familiar with.

The issue about parent/children pointers mentioned in this article seems more a lack of understanding on the concepts of ownership and the traits system, for instance. It's indeed a harder problem to deal with in Rust if trying to apply a OO mentality, but one can find a way out if trying to understand the language first.

I have my personal thoughts about parts is Rust that could be improved; nevertheless, I don't see any issue with us excursions, and consider it an evolutionary step which brings system programming languages to a new level.

leovonl··on How Fake Money Saved Brazil (2010)
If the government spends in excess and prints money to cover the costs, that means an increase in money supply. Which leads to inflation. Indeed, the spending alone would not be a problem if it was properly managed.
leovonl··on How Fake Money Saved Brazil (2010)
Sorry, but this story gets nowhere near the real reasons for the inflation reduction.

The major and most important change on the Brazilian government to achieve this was the LRF - Lei da Responsabilidade Fiscal, "Fiscal Responsibility Law" in English (free translation).

With these law, federal, state and municipal governments, which added much more oversight and control to public spending, requiring budget increases to go through congress, forbidding "money printing" practices and also requiring detailed accounting records to be submitted to a branch of the judiciary (TCU) for approval.

I could go on and write a huge document here, there's a lot of historical questions involved too. If anyone is interested in more details please let me know.

leovonl··on Zero-cost futures in Rust
In my opinion - as someone with some background in CS - the name "future" is a little too overloaded here. It is not only used for the deferred computation of a value so much as it also means the composition of computations. This is not wrong per se, but calling the result a "future" alone oversimplifies what's happening below and hides some properties about the combinations.

The first observation one can make - which is not mentioned anywhere in the article - is that the composition of futures here can be understood as a monadic composition. This by itself gives a big hint why this interface is so powerful. Second is that this library could be understood as an implementation of process and process combination from pi-calculus [1] - sequential combination, joining, selection, etc - so it could be formalized using its process algebra.

From the practical side, one example of a mature library that implements similar concepts is the LWT [2] library for OCaml, which has the same idea of deferred computation, joining and sequencing, but calls the computations "lightweight threads". One could also argue about naming in this case, but it seem to reflect a better the idea of independent "processes" that are combined on the same address space.

Finally, as much as these concepts of futures and processes look similar on the surface, they each have their own properties - so it's always good to consider what better fits the model. By looking at the research and at other similar solutions, one can make more informed choices and have a better idea of what to expect from the implementation.

[1] http://www.cs.cmu.edu/~wing/publications/Wing02a.pdf

[2] http://ocsigen.org/lwt/manual/

leovonl··on [dead]
The UK passed a law, not the EU. Everything continues as before for Ireland, for instante.

I really dislike when articles that seem to say something serious from sources that I'd normally trust simply leave out the most important references - the EU recommendation itself, for instante. That's a huge deal breaker.

It's easy to accuse but laborious to prove it, and that's exactly why it shouldn't be left out. Together with an inaccurate title, it makes me doubt the entire article itself.

I searched this recommendation for some time, but tiredness and this 5" screen are not exactly helping. I'll get back to this on a later time.

leovonl··on A look at the 10x paradigm
Fact: everybody wants a 10x programmer but nobody wants to be a 10x manager.

Also, dealing with a skilled programmer is not just a matter of top-down policy: a 10x programmer may have a different opinion about tools and processes and will not be happy on simply conforming - as opposed to the programmer who doesn't know better.

leovonl··on Measuring Polymorphism in Python Programs [pdf]
> I wonder whether the authors consider "value = somedict.get('somekey')" or "match_object = re.search(pattern, somestring)" as returning a single type. Both of those common calls can return None.

  val get: 'a dict -> 'a -> 'b option

  val search: re -> string -> match option
Above is an hypotetical type notation in OCaml for both functions. I think it pretty much covers everything.
leovonl··on A deportation at the UK border
Funny, my experience as South American is the exact opposite: expensive USA VISA (USD 160!) for attending a conference, US border asking about everything, checking my story and even knowledge about programming (!), etc - UK border just asking the purpose of my travel, stamping the passport and saying "welcome to UK". And I didn't even need a VISA.

One thing for sure is: you have to know the visa requirements and you have to answer what they want to hear. That's true everywhere - USA included - so you're just lucky as a USA citizen to never go through the USA interview process.

leovonl··on I Don't Want to Hire You If You Can't Reverse a Binary Tree
You don't reverse a binary tree, you iterate in the opposite direction (right-to-left). Reversing is generally a pointless operation, and which would be much more efficient if not done at all.
leovonl··on The second annual F# survey
Indeed, I agree with you.

Object-orientation support on OCaml also sets it far apart from SML, for instance. Which can lead to a lengthy discussion, but that's beside the point.

This reasoning, however, is exactly my point: depending on where emphasis is placed, they can be argued to be similar or completely different languages.

leovonl··on The second annual F# survey
I find it curious how you treat F# a separate language, but in the "primary programming languages" question OCaml and SML are considered the same language (listed as "OCaml/SML").

IMHO, if you don't make a distinction between OCaml and SML languages, you should definitely not make a distiction between OCaml and F#.

I have a good experience with OCaml, and judging by most F# code I saw it seems F# and OCaml are much more similar than OCaml and SML.

Here you can see some examples comparing ML variants, which also illustrates my point a little further: http://hyperpolyglot.org/ml

leovonl··on We only hire the trendiest
“Experience is too random, with payments, mobile, data analytics, and UX.”

This one made me chuckle.

Same thing usually happens with my résumé: either one discards completely the part where I cite strong OCaml knowledge plus functional/logic programming interest and/or they discard completely the part where I mention experience with ARM PRU assembly and the fact that I ported an educational OS to MIPS during graduation.

It usually comes down to:

- "So you are a C++ programmer?"

- "Yes, I have a good experience with C++."

- "Good, we'll like to hire someone with your knowledge, we have PHP and Perl codebases to maintain and your profile seems a good fit."

- "...."

leovonl··on Stack, Heap, Pool
This code is not only non-optimal, but also inneficient.

First, it does a linear search - O(n) time - because it keeps adding null pointers for elements that are removed from each list. This makes literally no sense. Just removing the null pointer insertion would already improve the performance a lot.

Second, the multiset is also a poor choice for the available objects list, given its performance characteristics. A structure like a deque, with O(1) insertion/removal on both ends, would be much more suited for the job.

There are a few papers/presentations on memory allocation for C++ from Andrei Alexandrescu, like this one: http://nwcpp.org/talks/2008/memory-allocation.screen.pdf

I'd suggest giving them a read, they give some good insights about simple yet very powerful techniques for improving memory allocation with little code.

leovonl··on Travelling to work 'is work', European court rules
Clickbait title.
leovonl··on New electric engine improves safety of light aircraft
Your analogy misses the point that a fallback mechanism is needed in the rare cases where something unexpected happens.

Even in cases where you have everything formally defined, you could still have some axiom not holding, or a transient hardware issue - a random bit flipping in memory for instance.

Putting simply, everything fails eventually, the question is not "if" but "when".

leovonl··on Four MLs (and a Python)
1) It's not a constant expression, it's a function call.

2) The compiler does not know if there are collateral effects or not.

3) Ocaml is strict eval - no memoisation

Therefore this would be an unsafe optimisation if the compiler tried to perform it, which could lead to unintended behavioural changes.

The only way to fix this properly would be to add an effects system in some sense, at least a way to mark pure/impure functions.

leovonl··on Four MLs (and a Python)
Your OCaml code is not doing the same thing as the Python one: you are parsing a regexp in a loop, and then splitting by the regexp - not by a delimiter.

I moved the regexp instantiation outside the loop, see the results below ("orig" is your code, "proper" has the regexp parsed only once):

  > bash -c 'time ./orig bigdata.csv'
  15502592020.,15502065537.6,15519223046.6,15498884970.,15502078298.,15519530367.3,15510803256.2,15519590717.2,15511590976.

  real    0m3.110s
  user    0m3.107s
  sys     0m0.003s

  > bash -c 'time ./proper bigdata.csv'
  15502592020.,15502065537.6,15519223046.6,15498884970.,15502078298.,15519530367.3,15510803256.2,15519590717.2,15511590976.

  real    0m2.596s
  user    0m2.590s
  sys     0m0.003s
I'd say the rest of the difference is probably due to the standard library performance itself. BTW, compilation time for ocamlopt is 70ms.
← PreviousPage 2 of 3Next →