Pipoca
@Pipoca@lemmy.world
- Comment on Not hiding it 9 months ago:
The fathers of 44% of Israel were born in Israel. I doubt they have dual citizenship, just as most Americans don’t have dual citizenship to their grandparents and great grandparents countries of origin.
Also, most Mizrahim and Sephardim these days are living in Israel, similarly to how most Ashkenazim are in the US. Even if an Israeli somehow has e.g. Iraqi, Iranian or Yemeni citizenship, moving back probably isn’t a safe idea. Morocco is probably safer, though.
After the fall of the USSR, there was also a huge wave of Russian emigration to Israel. Given conscription for the war in Ukraine, moving back now might not be the best idea.
- Comment on xkcd #2896: Crossword Constructors 10 months ago:
Crosswords have clues going across and down.
The words just use common letters so they’re things puzzle creators wish were real words. They’re not currently words.
- Comment on Strings do too many things 10 months ago:
Symbols display with friendly string-y names in a number of languages. Clojure, for example, has a symbol type.
And a number of languages display friendly strings for enemy things - Scala, Haskell, and Rust spring to mind.
The problem with strings over enums with a nice debugging display is that the string type is too wide. Strings don’t tell you what values are valid, strings don’t catch typos at compile time, and they’re murder when refactoring.
The other problem the article mentions is strings over a proper struct/adt/class hierarchy is that strings don’t really have any structure to them. Concatenation strings is brittle compared to building up an AST then rendering it at the end.
- Comment on Disney+ Drops 1.3 Million Subscribers Amid Price Hike, Streaming Loss Shrinks by $300 Million 10 months ago:
Suppose one year you spend $60k, but only earned $50k. You lost $10k.
The next year, you spend $57k, and earned $53k. You lost $4k, and your losses narrowed by $6k.
- Comment on Disney+ Drops 1.3 Million Subscribers Amid Price Hike, Streaming Loss Shrinks by $300 Million 10 months ago:
Disney+ lost 1.3 million subscribers in the final quarter of 2023 amid a hefty price hike that went into effect last fall, but managed to narrow its streaming business’ losses by $300 million during the October-December period.
That doesn’t really sound like it backfired to me. They lost subscribers but made more money.
- Comment on What is OOP, really? Why so many different definitions? 10 months ago:
Javascript is generally considered OOP, but classes weren’t widely available till 2017.
Inheritance isn’t fundamental to OOP, and neither are interfaces. You can have a duck- typed OOP language without inheritance, although I don’t know of any off the top of my head.
Honestly, the more fundamental thing about OOP is that it’s a programming style built around objects. Sometimes OO languages are class based, or duck typing based, etc. But you’ll always have your data carrying around it’s behavior at runtime.
- Comment on What is OOP, really? Why so many different definitions? 11 months ago:
keeping state (data) and behavior (functions) that operate on that state, together
Importantly, that’s “together at runtime”, not in terms of code organization. One of the important things about an object is that it has dynamic dispatch. Your object is a pointer both to the data itself and to the implementation that works on that data.
There’s a similar idea that’s a bit different that you see in Haskell, Scala, and Rust - what Haskell calls type classes. Rust gives it a veneer of OO syntax, but the semantics themselves are interestingly different.
In particular, the key of type classes is keeping data and behavior separate. The language itself is responsible for automagically passing in the behavior.
So in Scala, you could do something like
def sum[A](values: List[A])(implicit numDict: Num[A]) = values.fold(numDict.+)(numDict.zero)
Or
def sum[A: Num](values: List[A]) = values.fold(_ + _)(zero)
Given a Num typeclass that encapsulates numeric operations. There’s a few important differences:
-
All of the items of that list have to be the same type of number - they’re all Ints or all Doubles or something
-
It’s a list of primitive numbers and the implementation is kept separate - no need for boxing and unboxing.
-
Even if that list is empty, you still have access to the implementation, so you can return a type-appropriate zero value
-
Generic types can conditionally implement a typeclass. For example, you can make an Eq instance for List[A] if A has an Eq instance. So you can compare List[Int] for equality, but not List[Int => Int].
-
- Comment on Functional Programming vs. Object Oriented Programming 11 months ago:
Apparently my brain silently inserted “ing with” into the middle of “program functions” a half dozen times without me noticing.
- Comment on [deleted] 11 months ago:
It’s really not just that Rust is new and C is old. Compare Rust with Go, for example. Go is a fairly modern example of a ‘worse is better’ language.
Back in 1970s when C was invented, Lisp had been around for over a decade. C came out the same year as smalltalk, a year before ML, and 3 years before Scheme.
Rust is a very modern language, though. There’s no way we could have had it in the 70s; many of its language features hadn’t been invented yet. But it very much depends on MIT style research languages for its basis.
- Comment on Functional Programming vs. Object Oriented Programming 11 months ago:
I agree with you that if you use functions it’s functional.
But many people don’t really realize how that contrasts with procedures and procedural code.
- Comment on Functional Programming vs. Object Oriented Programming 11 months ago:
Functions, here, being the key word.
Functions are pure mappings from input to output.
- Comment on [deleted] 11 months ago:
C is many things, but elegant really isn’t one of them.
C has always been part of the “worse is better”/New Jersey school of thinking. The ultimate goal is simplicity. Particularly simplicity of language implementation, even if that makes programs written in that language more complex or error prone. It’s historically been a very successful approach.
Rust, on the other hand, is part of “The Right Thing”/MIT approach. Simplicity is good, but it’s more important to be correct and complete even if it complicates things a bit.
I don’t really think of void* and ubiquitous nulls, for example, as the hallmark of elegance, but as pretty simple, kludgey solutions.
Rust, on the other hand, brings a lot of really elegant solutions from ML- family languages to a systems language. So you get algebraic data types, pattern matching, non-nullable references by default, closures, typeclasses, expression-oriented syntax, etc.
- Comment on Functional Programming vs. Object Oriented Programming 11 months ago:
Just like walking doesn’t really compete, like at all, with flying in an aircraft, Functional and Object Oriented Programming are at their best when you use whichever approach makes sense for a given situation and in any reasonably complex software that means your code should be full of both.
I’m not really sure sure that’s true.
In FP languages like Haskell, you get tools like algebraic data types, typeclasses, and pattern matching.
FP is really opposed to imperative programming, while objects are opposed to algebraic data types.
You can write OO code that’s 100% fully functional, and you can write code in Haskell where you barely notice you never once used an object.
- Comment on Functional Programming vs. Object Oriented Programming 11 months ago:
Yeah, OO and FP aren’t really opposed. FP is opposed to imperative programming.
That said, most FP languages give you a slightly different set of tools to use. Algebraic data types and typeclasses are really, really nice.
Honestly, working in Haskell or rust, you don’t really miss the fact that you have to jump through hoops to get traditional OO objects. There’s just not really many cases where you need them.
- Comment on AI comes up with battery design that uses 70 per cent less lithium 11 months ago:
The main problem is just that getting a product from a one-off in a lab to a cost-competitive mass-market product is hard and can take a lot of time, to say the least.
For example, Don Sadoway initially published about a molten metal battery in 2009. He gave a Ted talk in 2012. They’ve run into assorted setbacks along the way and are apparently just starting to deploy the first commercial test systems this year.
It’s less that these breakthroughs are bullshit, and more that commercializing these things is hard. The articles about the breakthroughs are often bullshit, though, or at least way too rosy.
- Comment on Someone once told me that time was a predator that stalked us all our lives. 11 months ago:
DS9 ran till '99, though.
The first seasons were 30 years ago, but the ending is only about 25 years ago.
BSG, though, finished in 1979. If someone says “thirty years ago” and your first thought is the 70s, you might be old. BSG ended 45 years ago.
- Comment on Breakthrough: "Electronic soil" boosts crop growth by over 50% 1 year ago:
Nope. The idea in no till is just adding stuff to the top and letting worms and roots handle the tilling.
I’ve had good luck just dumping a foot or two of finished compost on the ground and growing in it.
Another solid no-till approach is sheet mulching. You put down a layer of cardboard (to kill weeds), then layers of carbon and nitrogen like straw and kitchen scraps. Wait a few months, then plant. So you could do that in the late summer or fall to prepare a site for spring planting.
A lot of these things depend on location, though. Something that works great in Pennsylvania might not work as well in Utah.
- Comment on Tesla Has The Highest Accident Rate Of Any Auto Brand 1 year ago:
It’s partly about it being preventable, but mostly about it being expected.
The expected outcome of drunk driving or speeding through crosswalks is hitting someone. It’s preventable by not driving drunk or not speeding.
A careful driver in the Netherlands killing a cyclist in a city center on a 20mph road is unexpected and fairly surprising - that would be a true accident. A drunk driver hitting someone on an American stroad is depressingly normal. It’s hard to call it an accident.
- Comment on Tesla Has The Highest Accident Rate Of Any Auto Brand 1 year ago:
Colloquially, accidents are random events without intention or fault.
That’s why there’s a push to use neutral terms like “crash” that don’t imply that the “accident” was just a random accidental mistake.
And fault is often a bit of a misnomer. Many crashes are the result of bad design, but the courts would never say “this pedestrian fatality here is 40% the fault of whichever insane engineer put the library parking lot across a 4-lane road from the library but refused to put a crosswalk there or implement any sort of traffic calming because that would inconvenience drivers”.
- Comment on Tesla Has The Highest Accident Rate Of Any Auto Brand 1 year ago:
It doesn’t have to be on purpose. Accident implies that something was just a freak occurrence beyond anyone’s control. You can’t fix accidents. You can fix crashes.
If you’re driving negligently - drunk driving, not paying attention, etc then it’s not an accident.
If it’s due to bad road design, then it’s not an accident.
- Comment on xkcd #2869: Puzzles 1 year ago:
Ish.
There’s ye as in “hear ye, hear ye”. That’s a y. It’s an inflected form of you, much as they had both thee and thou.
Then there’s writing þe as ye.
- Comment on Unison | A friendly, statically-typed, functional programming language from the future · Unison programming language 1 year ago:
Pure functions should be referentially transparent; you should be able to replace them with whatever value they evaluate to without changing the semantics of your code.
Throwing is referentially impure: what value do you get from calling
x => throw new RuntimeException()
?Instead, functional languages prefer to return a tagged union of the value or the error.
- Comment on Unison | A friendly, statically-typed, functional programming language from the future · Unison programming language 1 year ago:
Functional languages typically have type inference.
It’s less that you have to declare something can do IO or throw an exception, and more that you’re calling something from the standard library that does IO or throws an exception.
Most stuff does neither. There’s a type level distinction between normal, regular pure code, and impure effectful code, so it’s easy to tell from the type signature whether a function is pure or not.
- Comment on Five People Founded Tesla, But Only Elon Musk Became Extremely Rich 1 year ago:
7 million is “retiring doctor” or “retiring Google engineer” rich.
It’s generally considered safe to withdraw 4% of your nest egg the first year, and adjust that for inflation moving forwards. $7 million can sustain a $280k/year retirement. That’s certainly rich, but there’s a world of difference between that and a billionaire. A billionaire can safely spend $40 million a year.
- Comment on World’s first off-road solar car ‘Stella Terra’ succeeds in cruising from Morocco to the Sahara 1 year ago:
I’m not sure that it does. All the articles I can find word it as something like “has a range of 710 kilometers (441 miles) on a sunny day.”, without actually explaining it. I’m assuming that’s going from 100% charge to 0% charge, plus all the range gained by charging during the day.
They don’t actually say anywhere I can find how quickly it charges.
Also, looking up some other articles about it, apparently there’s a bunch of extra fold-out solar panels in the trunk
If you wanted maximum range, you’d start before dawn, drive most of your battery away, park somewhere all day to use that solar awning for all its worth, then continue driving at dusk.
- Comment on World’s first off-road solar car ‘Stella Terra’ succeeds in cruising from Morocco to the Sahara 1 year ago:
It’s not that it’s far-fetched. It’s just impractical. Solar panels don’t really generate that much power per square foot. Charging a car with just the roof can take days.
One model of solar roofed electric car on the market recharges ~20 miles per day with the roof.
Charging stations are a way better idea for road trips in electric cars, as is plugging the car in overnight. This is great for a remote hermit, but more interesting for the hack value than a practical option.
- Comment on aLiEnS!!1 1 year ago:
Stick assembly is the key thing.
You’re not going to find a thread strong enough to pull a few tonnes of stone, but you can easily pull it with a large number of ropes pulled by a few hundred people.
Similarly, a single 8x8 beam as a lever arm would just snap, but a dozen 8x8 beams as lever arms for a dozen levers probably wouldn’t.
- Comment on What operating system and tools should a beginner use to learn programming? 1 year ago:
What are some places that don’t look like Linux but actually are?
I’d think most PC games and other desktop GUI software runs on windows and looks like it runs on windows. And I’d imagine that a web browser on windows isn’t secretly a Linux environment.
But yeah, I’ve written way more code that runs on a web browser or a Linux server than runs on windows.
- Comment on Ultrasound can push vaccines into the body without needles 1 year ago:
Ultrasound vaccines give you ultra-autism.
- Comment on A perfect visualisation of a wasteful system 1 year ago:
Vacant homes are any home that’s not someone’s primary residence when they calculate vacancies.
That includes vacation homes, temporary housing for traveling workers or college students, houses that are sold or rented but haven’t been moved into yet, housing held up in divorce or estate proceedings, etc.
According to the census, last year there were 15 million vacant homes. Yes, that’s a lot, and yes, many can’t reasonably have a homeless person live there.