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

For pines, not great. Timber farming was so heavily encourage for so many years that there is a glut and prices have stayed about the same in real dollars for decades.

Solar panel leases are so long (50 years on top of the decade to interconnect), so they come with additional negatives as you are often signing up the next generation for a relationship that they had no say in.


> This question may be naive, but why is the agricultural industry so subsidized?

I believe this is the same tune we hear in other industries: it’s the effect of the consolidation of companies which provide the inputs (seed and chemicals) leading to a lack of competition and the increase in prices on a captive consumer base.

When farmers feel the crunch due to macro forces in the market (and tariffs), the government effectively acts as a backstop for the conglomerates providing the inputs. Think of the farmer’s hand as an open palm, the subsidy flows through it directly to the company to which they are indebted (“the money is in the ground” as I used to hear during a brief time in crop insurance).

While these subsidies may have initially began with the quaint notion of protecting against scarcity (as many sibling replies seem to believe), the reality is that farmers are being squeezed just as the rest of us. Profits are way up while competition is way down.


When I was a young urbanite, I might not have believed you if you told me that one day I would gain great pleasure in discovering large blooms of Dog vomit slime mold in the garden, but here we are.

Slime molds are really amazing; large patches spring up overnight and they are so vibrant in color.


One little appreciated fact is that trees also respirate CO2 when they are cracking their stored sugars produced via photosynthesis. So they don’t sequester all of the CO2 that they consume.


It's little appreciated since tree growth still consumes CO2


I suppose I’m pointing it out to highlight the trade offs with any of these solutions.

What is unsaid is that we need to sequester CO2 for hundreds of years—often far beyond the lifespan of the trees. Trees are short term storage, and sometimes the storage is a lot shorter than popular imagination purports.


Individual trees are short term storage which is why its important to create healthy ecosystems for them to live in. Turning denuded farmland back into a forest buffers carbon from the atmosphere for as long as the forest stands. It could stay there for centuries or return to the atmosphere if it gets bulldozed for a subdivision.


The main commercial use is enhanced oil recovery—shooting it into old wells to extract more oil (super ironic if captured from the air).

One application I think is neat is that it’s a pretty robust refrigerant in a heat pump application.


The gp's comment wasn't made regarding the look of the operator in its ascii representation `|>` but about the vertical misalignment.

Typically you align a pipeline like so:

     df
     |> rbind(other_df)
     |> select(...)
But these topics are largely left to code formatters these days.


Weird, I have always aligned as the gp showed. I’m reasonably sure tidyverse documentation does the same (which is probably where we both picked it up from).


One neat thing about the referenced chapter on macros from Practical Common Lisp is that it's chapters 7 and 8 of a 30+ chapter book. You're only learning about variables in the chapter before and then macros. I like to think about that when conversations about macros always devolve into talking about how you should never use macros.

Now apologies for the aside—and I know I'm likely wading into a very expansive topic and reducing it down to something simple—but why in Rust, if the types are known:

    struct Song {
      title: String,
      artist: String,
      rating: i64,
    }
do you have to call `.to_string()` on things that look a lot like strings already?

    Song::new("Hate Me".to_string(), "Blue October".to_string(), 9)
Couldn't the compiler just do that for you?


Because to_string allocates. And if a function requires a String (owned), it cannot accept a str reference (borrowed), it would defeat the purpose of the strong type system. String is moved, while str is passed by reference.

There is the exception of Deref. If the function requires type A, and you pass it type B, which Derefs into type A, the compiler will Deref it for you. But that is zero cost and panic free, whereas allocating (and copying) an owned type from a reference isn't. In Rust you have to be explicit.

Anyway, using String in function signatures is most often not the best choice. If you will internally be required to use a String, it's better to ask for a type "impl Into<String>", you'd call into() inside your function. And in the most common case, where you require a &str or can convert to your type from it, the best choice is an "impl AsRef<str>" and you can call as_ref() on it to get a str reference, which you can wrap in a Box, Rc, Arc, String, or your custom type, or pass it directly to other functions. All of those, Box<str>, Rc<str>, etc implement both traits.

Using impl Trait, you avoid having to declare generic parameters.


If only one could construct a macro to solve the boilerplate of AsRef<str> etc ;)


To me, there’s not much difference between:

  fn foo(name: &str) {}
and*:

  fn foo(name: impl AsRef<str>) {}


They’re different kinds of strings, the String string means heap allocation, and Rust never allocates in the language, so the compiler automatically invoking allocation routines for you wouldn’t be good, in Rust’s view.


Those "things that look at a lot like strings already" are literals and thus constants, with the type `&'static str` which is how Rust spells an immutable reference to a string slice which lives forever. So, Rust is promising that the string slices "Hate Me" and "Blue October" exist, and in practice probably if you look inside the resulting executable it says "Hate MeBlue October" or similar.

On the other hand the String type is a growable array of bytes used to assemble strings, it's an owning type, so Song will own those two Strings, they can't go away or be altered via some other force. Owning a string would allow you to add to it, change it, or discard it entirely, you obviously can't do that to the text baked into the executable, so if you want to own a String it will have to be allocated at runtime.

You can also write "Some Words".to_owned() for example to the same effect.


To expand on the sibling comments, this is why Rust doesn't do implicit type conversions that could allocate:

https://groups.google.com/a/chromium.org/g/chromium-dev/c/EU...


To be fair, as much as Rust macros are nice, it is a losing battle to go up against the Lisp macro system. Lisp might have its flaws, but macros in Lisp are second to none.

When to use them is a whole different story. But examples of macros I like are `when` and `unless`. Yes, simple, but they show a nice example of their power.

For more complicated once, love it or hate it, but the `loop` macro is probably THE prime example of a powerful macro.


When you have a &str (like "Blue October") and pass it to something that wants a String, you can do .into() instead of .to_string()

It’s shorter to write and takes up a little less space on screen to. I almost always use .into() when like in your example I initialize String field members of a struct in Rust.


That's the price you pay for a low level language where things like memory usage are visible for you to optimize.

If you don't see the gain, maybe Rust is not the right language for your use-case.


the reasons to not use macros have to do with hygeinicity? -- macros can do things like introduce code that is hard to understand, perhaps a dynamically named function, or a difficult to chase dependency or import... moreover these can make grepping harder.


I often think of Thoreau when my mind drifts to romanticizing farming:

> I see young men, my townsmen, whose misfortune it is to have inherited farms, houses, barns, cattle, and farming tools; for these are more easily acquired than got rid of. Better if they had been born in the open pasture and suckled by a wolf, that they might have seen with clearer eyes what field they were called to labor in. Who made them serfs of the soil? Why should they eat their sixty acres, when man is condemned to eat only his peck of dirt? Why should they begin digging their graves as soon as they are born?


They need to bring back the control strip!

https://en.m.wikipedia.org/wiki/Control_Strip

Solves this exact issue.


It was great, but they had to quietly retire it when somebody pointed out it looked like a dick.


So you don't have to go through the factory reset if you are fine with having the app store? Safari is the only app I need to excise, and the OS won't let me delete it.


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

Search: