semantics

This is a discussion on semantics within the Tech Board forums, part of the Community Boards category; what is ment by semantics in software terminology...

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    13

    semantics

    what is ment by semantics in software terminology

  2. #2
    Registered User Rennor's Avatar
    Join Date
    Aug 2006
    Location
    Finland
    Posts
    45
    http://en.wikipedia.org/wiki/Semantic

    Do I need to say more?

  3. #3
    Registered User
    Join Date
    Jul 2006
    Posts
    13
    thank you

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,467
    Hmm... actually there is something more to be said. I don't think that wiki entry is that helpful for someone wanting to understand the meaning of the word when applied to computer programming since it does little to explore that area.

    However my understanding of what it is my also be flawed. I'm sure anyone will correct me if the following is inaccurate.

    Code semantics refers the meaning of code constructs. More exactly the meaning is conveyed by what can be done with those constructs and how they affect the program. In programming these constructs can be user-defined or language defined. If user-defined (classes), the class has its semantics defined when it defines its public interface. If language defined, the construct is generally one that affects the meaning of other constructs (pointers, references), or it is a general concept involving a program paradigm (reference semantics, value semantics,...)

    Basically semantics can be perceived by how an object or a language construct is perceived by you the coder and how it affects the syntax involved in order to convey that meaning.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Semantics, although in principle it always means the same thing, is in the details highly dependent on the context.

    Typically, you have two parts in analyzing a language, its syntax and its semantics. Syntax, the grammar, is about how the elements of the language can be correctly arranged. Semantics define what, if anything, a particular arrangement means.

    The semantics of a program are the sum of its parts and they way they're interconnected. You can (in theory) find out what every program does by analyzing its parts and how they interact.

    Both the C and C++ standards define precisely what program semantic means in terms of the C or C++ languages. They define the semantics of the program as the observable behaviour of it, i.e. the sequence of calls to I/O functions and reads from/writes to the volatile variables. Neither standard defines a way to mark an I/O function, though.
    The interesting thing here is that every language implementation is free to do nearly whatever it wants with your code, as long as the semantics as defined by the standards remain the same.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Crazy Assignment Operator Semantics
    By SevenThunders in forum C++ Programming
    Replies: 7
    Last Post: 01-22-2009, 12:08 PM
  2. List copy semantics efficiency
    By dudeomanodude in forum C++ Programming
    Replies: 31
    Last Post: 05-24-2008, 05:05 PM
  3. semantics and syntaxes
    By kk01 in forum C++ Programming
    Replies: 3
    Last Post: 01-04-2008, 06:02 AM
  4. File IO with .Net SDK and platform SDK
    By AtomRiot in forum Windows Programming
    Replies: 5
    Last Post: 12-14-2004, 09:18 AM
  5. iterator semantics
    By CornedBee in forum C++ Programming
    Replies: 8
    Last Post: 01-10-2004, 11:21 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21