Page 4 of 4 FirstFirst ... 234
Results 31 to 39 of 39

Thread: assembly -- where would you begin

  1. #31
    Join Date
    May 2010
    Location
    uk
    Beans
    9,299
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: assembly -- where would you begin

    Hi

    Well, what constitutes "fundamental principles" has been a bone of contention here for years, it's probably the most discussed issue if you recall... the high/low level languages "megathread" in particular has a lot of stuff about this.
    Oh dear. Please, not that old discussion again. My programming language is bigger than yours.

    I would suggest the OP already knows at least one other language and wants to understand how that language is an abstraction from the instruction set used to control the PC ?

    I would suggest that is a different exercise than learning fundamental programming concepts or fundamental principles using assembler.

    I would not recommend teaching assembly as a first language but rather as an augmentation of other languages to highlight (for one example) constraints placed on a language by its grammar and syntax. (i.e What actually is a cast in C and C++).

    But also, IMHO, knowing a bit of assembler really does broaden the understanding of any developer, highlighting the interaction of hardware and software, although most developers do not need or want to know it.

    And that is where i think from where the discussion of the high/low level languages originates. Do you need to know low level languages for most things ? No. Do they give a broader understanding ? Yes.

    Right. I will run for cover Understand, i have enjoyed programming in all the languages i have used both high and low level. They all have their place.

    Kind regards
    Last edited by matt_symes; January 22nd, 2011 at 03:29 PM.
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  2. #32
    Join Date
    Mar 2009
    Location
    pennslyvania
    Beans
    122
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: assembly -- where would you begin

    ... no good reason for this post so I removed it.
    Last edited by audit; January 22nd, 2011 at 04:10 PM. Reason: argumentative

  3. #33
    Join Date
    Mar 2009
    Location
    pennslyvania
    Beans
    122
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: assembly -- where would you begin

    thanks to all the links and the suggestions were helpful.

  4. #34
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: assembly -- where would you begin

    Quote Originally Posted by matt_symes View Post
    Oh dear. Please, not that old discussion again. My programming language is bigger than yours.
    Nope, it's not about that. It was a fair question on a recurring subject so I provided a response. I find this to be a really interesting topic, and don't really understand why it should be seen as an instance of just that. There's more to this really...

    I would suggest the OP already knows at least one other language and wants to understand how that language is an abstraction from the instruction set used to control the PC ?
    It was a response to worksofcraft, not the OP.

    Compiler theory and authoring of interpreters is an interesting subject (in which an understanding of Lisp is remarkably helpful), but really, other programming languages are not "abstractions from" assembly. All Turing-complete language are equivalent, just different in how they formulate things. Of course we need a physical machine to actually run things in the real world so there needs to be some mapping between the two...

    I would suggest that is a different exercise than learning fundamental programming concepts or fundamental principles using assembler.
    Again, it was worksofcraft's question, not the OP's.

    I would not recommend teaching assembly as a first language but rather as an augmentation of other languages to highlight (for one example) constraints placed on a language by its grammar and syntax. (i.e What actually is a cast in C and C++).
    How about using Lisp as an example to highlight Assembly's limitations in not having higher-order functions, while Lisp still has the full ability to manipulate state in small steps, if desired?

    But also, IMHO, knowing a bit of assembler really does broaden the understanding of any developer, highlighting the interaction of hardware and software, although most developers do not need or want to know it.
    I'm not sure I've ever made statements as to "not learning assembler"; just that I am very sceptical of the claims of its "fundamentality" in comparison to higher-level languages.

    And that is where i think from where the discussion of the high/low level languages originates. Do you need to know low level languages for most things ? No. Do they give a broader understanding ? Yes.
    It is not a matter of "not needing to know"; it leaves me with the nagging feeling that in that case HLLs are seen as some sort of a cop-out and crutch (a bit like the term "abstraction" is used as an almost derogatory term in the LLL-circles). I'm not sure how to communicate it that the model of computation that assembly represents is perfectly possible in all higher-level languages as well; it's just that there is so much more to HLLs that actually aid in conceptualizing "computable things", and it is that kind of thinking that a programmer needs most.
    LambdaGrok. | #ubuntu-programming on FreeNode

  5. #35
    Join Date
    May 2007
    Beans
    245
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: assembly -- where would you begin

    Quote Originally Posted by worksofcraft View Post
    I think it would seriously confuse students.
    From the many beginner questions I've seen here on this forum I would say an assembler based programming course is very much lacking.
    Simple concepts like: what is a memory fetch cycle, how the stack works with function calls and local data items, static memory allocation... how are pass by value and pass by reference actually implemented, instructions v.s. data... what is a register... how does the ALU work, interrupt servicing and also controling input/output hardware.. realitive and absolute addressing modes... and many more
    Well, those are 'beginners' -- one cannot expect them to already know about things they've not yet been exposed to. Just like any other bailiwick, it takes time and experience to develop new skills. Also, in order to obtain most of the more advanced programming skills, one has to be a bit of an autodidact. Most people do not posses the ability to teach themselves... and they don't know where to look to find these answers even if they had the desire to know.

    Someone once posted this Competency Matrix:
    http://www.starling-software.com/emp...cy-matrix.html

    Heck! I do not have any desire, nor intent, to be at 'Level 3' on every one of those categories. Do you?? Does anyone??

    Would you believe recently there was a thread from someone who was soon to be doing a course on micro-controllers... which they were going to be programming in BASIC

    Can you actually think of ANYTHING one could learn about micro controllers when programming in BASIC ? TBH I really really can't even begin to imagine!
    Perhaps the goal of the course was not to teach about micro controllers? Embedded environments require attention to much more important issues... and, yes, C, Basic, Java, etc. are perfect languages for teaching these concepts.

  6. #36
    Join Date
    Sep 2007
    Location
    Christchurch, New Zealand
    Beans
    1,328
    Distro
    Ubuntu

    Re: assembly -- where would you begin

    Quote Originally Posted by NathanB View Post
    Perhaps the goal of the course was not to teach about micro controllers? Embedded environments require attention to much more important issues... and, yes, C, Basic, Java, etc. are perfect languages for teaching these concepts.
    Hum... well I did do quite a lot of work on embedded controllers. and IMO several of those languages are far from "perfect". The problems you have to face can include:
    • No operating system available
    • extremely restricted memory
    • program must run from read only memory
    • need to consider concurrency
    • need to handle hardware interrupts
    • need to access volatile hardware register values
    • need to consider latency
    • need to recover gracefully from bugs/malfunction
    • not crash when there is performance overload
    • absence of floating point hardware
    • absence of dynamic memory management
    • absence of standard library
    • Need to write all your own I/O routines for OEM hardware.
    • primitive and buggy cross compilers


    IMO there is no point having a course about embedded controllers that simply looks at how to code correct algorithms. You can do that much better on your desktop.

    The issue of 'beginners' is relevant to this thread, as it is about the didactic value of exposure to assembly level language.

    Frequently I see threads about confusion between pointers and arrays, pass by reference and return by value. Recently there was one that showed they simply had no concept of an immediate value as opposed to a so called constant l-value.

    Personally I feel these things can be explained very clearly in assembler while I also appreciate that Cpt. Picard feels they are best explained at a more abstract level.

    I would compare it to explaining how the internal combustion engine works either in terms of pistons, valves and spark plugs or in terms of exothermic chemical reactions, Boltzman constants and adiabatic thermodynamic processes.

    ... it kind of suggests this might be a subjective question of personal preferences

  7. #37
    Join Date
    May 2007
    Beans
    245
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: assembly -- where would you begin

    Quote Originally Posted by CptPicard View Post
    Compiler theory and authoring of interpreters is an interesting subject (in which an understanding of Lisp is remarkably helpful), but really, other programming languages are not "abstractions from" assembly. All Turing-complete language are equivalent, just different in how they formulate things. Of course we need a physical machine to actually run things in the real world so there needs to be some mapping between the two...
    Quote Originally Posted by matt_symes
    I would not recommend teaching assembly as a first language but rather as an augmentation of other languages to highlight (for one example) constraints placed on a language by its grammar and syntax. (i.e What actually is a cast in C and C++).
    Quote Originally Posted by CptPicard
    How about using Lisp as an example to highlight Assembly's limitations in not having higher-order functions, while Lisp still has the full ability to manipulate state in small steps, if desired?
    One could port Simple Machine Language to Lisp. Perhaps even present it in a cushy interface similar to _why's_ Hackety-Hack?

    http://freshmeat.net/projects/sml

  8. #38
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: assembly -- where would you begin

    Quote Originally Posted by NathanB View Post
    One could port Simple Machine Language to Lisp. Perhaps even present it in a cushy interface similar to _why's_ Hackety-Hack?
    Sure. Implementation wouldn't be difficult either; just underlying registers and a list of modification-statements that are run against those registers.

    An interesting added bonus could be that the student could modify the instruction implementations or something and see what for example the SBCL compiler outputs for the code It's often surprisingly readable, and when optimizing Common Lisp, it's often interesting to see what kind of stuff some particular part gets compiled to.
    LambdaGrok. | #ubuntu-programming on FreeNode

  9. #39
    Join Date
    May 2010
    Location
    uk
    Beans
    9,299
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: assembly -- where would you begin

    Hi

    Well this is not a discussion i am going to get into as it will go around and around ( potentially creating another mega thread ).

    If the OP wants to learn assembler the i, for one, will not try to dissuade him.

    Kind regards
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

Page 4 of 4 FirstFirst ... 234

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
  •