News for hackers. Stuff that matters.
Re:“Coding is basically just ifs and for loops.” by okareaman on Saturday December 04, 2021 @04:08PM (#29444327)
I started off writing a lot of 68000 machine code. I was always amazed what you could accomplish with a lot of loops and branches. I never lost that sense that at whatever higher level I was at later on, it was all loops and branches.
Re:“Coding is basically just ifs and for loops.” by GhettoComputers on Saturday December 04, 2021 @05:08PM (#29444739)
Have you seen this? https://news.ycombinator.com/item?id=25788317

Seems like we lose a lot of good technology and progress for random reasons, like the “ram” of society is finite.

Re:“Coding is basically just ifs and for loops.” by peterburkimsher on Saturday December 04, 2021 @10:22PM (#29446440)
Thank you GhettoComputers for the link! And thank you Zhyl for the summary.

Sounds like the 2 hard things in Computer Science returning! Cache invalidation, naming things, and off-by-one errors. [1]

* "Knowledge is ephemeral": Cache invalidation

* "tower of abstraction": naming things, indirection [2]

Recommendations:

* "Reduce complexity, reduce dependencies": minimise entropy, maximise connectedness

* Learn: welcome newcomers; recurse to the next generation

[1] https://martinfowler.com/bliki/TwoHardThings.html

[2] All problems in computer science can be solved by another level of indirection" "...except for the problem of too many layers of indirection."

https://en.wikipedia.org/wiki/Indirection#Overview

Re:“Coding is basically just ifs and for loops.” by GhettoComputers on Saturday December 04, 2021 @10:45PM (#29446528)
The redirection he called an abstraction, and how it makes things easier to make, with less performance and in manh way it’s good, but there’s a point where it isn’t, and solutions like the idea of needing an AI to tell us everything shouldn’t be required.

I like how he talked about using bare metal to run games and not needing an OS, relying on an ISA, or how games were easier to at one point before excessive abstractions.

One very memorable comment he made was when he was asked about what he thought about the M1 chip running software faster, his response was that we could use current hardware and make it run 100x faster if it was well written. Huge part of the many reason I switched to Linux. ;)

Re:“Coding is basically just ifs and for loops.” by okareaman on Saturday December 04, 2021 @07:56PM (#29445797)
Yes, it's a good talk. Think of all the extremely talented internal combustion engine engineers that will be obsolete in 20 - 30 years.
Re:“Coding is basically just ifs and for loops.” by GhettoComputers on Saturday December 04, 2021 @08:18PM (#29445929)
Obsolete or repurposed? People studying physics like string theory may be completely wrong, but their skills can still be useful.
Re:“Coding is basically just ifs and for loops.” by aj7 on Saturday December 04, 2021 @08:50PM (#29446068)
They’re obsolete now, except on YouTube.
Re:“Coding is basically just ifs and for loops.” by bbarnett on Sunday December 05, 2021 @02:39AM (#29447538)
ICE has thousands of uses, they aren't just for cars.

An example? Up above the treeline, there are communities relying on diesel for power.

Solar is a no go, with months of darkness. Wind turbines are hard to maintain at -50C, and snow and ice can impede them.

Even electric cars can only cover some of car use-cases, both due to range and refuel time issues.

Expect ICE in 2050 still.

And in most places, electric cars take petrol out of the car, and instead, see things like coal or natural gas burned, to make the electricity to charge them.

Re:“Coding is basically just ifs and for loops.” by ZeroGravitas on Sunday December 05, 2021 @09:25AM (#29449431)
> And in most places, electric cars take petrol out of the car, and instead, see things like coal or natural gas burned, to make the electricity to charge them.

This is true, but also a good thing, while you present it as at best a wash and possibly a negative.

Coal powered EVs are better than gasoline ICEs in most situations, and nobody has a 100% coal grid anymore so the benefits are even greater. There's lots of reasons why but the main one, which is relevant to this conversation as well, is the inefficiency of ICE compared with electric motors.

Re:“Coding is basically just ifs and for loops.” by GhettoComputers on Sunday December 05, 2021 @10:15AM (#29449866)
What is more green? Coal or natural gas plants, AC lines that lose some power, building transformers, using AC to DC converters for all our power supplies, refining rare earth minerals to make decaying chemical cells, and using brushless motors (I think?) versus oil drilling with huge machines, refineries, transport and risks of oil spills, and building combustion engines? ICE looks like it can be way more efficient.
Re:“Coding is basically just ifs and for loops.” by ZeroGravitas on Sunday December 05, 2021 @10:45AM (#29450084)
We don't need to guess, lots of time and energy has been put into answering this question:

https://evtool.ucsusa.org/

Re:“Coding is basically just ifs and for loops.” by GhettoComputers on Sunday December 05, 2021 @11:49AM (#29450599)
They don’t even have a Toyota Corolla or Camry in the miniature database.
Re:“Coding is basically just ifs and for loops.” by ZeroGravitas on Monday December 06, 2021 @02:46AM (#29457238)
In the list of electric vehicles, I wonder why not?
Re:“Coding is basically just ifs and for loops.” by tasuki on Sunday December 05, 2021 @04:06PM (#29453261)
> Coal powered EVs are better than gasoline ICEs in most situations

Are you taking in account battery disposal?

Re:“Coding is basically just ifs and for loops.” by ZeroGravitas on Monday December 06, 2021 @02:55AM (#29457300)
Yes. It's actually one of the things that makes EVs greener. A lump of valuable metals in one relatively easy to access and pure form is a lot greener thing to have than a decade of combusted fossil fuels.
Re:“Coding is basically just ifs and for loops.” by GhettoComputers on Sunday December 05, 2021 @10:04AM (#29449779)
Hydrogen fuel isn't going away.
Re:“Coding is basically just ifs and for loops.” by DrAwdeOccarim on Saturday December 04, 2021 @05:02PM (#29444695)
Reminds me of biological metabolic systems. All loops and branches…
Re:“Coding is basically just ifs and for loops.” by okareaman on Saturday December 04, 2021 @07:53PM (#29445782)
Stephen Wolfram thinks the entire universe is built from simple rules

https://en.wikipedia.org/wiki/A_New_Kind_of_Science

Re:“Coding is basically just ifs and for loops.” by peterburkimsher on Saturday December 04, 2021 @10:17PM (#29446422)
For the algorithm to work in many dimensions (XML tags), I feel like it must be a simple algorithm.

Rule 110 is known to be Turing-complete. https://en.wikipedia.org/wiki/Rule_110

I have a feeling that Rule 90 is the most efficient algorithm: the Sierpiński Triangle, self-sacrifice, infinite recursion to a perfect pattern. I'm not mathematically talented enough to prove that though.

https://mathworld.wolfram.com/Rule90.html

Please come to chat about A New Kind of Science on Facebook! A couple of weeks ago I noticed that the page didn't exist, so created it. Hopefully Wolfram doesn't mind. We stand on the shoulders of giants.

https://www.facebook.com/A-New-Kind-of-Science-1004052657757...

Re:“Coding is basically just ifs and for loops.” by Eelongate on Sunday December 05, 2021 @02:00AM (#29447394)
I'm no physicist, but doesn't the Standard Model fit on a few pieces of paper? That the universe has rules that are a lot simpler than the behavior that emerges from those rules doesn't seem like novel claim. Wolfram's idea to examine the universe by exploring CA-space is the novel part I think.
Re:“Coding is basically just ifs and for loops.” by ellimilial on Saturday December 04, 2021 @05:51PM (#29445044)
With a lot of fuzziness, some state and temporal stuff.
Re:“Coding is basically just ifs and for loops.” by DrAwdeOccarim on Thursday December 09, 2021 @07:03AM (#29496424)
Yea, the fuzziness comes from protons shuttling about, tunneling around, electrons moving in cycles with phosphates. It's all just vibrating, bumping and bumbling about. I remember how blown my mind was when I first learned that all reactions catalyzed by enzymes would have happened anyway given enough time and the enzymes just tune the systems to work in concert in a time frame conducive to life.
Re:“Coding is basically just ifs and for loops.” by julian55 on Saturday December 04, 2021 @05:20PM (#29444829)
Yes, one of my early jobs was writing Z80 code and I have the same sense.
Re:“Coding is basically just ifs and for loops.” by okareaman on Saturday December 04, 2021 @07:49PM (#29445759)
When I eventually learned C it took me awhile to stop optimizing and let the compiler do it
Re:“Coding is basically just ifs and for loops.” by Aeolun on Saturday December 04, 2021 @06:25PM (#29445252)
Ultimately all the interesting stuff happens in loops and branches, the rest is just organization.
Re:“Coding is basically just ifs and for loops.” by 6510 on Saturday December 04, 2021 @10:03PM (#29446369)
The organization is only needed for the inevitable bloat you add later to justify the rewrite.

Its something like the sage uncovers the boiler, points at it and announces: Look! It is a beautiful marvel of technology! Why would you want to cover it up? Look! You might learn something!

Re:“Coding is basically just ifs and for loops.” by suifbwish on Sunday December 05, 2021 @09:48AM (#29449645)
It’s not about how many loops you have; it’s about what you put in them and how deep.