News for hackers. Stuff that matters.
Re:Ask HN: Why Are Conditionals Important? by tlb on Monday August 19, 2019 @02:32PM (#20740396)
There are styles of programming with no conditionals, especially in purely functional languages.

A common technique inside compilers is to separate out which code gets run, and which result gets used. If everything is side-effect-free, then there's no harm in running the code whose result won't get used. In highly parallel systems, you can just run both versions and select at the end. So you can rewrite:

  if foo < 2:
    a = foo
  else
    a = 2
to:

  a = phi(foo<2, 2, foo)
(the phi operator is taken from SSA notation. See https://llvm.org/docs/LangRef.html#phi-instruction if you're unfamiliar)
Re:Ask HN: Why Are Conditionals Important? by 2_listerine_pls on Monday August 19, 2019 @09:23PM (#20743113)
I don't need to understand that code to tell you there is a control flow mechanism somewhere using a condition.