Join us now. It is free, and it takes less than 1 minute to register.
Register now
Subscribe to our daily newsletter. It is free, and it comes with many benefits.


+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28

Thread: Programming Languages explained (funny pic)

  1. #16

    Default

    No, its been a few years since I really worked on any low level code that required assembly (or even C for that matter).

    I had a lot of fun when I was young optimising my line rendering assembly code.

  2. #17
    SmoothOokerMaximus The_Librarian's Avatar
    Join Date
    Nov 2015
    Location
    Talga Vassternich.
    Posts
    15,719
    Blog Entries
    1

    Default

    Pity they did not include assembler, and that old stalwart, BASIC...

    10 PRINT "RESCUE THE PRINCESS"
    20 GOTO CASTLE
    30 GOTO PRINCESS
    40 GOTO END
    500th anniversary of the Protestant Reformation has passed.

  3. #18
    MyBB Legend
    Join Date
    Jun 2007
    Location
    /\/¯¯¯¯¯\/\
    Posts
    36,272

    Default

    Quote Originally Posted by cguy View Post
    BTW, any of you still use assembly?

    I still do - primarily via intrinsics and to check compiled code quality for performance. Also for specialized hardware.
    Which software do you use and would you perhaps mind elaborating on the bolded part? Thanks
    Feeling down? You need a Friday thread.

    Dickapitation

  4. #19
    SmoothOokerMaximus The_Librarian's Avatar
    Join Date
    Nov 2015
    Location
    Talga Vassternich.
    Posts
    15,719
    Blog Entries
    1

    Default

    Anybody used Borland's Turbo Profiler to optimize their programs?
    500th anniversary of the Protestant Reformation has passed.

  5. #20

    Default

    Quote Originally Posted by mercurial View Post
    Which software do you use and would you perhaps mind elaborating on the bolded part? Thanks
    I typically write this type of code in C or C++ and compile it. I will then use something like objdump or a compilation with the -S option to see the assembler source code that was generated. I will then look at the assembler and see if there are any inefficiencies in the code that was generated.

    The kind of thing I would look for may be:
    - Short pieces of code not being inlined
    - The compiler can't tell that there is no overwrite between two reads of a global variable, so it gets read every time
    - The compiler runs out of registers within a loop, and spill to the the stack
    - The compiler generates many jumps to early out of a compound condition that I will almost always be true
    - The compiler may make incorrect assumptions about the likelihood of a condition being true or false
    - The compiler may correctly choose the likelihood of a condition being true or false, however, the unlikely case may be the speed sensitive one (and the one I want the CPU speculate)
    - Compares and jumps can perhaps be avoided by conditional moves
    - Vectorization may have unintended side effects
    - Hand vectorization may accelerate a given piece of code
    - The compiler may not be able to make assumptions about loop variable sizes, so it generates unnecessary remainder handling code that bloats the code cache as it gets prefetched.
    - etc.

  6. #21
    Super Grandmaster Kosmik's Avatar
    Join Date
    Sep 2007
    Location
    In the valley
    Posts
    16,209

    Default

    Quote Originally Posted by The_Librarian View Post
    Pity they did not include assembler, and that old stalwart, BASIC...

    10 PRINT "RESCUE THE PRINCESS"
    20 GOTO CASTLE
    30 GOTO PRINCESS
    40 GOTO END
    Please correct line 40 as per std 80's spec

    40 PRINT "PRINCESS HAS BEEN TAKEN AGAIN"
    50 GOTO 10
    Last edited by Kosmik; 28-03-2018 at 05:43 PM. Reason: fixed syntax error in code if anyone reads these :p
    Neo-Luddite - Permanent Darwin award candidates

  7. #22
    MyBB Legend
    Join Date
    Jun 2007
    Location
    /\/¯¯¯¯¯\/\
    Posts
    36,272

    Default

    Quote Originally Posted by cguy View Post
    I typically write this type of code in C or C++ and compile it. I will then use something like objdump or a compilation with the -S option to see the assembler source code that was generated. I will then look at the assembler and see if there are any inefficiencies in the code that was generated.

    The kind of thing I would look for may be:
    - Short pieces of code not being inlined
    - The compiler can't tell that there is no overwrite between two reads of a global variable, so it gets read every time
    - The compiler runs out of registers within a loop, and spill to the the stack
    - The compiler generates many jumps to early out of a compound condition that I will almost always be true
    - The compiler may make incorrect assumptions about the likelihood of a condition being true or false
    - The compiler may correctly choose the likelihood of a condition being true or false, however, the unlikely case may be the speed sensitive one (and the one I want the CPU speculate)
    - Compares and jumps can perhaps be avoided by conditional moves
    - Vectorization may have unintended side effects
    - Hand vectorization may accelerate a given piece of code
    - The compiler may not be able to make assumptions about loop variable sizes, so it generates unnecessary remainder handling code that bloats the code cache as it gets prefetched.
    - etc.
    Wow, that's quite interesting, thanks
    Feeling down? You need a Friday thread.

    Dickapitation

  8. #23
    Super Grandmaster Compton_effect's Avatar
    Join Date
    Sep 2006
    Location
    Outer arm - Milky Way/Sagittarius Cluster
    Posts
    10,886

    Default

    You have VB6. You find a magic sword that rescues the princess for you - written ages ago by a wise and ancient programmer., You have no idea how it works and no way to find out, but no-one will notice if you use it. Everything is great, but now they want you to rescue a prince instead.
    Ethics, morals, scruples and a sense of rhythm. I have none of them, and only miss one.

  9. #24

    Default

    Quote Originally Posted by mercurial View Post
    Wow, that's quite interesting, thanks
    Sure.

    BTW, today I needed to decompile some code to see why some hand vectorized code was slower than scalar code.

  10. #25
    MyBB Legend
    Join Date
    Jun 2007
    Location
    /\/¯¯¯¯¯\/\
    Posts
    36,272

    Default

    Quote Originally Posted by cguy View Post
    Sure.

    BTW, today I needed to decompile some code to see why some hand vectorized code was slower than scalar code.
    You should start a channel on YouTube.
    Feeling down? You need a Friday thread.

    Dickapitation

  11. #26

    Default

    Thats why I love C# !
    I've walked for miles inside this pit of danger, a place where no one follows me, I walk alone.

  12. #27

    Default

    Quote Originally Posted by mercurial View Post
    You should start a channel on YouTube.
    Heh - tempting, but not sure what my employer would think of it.

  13. #28

    Default

    Quote Originally Posted by Compton_effect View Post
    You have VB6. You find a magic sword that rescues the princess for you - written ages ago by a wise and ancient programmer., You have no idea how it works and no way to find out, but no-one will notice if you use it. Everything is great, but now they want you to rescue a prince instead.
    you owe me a cup of coffee

+ Reply to Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Learn one of these 7 programming languages and you’ll always have a job
    By Kevin Lancaster in forum Broadband and IT News
    Replies: 48
    Last Post: 16-10-2016, 08:34 PM
  2. If programming languages were weapons
    By gkm in forum Software and Web Development
    Replies: 8
    Last Post: 07-05-2015, 08:45 PM
  3. List of top programming languages
    By garyc in forum Software and Web Development
    Replies: 22
    Last Post: 22-07-2014, 04:13 PM
  4. Funny Quotes about programming languages
    By Skywalker42 in forum Software and Web Development
    Replies: 10
    Last Post: 05-06-2012, 04:44 PM
  5. Best Beginner Programming Languages?
    By kwaggawerner in forum Software
    Replies: 20
    Last Post: 29-01-2010, 09:01 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •