Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Achmed Jones
Oct 16, 2004



ultrafilter posted:

There are interesting philosophical questions about chatbots but you're not going to find any serious discussion of them on hn.

yeah this

Adbot
ADBOT LOVES YOU

MononcQc
May 29, 2007

I yelled at the mountains and they repeated the words to me

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
the mountains are calling and i must chat

distortion park
Apr 25, 2011


lol at the "my iPhone can't compile c++" post that somehow made it to the top this morning

mystes
May 31, 2006

Is that the jornada one? I didn't actually read it

distortion park
Apr 25, 2011


mystes posted:

Is that the jornada one? I didn't actually read it

Yes, I stopped at the picture of a windows desktop on a mobile thingy

Neon Noodle
Nov 11, 2016

there's nothing wrong here in montana
I have a problem, Stylebot is helping me:

hobbesmaster
Jan 28, 2008

distortion park posted:

lol at the "my iPhone can't compile c++" post that somehow made it to the top this morning

this makes me want to make a “stop compiling on targets” version of the math meme

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
there were a lot of people in that thread very convinced that the mac app store is something other than the updater for apple software

Best Bi Geek Squid
Mar 25, 2016
hn poster: you shouldn’t call anyone nazis, except for apple because it won’t let you compile and run arbitrary code on your telephone

fritz
Jul 26, 2003

barelyauser 26 minutes ago [flagged] [dead] | parent | context | flag | vouch | favorite | on: Starlink v2 reached the brightness reduction targe...

Unbelievable. People that don't produce any value expecting others to bow to their whims. People ought to remain disconnected from all the wealth the internet can provide because we need to document IRKX-002202, a fabulous class 3 dwarf star.



barelyauser 19 minutes ago | parent | next [–]

I've been to Africa and seen the real world impacts of the lack of communications. I'm against anything that stands in the way of solving that specific problem. Astronomers come second to that, plain and simple.
reply

Analytic Engine
May 18, 2009

not the analytical engine
ghostpepper 1 hour ago | root | parent | prev | next [–]

> you arguably shouldn't use the Suzuki method to teach music to your kids anyway since it tends to guide them to a local maximum by emphasizing ear training over reading
I am not a professional musician but this feels a bit reductionist to me, in that it assumes the goal of any musical endeavor is to faithfully reproduce the music that was written down hundreds of years ago.
Some of the most celebrated musicians could not read music -- indeed some were blind -- but I would challenge you to find any musician who created anything worthwhile without having a trained ear.
It seems backwards to me to focus on the skill of reading over listening for what is fundamentally an auditory art form.
reply

thr_msc 50 minutes ago | root | parent | next [–]

Replace reading music with writing in assembly and you have the software equivalent. People can write software without a higher level language, but their software will be better if they did. The same is true for musicians and reading sheet music.
reply

hobbesmaster
Jan 28, 2008

I could almost follow the analogy if the second guy said C

but… assembly? the equivalent on a piano would be more like… idk, specifying the exact location of your hand and force with which a specific finger intends to hit each key?

mystes
May 31, 2006

just replace every hn comment with "I am very smart" and it will make more sense

lobsterminator
Oct 16, 2012




I know it's HN so what do you expect, but it's pretty annoying when every single thing in life is viewed through a programming analogy.

Analytic Engine
May 18, 2009

not the analytical engine

mystes posted:

just replace every hn comment with "I am very smart" and it will make more sense

considering scraping HN to see how many comments begin with "I" or "My"

4lokos basilisk
Jul 17, 2008


there is no way that hn person actually knows how to write assembly either, its all theorycrafting based on a skill they really wish would have

a better analogy for assembly would be more like somehow manually causing vibrations in the air which turn into sound and any piece would be microseconds long

anyway these fuckers have a very optimistic idea of how much reading music will tell you objectively and accurately about what the thing is supposed to sound like. there is a reason we say that a piece of classical music is “interpreted” by a musician

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


hn thread: "I am very smart"

Sapozhnik
Jan 2, 2005

Nap Ghost
I mean there's nothing particularly difficult about writing a program in assembly language (for which architecture?), it's just tedious, and on any superscalar cpu your hand written assembly language code will run much slower than the output of any half decent optimizing compiler.

which is, you know, the reason why nobody writes assembly language code except for like, stack setup sequences for C code

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
people also hand-write assembly to like, implement concurrency intrinsics for the compiler to use

which is really fun when they do it wrong and introduce a subtle bug

mystes
May 31, 2006

Sapozhnik posted:

I mean there's nothing particularly difficult about writing a program in assembly language (for which architecture?), it's just tedious, and on any superscalar cpu your hand written assembly language code will run much slower than the output of any half decent optimizing compiler.

which is, you know, the reason why nobody writes assembly language code except for like, stack setup sequences for C code
it also makes your code not be isa independent with no real benefit in 99.9% of cases

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
well-written assembly will still usually outperform the compiler. you do have to understand modern cpus because yeah superscalar changes a lot of the considerations but there are definitely plenty of things that compilers don’t do well and/or can’t figure out

fritz
Jul 26, 2003

phpisthebest 15 minutes ago | parent | context | prev | next [–] | on: San Francisco fire chief fed up with robotaxis tha...

it is clear to me that most if not all of Human Progress will cease to advance as we have gone to the extreme with safety culture.
if we were still using Horse drawn carriages for travel, and someone invented the first Horseless Buggies today it would be banned and never allowed to advance at all. The amount of death and injury from the inception of the automobile would never be allowed in a new industry today. We have rationalized and assimilated the everyday human automobile into our lives, but refuse to accept any risk for something new
reply

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


So close to getting it....

mondomole
Jun 16, 2023

Sapozhnik posted:

I mean there's nothing particularly difficult about writing a program in assembly language (for which architecture?)

Wait - isn't this super difficult to get right? I've dabbled a bit before with inline assembly and it was an adventure to get anything to not segfault on me, let alone actually do the right thing.

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
From my admittedly limited experience I'd describe assembly as tedious rather than really difficult.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Antigravitas posted:

From my admittedly limited experience I'd describe assembly as tedious rather than really difficult.

That's my experience as well, but I've only written very short programs. I could definitely see the bookkeeping being pretty hard as your program becomes large.

mondomole
Jun 16, 2023

ultrafilter posted:

That's my experience as well, but I've only written very short programs. I could definitely see the bookkeeping being pretty hard as your program becomes large.

I guess it's also a semantic thing, I'm not sure we disagree about the underlying facts. It doesn't seem hard in the sense that a math proof is hard; it seems hard in the sense that for any human, keeping track of a stupidly large number of specific facts is hard.

fritz
Jul 26, 2003

uppiiii765 28 minutes ago | parent | prev | next [–]

Is it?
We (I say this not from my point of view) don't want to see poor people.
We don't relate to them and we think they should just be successful in their countries.
In contrast there is someone who is part of us, not poor, has achieved something and entertained us in an interesting way.
Of course we will try to help them and not those refugees.
The mental issue of us living great while 3th world countries exist is nothing new for a long time.
It's now even so old that there is research done on how to help people because the obvious things didn't work.
reply

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
most assembly languages have rudimentary tools for abstraction: macros, named constants, constant expressions, primtitive structured loops and branches, sometimes you can even define records

tedious, yes

full of footguns, also yes

i would not want to exclusively program in assembly, but i think most professional programmers would benefit from writing at least one small project using assembly, as an educational experience

Sapozhnik
Jan 2, 2005

Nap Ghost
I mean yeah it's a fairly broad statement. If you're trying to implement a complicated algorithm AND you want it to be maximally efficient AND you try to write the whole thing in assembly language then yeah you're going to have steam shooting out of your ears from the mental exertion of trying to track algorithmic invariants across three simultaneous levels of abstraction.

If you're writing a fairly simple data processing tool then it's not a million miles removed from programming in C, that language is called an architecture-independent assembler for a reason. A decent assembler (so not GNU as, which is mostly intended to live inside the GCC toolchain's human centipede and not as an independent organism) will let you define structures and stack frames just like C. You can, with only a modest amount of pain, write a nontrivial progam in assembly language and even have it be somewhat maintainable. Particularly since modern architectures have at least 16 GPRs, which is enough to hold a reasonable number of parameters and local variables with a handful of registers left over to act as scratch space for what would be complex infix expressions in something like C (consider e.g. obj->array[state->position++] or whatever, you're going to need about three scratch registers for that expression).

Obviously you'll need to write a bunch of comments describing what each register is being used for inside the function and you're not going to have a compiler enforcing any of that new-fangled "block-structured programming" stuff for you either, that's all on you, but you can probably avoid having to do any register spilling and keep each caller-save register dedicated to one specific task without it having to pull double duty. Really the biggest pain in the rear end is going to be dealing with calling conventions, but even then at least x86_64 and ARM32 give you a bunch of tools to make this less painful. ARM32 has an instruction that spills a bitmapped list of registers to the stack but I think ARM64 requires you to write them all out longhand. ARM64 was designed in ~2010 so it doesn't have a lot of affordances for hand-written instruction sequences in general.

The reason why a C compiler will do a better job is that it can do things like inlining and loop unrolling without getting hopelessly confused like your pathetic human thinkmeats will. Also instruction scheduling for superscalar CPUs, so it will spill a bunch of stuff onto the stack to make GPR space, splat an inline function into the middle of your code and regalloc it, then run three iterations of its loop in parallel using three separate handfuls of GPRs that it just freed up (or maybe the compiler doesn't need to do that and the CPU will register-rename three sets of physical GPRs to carry out its own unrolling on the fly? idk but it's fun to think about). Which is why your nice neat hand-written assembly language will be slower (although perhaps not significantly) than a corresponding C program, and completely un-portable on top of that.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Internet Janitor posted:

i would not want to exclusively program in assembly, but i think most professional programmers would benefit from writing at least one small project using assembly, as an educational experience

I didn't really get recursion until I wrote a recursive implementation of the factorial function in assembly.

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

Sapozhnik posted:

The reason why a C compiler will do a better job is that it can do things like inlining and loop unrolling without getting hopelessly confused like your pathetic human thinkmeats will. Also instruction scheduling for superscalar CPUs, so it will spill a bunch of stuff onto the stack to make GPR space, splat an inline function into the middle of your code and regalloc it, then run three iterations of its loop in parallel using three separate handfuls of GPRs that it just freed up (or maybe the compiler doesn't need to do that and the CPU will register-rename three sets of physical GPRs to carry out its own unrolling on the fly? idk but it's fun to think about). Which is why your nice neat hand-written assembly language will be slower (although perhaps not significantly) than a corresponding C program, and completely un-portable on top of that.

a compiler doesn't decide to inline or loop unroll out of deep insight, it just has heuristics directing it to do things sometimes and they can decide wrong. a human who understands low-level optimization can generally do better

the reasons why even those who know how to beat the compiler don't whip out the assembler all the time are:

1. as you note, it produces non-portable and less maintainable code

2. it's not hard to beat the compiler, but you have to put a lot of hours into it, hours better spent on...

3. algorithmic optimizations, which are almost always far more important. when doing such work, you don't want to be writing assembly. even C, one of the lowest-level high level languages out there, is infinitely better for big refactoring jobs

what you usually ought to do is prototype in your HLL of choice. once you've happy that your big-O's are in a good place, but still need more performance, and have decided to live with the downsides, that's when you profile to find small critical bits of code which could benefit from an assembly rewrite

mondomole
Jun 16, 2023

BobHoward posted:

what you usually ought to do is prototype in your HLL of choice. once you've happy that your big-O's are in a good place, but still need more performance, and have decided to live with the downsides, that's when you profile to find small critical bits of code which could benefit from an assembly rewrite

what i'm hearing is that you should basically learn assembly and use it everywhere to troll your teammates and then leave before portability and maintainability become your problem

Progressive JPEG
Feb 19, 2003

fritz posted:

uppiiii765 28 minutes ago | parent | prev | next [–]

Is it?
We (I say this not from my point of view) don't want to see poor people.
We don't relate to them and we think they should just be successful in their countries.
In contrast there is someone who is part of us, not poor, has achieved something and entertained us in an interesting way.
Of course we will try to help them and not those refugees.
The mental issue of us living great while 3th world countries exist is nothing new for a long time.
It's now even so old that there is research done on how to help people because the obvious things didn't work.
reply

this is maybe 10% right in that immigrant and refugee statuses are indeed treated very differently and that countries will move mountains in order to avoid anyone being able to claim asylum there, but the other 90% is lomarf

Qwertycoatl
Dec 31, 2008

if i wrote something in assembly for performance i'd beat the compiler because i'd only try to do it if i saw that the compiler was doing something stupid to a particular performance-critical function

(the only substantial assembly i've dealt with was because the platform was weird and crazy and nobody had written a compiler for it)

Analytic Engine
May 18, 2009

not the analytical engine
is webassembly the new assembly?

lord fifth
Dec 26, 2019

LUCK ???
maybe if youre a spider

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
piss is the new piss

Adbot
ADBOT LOVES YOU

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Analytic Engine posted:

is webassembly the new assembly?

webassembly is the new NaCL, which was the new ActiveX

prior to wasm there was the entirely different asm.js, which was frankly more promising but it was backwards-compatible, and therefore a nonstarter

none of these systems involve a programmer writing assembly language in any conventional sense

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply