Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Is C# suitable for artificial intelligent systems?

Is C# suitable for artificial intelligent systems?

Scheduled Pinned Locked Moved The Lounge
csharpdotnetquestion
40 Posts 20 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J J Kan

    How well does C# cope for artificial intelligent systems like image and speech recognition? Does the .NET framework make it relatively difficult for practical implementation and slow? :confused::confused::confused:

    L Offline
    L Offline
    Leslie Sanford
    wrote on last edited by
    #9

    Kobby Kan wrote:

    How well does C# cope for artificial intelligent systems like image and speech recognition?

    Consider the algorithms used for image and speech recognition. Then look at C#'s language features and ask yourself if they make it straightforward to implement those algorithms.

    1 Reply Last reply
    0
    • M Member 96

      After all this time working with both managed and unmanaged and reading a lot on the subject I've come to the thinking that: a) I can write code as optimized as necessary in .net much more quickly and easily than in c++. b) I can write code that might ultimately run faster in c++ if I spend unreasonable amounts of time playing with it and optimizing it but the difference will not be perceptible or of interest to the end user and is thus a huge waste of time.


      "The great pleasure in life is doing what people say you cannot do." - Walter Bagehot

      A Offline
      A Offline
      Andy Brummer
      wrote on last edited by
      #10

      That makes complete sense for the areas that you develop in, but you're stating them like they are general principles. Try running that by the guys that write SQL server for instance. They wrote their own thread scheduler because the OS one wasn't good enough for them. 99.95% of the time questions like the OP's are completely misguided but there is still some stuff out there that benefits from more control over memory management. Creating temporary heaps for things like parsing a document can give you some pretty large performance gains as you can essentially ignore memory management and drop the entire heap in one operation when you are done with that document. My C++ days are behind me, and I haven't even considered the need of doing anything like this for years and am very happy working with C#, but I have to admit that the Windows memory APIs gave you some really powerful options, even though the basic C++ new/delete operators were beyond awful for performance.

      I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

      M 1 Reply Last reply
      0
      • J J Kan

        How well does C# cope for artificial intelligent systems like image and speech recognition? Does the .NET framework make it relatively difficult for practical implementation and slow? :confused::confused::confused:

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #11

        Aside from real-time performance, I think you'll find the .NET framework more than adequate for your needs. I'm in the process of porting (from C++) a large rule-based system to .NET and haven't encountered any gotchas. If anything, the programming idioms that C# (and Java) provide make it easier to implement solutions in a more natural and elegant manner, imho. /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        1 Reply Last reply
        0
        • J J Kan

          How well does C# cope for artificial intelligent systems like image and speech recognition? Does the .NET framework make it relatively difficult for practical implementation and slow? :confused::confused::confused:

          C Offline
          C Offline
          Chris Austin
          wrote on last edited by
          #12

          Why don't you prototype your system in C# and see if it can get it done. I don't mean to be flippant about it but there is no real way to answer your question without knowing the software requirements, deployment targets and, target hardware requirements.

          Kobby Kan wrote:

          Does the .NET framework make it relatively difficult for practical implementation and slow?

          I've found that .net is well suited for business oriented tasks. I've also found it sourly lacking for developing 3D simulations. I've never tackled speech recognition so I can't say. One thing I'd look at if I were you is the amount of existing libraries that you'd be using. The only way I really learned was to try it.

          A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. - -Lazarus Long

          modified on Monday, May 26, 2008 12:38 PM

          1 Reply Last reply
          0
          • A Andy Brummer

            That makes complete sense for the areas that you develop in, but you're stating them like they are general principles. Try running that by the guys that write SQL server for instance. They wrote their own thread scheduler because the OS one wasn't good enough for them. 99.95% of the time questions like the OP's are completely misguided but there is still some stuff out there that benefits from more control over memory management. Creating temporary heaps for things like parsing a document can give you some pretty large performance gains as you can essentially ignore memory management and drop the entire heap in one operation when you are done with that document. My C++ days are behind me, and I haven't even considered the need of doing anything like this for years and am very happy working with C#, but I have to admit that the Windows memory APIs gave you some really powerful options, even though the basic C++ new/delete operators were beyond awful for performance.

            I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

            M Offline
            M Offline
            Member 96
            wrote on last edited by
            #13

            Interestingly in every online debate about any subject someone always brings up a rare edge condition case and uses it to cast FUD on an assertion, but in fact 99.95% of us are *not* writing sql server or guided missle control software or a game engine so while there is generally a grain of truth on all sides I still think the majority of developers won't find their .net app to be any slower than their unmanaged app. :) Here's some further proof: Jeff atwoods very concise summary: http://www.codinghorror.com/blog/archives/000299.html[^] A meta link to the overall description of the process: http://blogs.msdn.com/jonathanh/archive/2005/05/20/optimizing-managed-c-vs-native-c-code.aspx[^]


            "The great pleasure in life is doing what people say you cannot do." - Walter Bagehot

            A 1 Reply Last reply
            0
            • C Colin Angus Mackay

              Kobby Kan wrote:

              Does the .NET framework make it relatively difficult for practical implementation and slow?

              What is it with people who complain that .NET is slow? I recently saw a presentation called "Writing Crap Code in C# - Anti-patterns for performance" and the presenter showed various examples of crap code and how they were hurting performance. In some cases people actually thought the slow version should be the best performing until he showed them the numbers. So, if your C# (or any .NET code) is slow then perhaps you might want to look at your own coding style before bitching on .NET.

              Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) - (part 3) My website | Blog

              J Offline
              J Offline
              Jorgen Sigvardsson
              wrote on last edited by
              #14

              Colin Angus Mackay wrote:

              What is it with people who complain that .NET is slow?

              Because it's true? :~ By definition, managed code must be slower than native code - assuming both code bases may utilize optimizations. Granted, .NET apps are quite a lot faster than the comparative java applications, but it's not as fast as a well written Win32 app.

              N R M L 4 Replies Last reply
              0
              • G Gary R Wheeler

                It's too bad you didn't ask for VB. The responses would have been hysterical.

                Software Zen: delete this;
                Fold With Us![^]

                J Offline
                J Offline
                Jorgen Sigvardsson
                wrote on last edited by
                #15

                Homer Simpson style AI would probably be doable in VB. Doh! Doh! Doh! Doh! Doh! Doh! Doh! Doh! Doh! Doh! Doh! Doh! Doh! Doh!

                N 1 Reply Last reply
                0
                • M Member 96

                  Interestingly in every online debate about any subject someone always brings up a rare edge condition case and uses it to cast FUD on an assertion, but in fact 99.95% of us are *not* writing sql server or guided missle control software or a game engine so while there is generally a grain of truth on all sides I still think the majority of developers won't find their .net app to be any slower than their unmanaged app. :) Here's some further proof: Jeff atwoods very concise summary: http://www.codinghorror.com/blog/archives/000299.html[^] A meta link to the overall description of the process: http://blogs.msdn.com/jonathanh/archive/2005/05/20/optimizing-managed-c-vs-native-c-code.aspx[^]


                  "The great pleasure in life is doing what people say you cannot do." - Walter Bagehot

                  A Offline
                  A Offline
                  Andy Brummer
                  wrote on last edited by
                  #16

                  Thanks for restating my post. Actually given the "average" developer, their managed app would probably be faster then their unmanaged app, and about a million times more stable. :laugh: All, I'm saying is that just because John C doesn't have a need for something, doesn't mean that everyone doesn't have a need for something. I just tried to back it up with some real world examples where custom memory management can make a significant difference. Maybe I miss some of the moments I had in the past where I optimized something then sat back going holly crap was it really that fast. Anyway, as far as performance goes, it's pretty simple. Figure out what you need before you start developing and test along the way, which is exactly what Rico recommends.

                  I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                  M 1 Reply Last reply
                  0
                  • J Jorgen Sigvardsson

                    Colin Angus Mackay wrote:

                    What is it with people who complain that .NET is slow?

                    Because it's true? :~ By definition, managed code must be slower than native code - assuming both code bases may utilize optimizations. Granted, .NET apps are quite a lot faster than the comparative java applications, but it's not as fast as a well written Win32 app.

                    N Offline
                    N Offline
                    Nemanja Trifunovic
                    wrote on last edited by
                    #17

                    Jörgen Sigvardsson wrote:

                    Because it's true?

                    Amen.

                    Jörgen Sigvardsson wrote:

                    Granted, .NET apps are quite a lot faster than the comparative java applications

                    I haven't seen any difference between Java and .NET. Both are slow and both consume memory like crazy.

                    Programming Blog utf8-cpp

                    J 1 Reply Last reply
                    0
                    • N Nemanja Trifunovic

                      Jörgen Sigvardsson wrote:

                      Because it's true?

                      Amen.

                      Jörgen Sigvardsson wrote:

                      Granted, .NET apps are quite a lot faster than the comparative java applications

                      I haven't seen any difference between Java and .NET. Both are slow and both consume memory like crazy.

                      Programming Blog utf8-cpp

                      J Offline
                      J Offline
                      Jorgen Sigvardsson
                      wrote on last edited by
                      #18

                      Nemanja Trifunovic wrote:

                      I haven't seen any difference between Java and .NET. Both are slow and both consume memory like crazy.

                      I might be singling out a specific case: GUI. .NET GUIs feel more responsive than Java GUIs. On the other hand, .NET doesn't have the cross platform baggage as Java does.

                      1 Reply Last reply
                      0
                      • J J Kan

                        How well does C# cope for artificial intelligent systems like image and speech recognition? Does the .NET framework make it relatively difficult for practical implementation and slow? :confused::confused::confused:

                        N Offline
                        N Offline
                        Nemanja Trifunovic
                        wrote on last edited by
                        #19

                        Kobby Kan wrote:

                        How well does C# cope for artificial intelligent systems like image and speech recognition?

                        Don't know about speech recognition, but I used to work with machine translation a lot, and all our prototypes with C# (and Java for that matter) showed that it is not a good language for the task - not so much because of the speed, but because of memory consumption.

                        Programming Blog utf8-cpp

                        1 Reply Last reply
                        0
                        • J Jorgen Sigvardsson

                          Colin Angus Mackay wrote:

                          What is it with people who complain that .NET is slow?

                          Because it's true? :~ By definition, managed code must be slower than native code - assuming both code bases may utilize optimizations. Granted, .NET apps are quite a lot faster than the comparative java applications, but it's not as fast as a well written Win32 app.

                          R Offline
                          R Offline
                          Roger Alsing 0
                          wrote on last edited by
                          #20

                          >>managed code must be slower than native code Its not like we are dealing with old interpreted bytecode. The jitter outputs native code. If you go C style in C# with lookup arrays and all that stuff, then you get pretty nice speed. Just take a look at #ziplib, its extremely fast. (if you look at the implementation you will see that its not very .NET'ish, pretty much only working with arrays and oldschool tricks)

                          My Blog

                          J 1 Reply Last reply
                          0
                          • R Roger Alsing 0

                            >>managed code must be slower than native code Its not like we are dealing with old interpreted bytecode. The jitter outputs native code. If you go C style in C# with lookup arrays and all that stuff, then you get pretty nice speed. Just take a look at #ziplib, its extremely fast. (if you look at the implementation you will see that its not very .NET'ish, pretty much only working with arrays and oldschool tricks)

                            My Blog

                            J Offline
                            J Offline
                            Jorgen Sigvardsson
                            wrote on last edited by
                            #21

                            Reiterations of .NET/Java/et al may be faster than their predecessors, but they won't produce code as fast as native code.

                            R 1 Reply Last reply
                            0
                            • A Andy Brummer

                              Thanks for restating my post. Actually given the "average" developer, their managed app would probably be faster then their unmanaged app, and about a million times more stable. :laugh: All, I'm saying is that just because John C doesn't have a need for something, doesn't mean that everyone doesn't have a need for something. I just tried to back it up with some real world examples where custom memory management can make a significant difference. Maybe I miss some of the moments I had in the past where I optimized something then sat back going holly crap was it really that fast. Anyway, as far as performance goes, it's pretty simple. Figure out what you need before you start developing and test along the way, which is exactly what Rico recommends.

                              I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                              M Offline
                              M Offline
                              Member 96
                              wrote on last edited by
                              #22

                              Yup, I agree. Somehow the way I state things seems to trigger this response in people. :) Probably because I tend to skip ahead rather than connecting all the points to get to the inevitable conclusion anyway. Drives my wife crazy, she's a serial thinker, I'm a random access thinker. Makes for a good combination most of the time. I fully understand that the edge conditions are out there, just not terribly relevant for a general purpose programming site such as this one and they tend to bring the discourse to a grinding halt for no useful purpose.


                              "The great pleasure in life is doing what people say you cannot do." - Walter Bagehot

                              A 1 Reply Last reply
                              0
                              • J Jorgen Sigvardsson

                                Colin Angus Mackay wrote:

                                What is it with people who complain that .NET is slow?

                                Because it's true? :~ By definition, managed code must be slower than native code - assuming both code bases may utilize optimizations. Granted, .NET apps are quite a lot faster than the comparative java applications, but it's not as fast as a well written Win32 app.

                                M Offline
                                M Offline
                                Member 96
                                wrote on last edited by
                                #23

                                I disagree entirely from a practical perspective. In all ways that matter in the real world, performance is entirely due to the quality of the design and the developer who implements it and is entirely unrelated to the platform it runs on or language it was written in.


                                "The great pleasure in life is doing what people say you cannot do." - Walter Bagehot

                                1 Reply Last reply
                                0
                                • M Member 96

                                  Yup, I agree. Somehow the way I state things seems to trigger this response in people. :) Probably because I tend to skip ahead rather than connecting all the points to get to the inevitable conclusion anyway. Drives my wife crazy, she's a serial thinker, I'm a random access thinker. Makes for a good combination most of the time. I fully understand that the edge conditions are out there, just not terribly relevant for a general purpose programming site such as this one and they tend to bring the discourse to a grinding halt for no useful purpose.


                                  "The great pleasure in life is doing what people say you cannot do." - Walter Bagehot

                                  A Offline
                                  A Offline
                                  Andy Brummer
                                  wrote on last edited by
                                  #24

                                  Though, for purposes of this discussion, AI might be one of those edge cases, though I doubt there will be any practical difference between a fast AI engine and a slow AI engine. ;P So far I think Chris has had the best response, get off your butt and try both of them and see. I kinda had that somewhere in my reply to the OP, but it got lost in my rambling, which is something that drives my wife batty.

                                  I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                                  M E 2 Replies Last reply
                                  0
                                  • A Andy Brummer

                                    Though, for purposes of this discussion, AI might be one of those edge cases, though I doubt there will be any practical difference between a fast AI engine and a slow AI engine. ;P So far I think Chris has had the best response, get off your butt and try both of them and see. I kinda had that somewhere in my reply to the OP, but it got lost in my rambling, which is something that drives my wife batty.

                                    I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                                    M Offline
                                    M Offline
                                    Member 96
                                    wrote on last edited by
                                    #25

                                    Yeah, AI is definitely an edge case but if it were me I'd approach it by looking for good AI libraries with .net interfaces to tie the whole thing together into a real world application. My days of writing the framework are definitely behind me, all my interest is in the end result. I used to be fascinated by that stuff but I guess I'm just not an engineer at heart, I want to change the world, not write the tools that others use to change the world.


                                    "The great pleasure in life is doing what people say you cannot do." - Walter Bagehot

                                    E A 2 Replies Last reply
                                    0
                                    • J Jorgen Sigvardsson

                                      Reiterations of .NET/Java/et al may be faster than their predecessors, but they won't produce code as fast as native code.

                                      R Offline
                                      R Offline
                                      Roger Alsing 0
                                      wrote on last edited by
                                      #26

                                      Just because it is "not as fast" doesnt mean that is slow. Languages like Ruby are slow.. C# is doing pretty damn good considering all the safety belts and training wheels that the managed environment offers.

                                      My Blog

                                      L 1 Reply Last reply
                                      0
                                      • J Jorgen Sigvardsson

                                        Colin Angus Mackay wrote:

                                        What is it with people who complain that .NET is slow?

                                        Because it's true? :~ By definition, managed code must be slower than native code - assuming both code bases may utilize optimizations. Granted, .NET apps are quite a lot faster than the comparative java applications, but it's not as fast as a well written Win32 app.

                                        L Offline
                                        L Offline
                                        l a u r e n
                                        wrote on last edited by
                                        #27

                                        Jörgen Sigvardsson wrote:

                                        but it's not as fast as a well written Win32 app.

                                        i think that's john's point ... that most "programmers" couldn't write a well designed and implemented win32 app if their lives depended on it ... the whole idea of frameworks was that the really good people can write stuff that the not necessarily so good people can use to get useful work done ... not optimized win32 c++ apps

                                        "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

                                        1 Reply Last reply
                                        0
                                        • E Ed Poore

                                          I wish I could remember where I found it but someone did some quite extensive testing on .NET performance and in some crucial areas it was actually faster than C++ because of the JIT inlining. I think he left the defaults on for "optimisation". Of course if everything was optimised by hand then C++ would be faster but then what's the point, why not just write assembly? :rolleyes:


                                          I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder

                                          N Offline
                                          N Offline
                                          Nemanja Trifunovic
                                          wrote on last edited by
                                          #28

                                          Ed.Poore wrote:

                                          Of course if everything was optimised by hand then C++ would be faster but then what's the point, why not just write assembly?

                                          Sometimes it does make sense to use assembly. Having said that, assembly is too un-portable for most scenarios; well optimized C(++) code compiles to very good machine code on many different hardware platforms - assembly often needs to be re-written.

                                          Programming Blog utf8-cpp

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups