For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | more ZephyrP's commentsregister

Very neat. Do you implement option parsing in "magic getopt" or can you (somehow?) handle setting up the option string arguments used by the more familiar variants in getopt(3)?


All the option parsing is done in functions called by the macros. The "getopt string" isn't needed since the GETOPT_OPT() and GETOPT_OPTARG() "case statements" convey the same information (the set of valid options).


Having a slew of physical theories with profound existential ramifications to choose from, why do you think the "many-worlds interpretation" is particularly connected to secularization?


I portrayed it as part of the general trend, not specially connected.


I worked as a framer with my dad for around 4 years in the mid 2000s. We framed small residential homes in southern Colorado and although we would always carry a hammer on our belt to "align" a stud, bend flashing and drive in nails that hit a knot; nail guns hooked up to a shared compressor was how nearly everything got, well, nailed together.


I got the same result as you, but in my mind the expression "twice as likely to purchase" could just as easily have meant P(C) = 2 * P(D) / 1 + P(D) (yielding 0.35824) rather than 2 * P(C) (yielding 0.32841).


I calculated a similar maximum horsepower to your own estimation (6.1 hp) when I used the average direct solar radiation (164 W m^2 @ 27 m^2 surface). This rose to 41 hp when using values for "a typical cloudless day at solar zenith" (1120 W m^2) [1]. The wattage will square when doubling each side, so if you were to double each length of the surface, you'd be up to 151 extremely hypothetical hp - just like the Honda Insight!

Back on planet earth, the most common solar panels have efficiencies between 15-20% [2]. Direct radiation is diminished by the cosine of the angle of solar tilt. It takes another ~2 hp to overcome drag at just 30mph [3]. Who knows how much this setup would weigh. You'd have to be Speed Racer's long-lost brother in Arizona to win a mid-summer dead-heat race at noon with a go-cart.

[1] https://www.newport.com/t/introduction-to-solar-radiation

[2] https://css.umich.edu/factsheets/photovoltaic-energy-factshe...

[3] https://web.archive.org/web/20190616063447/http://phors.loco...


In addition to fiction, qntm is a sharp, versatile programmer. greenery [1], their unobtrusive and generally tasteful python library for manipulating regular expressions, is also accompanied by high-quality technical writing on related topics [2] [3] [4] [5].

[1] https://github.com/qntm/greenery

[2] https://qntm.org/greenery

[3] https://qntm.org/lego

[4] https://qntm.org/plants

[5] https://qntm.org/fsm


> Manifestly, recursion is never strictly necessary, and is furthermore almost always slower, or anyway no faster, than you could do maintaining state "by hand".

Recursion is required in procedures like Ackermann's Function [1]. You can still simulate or write functions that avoid the syntactic fact that the procedure definition refers (either directly or indirectly) to itself, but you'll always be papering over the fact that it cannot be implemented with a fixed number of state variables.

[1] https://en.wikipedia.org/wiki/Ackermann_function


> Recursion is required to implement non-primitive recursive procedures

This is very untrue. While loop and a stack.

> cannot be implemented with a fixed number of state variables

Of course it can't, any function outside DSPACE(O(1)) can't. The fact that you have an implicit call stack doesn't change the space complexity.


> This is very untrue. While loop and a stack.

>> You can still simulate

> any function outside DSPACE(O(1)) can't

The space complexity of the algorithm is only incidentally related to the number of unique variables required to represent it's state.

You said it best:

> The fact that you have an implicit call stack doesn't change the space complexity


As I said, and as you admit, contradicting yourself: "You can still simulate..."

We could better say that recursion is papering over a fundamental fact that the iterative form reveals. You encounter it in the recursive case, painfully, when your stack overflows. Assuming infinite memory is the fatal flaw in most modern systems.

Ackermann's function never appears in the real world.


>You encounter it in the recursive case, painfully, when your stack overflows.

People who write high performance code don't worry, because they write the recursion properly, and tail recursion doesn't use the stack.

If your understanding of recursion leads to stack overflows then you're missing a significant tool in your toolbox.

There is no more need to overflow a stack using recursion than there is to overflow a stack or heap trying to store state when unwinding a recursive function into an iterative one.

However, the recursive solution is vastly simpler in many cases since you don't have to fiddle with state, which is mutable and error prone, and can instead use immutable concepts (in any language) to write correct code more quickly with zero penalty in execution speed or space. It makes you a more valuable employee to learn these techniques.


Have you heard of this Turing fellow? He produced a result according to which a function such as Ackermann can be calculated with a read-write head moving over an unlimited tape. No recursion there.


Inconvergent (https://inconvergent.net/) is another stunning generative artist as well; their generative trees (browser version: https://zv.github.io/static/algorithmic-tree.html) are especially evocative of Fishdraw.


I know awk (well, gawk) pretty well and I still regret not having just learned perl.


Extremely knowledgeable and warm person on top of that. He's the genuine next level.


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

Search:

HN For You