The use of programming in artificial intelligence - c++

What are the programming languages we can use in the development of an artificial intelligent system? which operating system should be used? can C or C++ programming languages be used?

What are the programming languages we can use in the development of an artificial intelligent system?
Prolog is a good start for reasoning systems. Lisp is a good start for symbolic systems. Both of those can be embedded in other languages, e.g., C++.
which operating system should be used?
Er.... any?
can C or C++ programming languages be used?
Yes.
You probably want to learn more about programming before you tackle AI.

Definitely. And it's a good choice too, because it can be made pretty well performing (which is the main problem in developing a good AI).
But there is no limitation, really. Any language will do.

Just about any language can be used but you want one that works well with your specific domain, and you are comfortable with using.
As already mentioned, PROLOG and LISP are both traditional AI languages. General purpose languages such as Java, C#, and C++ also have their uses.
Also if you are looking at aural language processing, then a language that is good at text processing and data structures would be ideal. Eg. Python and the NLTK toolkit.

Although some languages are more strongly associated with AI programming than others -- e.g., LISP, Prolog -- many different languages can be used.
Any of the general-purpose operating systems may be used.
You can use a procedural language like C. An OO language like C++, Java or C# offers some advantages. Functional and logical languages are also worth considering.
Personally, I've written one A-B game-playing program now in LISP, Java and C#.

Any language can be used to develop Artificial Intelligence, AI, applications; some make implementing the AI concepts easier than others.
Some old time favorites are LISP and Prolog.
If you are well versed in C or C++, then use either one to implement the concepts.

When you want to learn AI programming you should pick a language where you can concentrate on the problem domain instead of the language.
For example in a typical C program about half of the code concerns itself with memory management and error handling. By using a language that supports garbage collection and exceptions you can reduce this amount drastically.
The choice of language also depends on prior works. Are there any or do you want to start from scratch? If the prior works seem to be good, you can hope that they already chose an appropriate language.

It depends on the niche you are interested in, but C++ is probably the most popular language for artificial intelligence. You will find that most libraries are written for it.
You can use languages other than C++, too. Functional languages, such as LISP and F# are good choices for AI, because they offer good tools for decomposing complicated logic.
The operating system is not much of an issue. Whether you choose Windows, Unix, or Mac, you will find a few libraries that are not cross-platform and unavailable for your platform.

Related

Lisp dialect and comparison to Java/C#

Now I'm generally in Java/C# (love both of them, can't really say I'm dedicated to one).
And I've recently been discussing the differences between F# and C# with a friend, when he surprised me saying: "So.. F# sounds a lot like lisp, but with way less 'Swiss-army knife' feel to it."
Now, I was partly ashamed of saying this but I have no idea what lisp was.
After some searching, I saw that lisp is very interesting, but got stumped by the multiple dialects and running environments.
Here is what I know:
I know of 3 dialects:
Common Lisp (I have the Practical Common Lisp book in my bookmarks.
Scheme (a more "theoretical" version of CL)
Clojure. Seems to be a version of CL that runs on JVM.
The basic idea of lisp seems to be about using code as data.
What I want to know:
What is the running environment for different dialects? How do they work/get installed (by this I mean is it a runtime like Java Virtual Machine, or if it requires something else, or if it's supported generally by the OS (as in compiled)). And how to get them (if something is to be gotten)
What is the better dialect to learn (I want the dialect not to be a "learning language" but one you can fully use afterwards without regret of not learning some other one, for example one should first learn C++ before trying out Visual C++, if you know what I mean)
What are the main advantages of lisp in general (I've seen many pages about that saying it's faster in development and execution, but they were all pretty vague about the details)
Can it be generally used for general purpose, or is it concentrated on AI? (By this I mean if, for example, one could make a full console app with it, and then implement OpenGL just as easily and make a game. Learning a language specialized on something precise is worthwhile, but not at the moment for me)
I would also be very happy about any additional details you guys can give me! (Links are appreciated too! E-Books and whatnot.)
Edit: all of the answers here were very useful. As such, I gave them all a +1 to rep, but chose the more concrete one as best. Thank you all.
I also learnt Java and C# intensively before coming to Lisp so hopefully can share some useful perspectives.
Firstly, all Lisps are great and you should definitely consider learning one. There's a famous quote by Eric Raymond:
"Lisp is worth learning for the profound enlightenment experience you
will have when you finally get it; that experience will make you a
better programmer for the rest of your days, even if you never
actually use Lisp itself a lot."
Reasons that Lisps are particularly interesting and powerful are:
Homoiconicity - in Lisp "code is data" - the language itself is written in Lisp data structures. In itself this is interesting, but where it gets really powerful is when you start using this for code generation and advanced macros. Some believe that this features is a key reason why Lisp can help you be more productive than anyone else (short Paul Graham essay)
Interactice development at the REPL - a few other languages also have this, but it is particularly idiomatic and deep-rooted in Lisp culture. It's remarkably productive and liberating to develop while altering a live running program. Recent examples that caught my eye include music hacking with overtone and editing a live game simulation.
Dynamic typing - opinion is more divide on whether this is an advantage or not (I'm personally neutral) but many people thing that dynamically typed langauges give you a productivity advantage, at least in terms of building things quickly. YMMV.
My personal recommendation for a Lisp to learn nowadays would be Clojure. Clojure has a few distinct advantages that make it stand out:
Modern language design - Clojure "refines" Lisp in a number of ways. For example, Clojure adds some new syntax for vectors [] and hashmaps {} in addition to lists (). Purists may disapprove, but I personally believe these find of innovations make the language much nicer to use and read.
Functional first and foremost - all the Lisps are good as functional languages, however Clojure takes it much further. All the standard library is written in terms of pure functions. All data structures are immutable. Mutable state is strictly limited. Lazy sequences (including infinite sequences) are supported. In some senses it feels a bit more like Haskell than the other Lisps.
Concurrency - Clojure has a unique approach to managing concurrency, supported by a very good STM implementation. Worth watching this excellent video for a much deeper explanation.
Runs on the JVM - whatever you think of Java, the JVM is a great platform with extremely good GC, JIT compilation, cross platform portability etc. This can be a barrier to entry for some, but anyone used to Java or C# should quickly feel at home.
Library ecosystem - since Clojure runs on the JVM, it can use Java libraries extremely easily. Calling a Java API from Clojure is trivial - it's just like any other function call with a syntax of (.methodName someObject arg1 arg2). With the availability of the huge Java library ecosystem (mostly open source) Clojure basically leapfrogs all the "niche" languages in terms of practical usefulness
In terms of applications, Clojure is designed to be a fully general purpose langauge so can be used in any field - certainly not limited to AI. I know of people using it in startups, using it for big data processing, even writing games.
Finally on the performance point: you are basically always going to pay a slight performance penalty for using higher level language constructs. However Clojure in my experience is "close enough" to Java or C# that you won't notice the difference for general purpose development. It helps that Clojure is always compiled and that you can use optional type hints to get the performance benefits of static typing.
The flawed benchmarks (as of early 2012) put Clojure within a factor of 2-3 of the speed of statically typed languages like Java, Scala and C#, a little bit behind Common Lisp and a little bit ahead of Scheme (Racket).
Lisp, as you've discovered, is not one language; it's a family of languages that have certain features in common.
There are two primary dialects of Lisp: Common Lisp and Scheme. Each of those two dialects has many implementations, each with their own features. However, both Common Lisp and Scheme are standardized, and the standards define a certain baseline of features which you can expect any implementation to have.
Scheme is a minimalistic language with a very small standard library. It is used primarily by students and theoreticians. Common Lisp has many more language features and a much larger standard library, including a powerful object system, and has been used in large production systems.
Clojure is another minor, more recent dialect. If you want to understand Lisp, you're better off first learning either Common Lisp or Scheme.
My recommendation is to learn Scheme first; it's a purer expression of the ideas that Lisp is made of, and will help you understand the essence of the language. In many ways, Lisp is completely different from Java and other imperative languages; however, what you learn from it will make you a better programmer in those languages. You can easily learn Common Lisp after you know Scheme.
The advantage of Lisp is, simply put, that it's more powerful than other languages. All Lisp code is Lisp data and can be manipulated as such; this allows you to do really cool things with metaprogramming that simply can't be done in other languages, because they don't give you direct access to the data structures that comprise your code. (The reason Lisp can do this and they can't is intimately related to its strange-looking syntax. Every compiler or interpreter, after reading the source code, must translate it into abstract syntax trees. Unlike other languages, Lisp's syntax is a direct representation of the ASTs that Lisp code is translated into, so you know what those trees look like and can manipulate them directly.) The most commonly used metaprogramming feature is macros; Lisp macros can literally translate a bit of source code into anything you can program. You can't do that with, say, C macros.
The "faster in development and execution" thing may have been a reference to one specific feature which most Lisp implementations provide: the read-eval-print loop. You can type an expression into a prompt and the interpreter will evaluate it and print the result. This is wonderful both for learning the language and for debugging or otherwise investigating code.
Lisp is dynamically typed (though statically typed flavors do exist). Most implementations of Lisp run on their own virtual machine; however, many can also be compiled to machine code. Clojure was written specifically to target the JVM; it can also target .NET and JavaScript.
Though originally created for AI research, Lisp is by no means exclusively for AI. The main reason why it's not more popular in mainstream production environments (apart from the self-perpetuating dominance of Java and C#) is library support. Common Lisp has many good libraries out there (Scheme less so), but it pales in comparison to the vast amount of library support available for Java or Python.
If you want to get started, I recommend downloading Racket, a highly popular implementation of Scheme. It has everything you need, including a simple-but-very-powerful IDE with a read-eval-print loop, right out of the box. Though originally developed as a teaching language, it comes with a very large standard library more characteristic of Common Lisp than of Scheme. As a result, it's seeing use in real production environments.
Runtime Environments
Common Lisp and Scheme generally have their own unique runtime environments. There are some variants of Scheme (Chicken and Gambit) which can be translated to C and then linked with their environments so as to be able to be deployed as stand alone executable programs. Clojure runs in the JVM, and there is also a CLR port, but its not clear to me that the CLR port is current with the JVM. Clojure also has Clojurescript, which targets a Javascript runtime.
Which is Better to Learn First
I don't think that question has a good answer. Its up to you. Although if you have experience with the JVM, Clojure might be a bit smoother to start with.
What is Better about Lisp
That's a question liable to start a flame war. I don't have much lisp experience. I started learning Clojure a few months ago in earnest, have looked at Common Lisp and Scheme on and off over the years.
What I like is their dynamic natures. You need to change a function at runtime while your program is running? No problem! Like any power tool, you have to be careful not to chop your bits off when using this.
The power and expressiveness is addicting too. I am able to do some things with little effort that I know I could not achieve in Java, or I know would require a lot more work. Specifically, I was able to put together a description of a data structure - and though the use of macros, delay evaluation of parts of the data until the right time. If I had done that in Java, I would not have been able to nest the declarations like I did because they would have evaluated in the wrong order. Pain would have ensued.
I also like Clojure's view of functional programming, although I have to say it requires work to adjust.
Is Lisp General Purpose
Yes.
--
Mark Volkman has a really good article on Clojure. Many basics are there. One thing that I did in the beginning was to just fire up a repl and experiment when I needed to figure something out programmatically. e.g. explore an API or do some calculations. After a short period of time with that I started working on more building up levels of effort, and I have a project that I'm working on right now that involves Clojure.
There isn't a bad book about Clojure that has been written. The Stuart Sierra book is being updated; and the Oreilly book is about to come out soon, so you might want to wait. The Joy of Clojure is good, but I don't think its a good starter book.
For Common Lisp, I highly recommend the Land of Lisp.
For Scheme, there are several classics including The Little Schemer and SICP.
Oh, and this: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey (maybe one of the most important talks you'll ever watch), and this http://www.infoq.com/presentations/hickey-clojure (IIRC, really good intro to Clojure).
common lisp
Common Lisp is both compiled and interpreted. Deployments (in Windows) can be done by an exe with DLLs. Or by a precompiled bytecode. Or by installing a Lisp system on the target device and executing the source against it.
Common Lisp is a fully usable industrial language with an active community and libraries for many different tasks.
Lisps are generally faster for development and due to the abstraction capabilities, better at developing higher level concepts. It's hard to explain. Ruby vs. C is an example of this sort of thing. All Lisps carry this capacity IMO.
Common Lisp is a general purpose language. I don't know offhand if modern Common Lisp implementations directly support executing assembly, so it may be difficult to write drivers or use compiler-unsupported CPU instructions.
I like Common Lisp, but Clojure and Racket are not to be sneezed at either. Clojure in particular represents a very interesting track, in my opinion.
For e-books, you can get On Lisp by Graham and Gentle Introduction to Symbolic Computation. Possibly others but those are the ones I can recall.

Absolute beginning in programming [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have worked for the last 10 years in Networking & Web Development and always had an interest in programming. When I was in School I started in Basic, (To date myself) the other languages at that time were Cobol & Fortran, Where should I start in 2009? is C+ or C++ a good place? Is it better to Start Java or .net? I'm in need of some direction from Coders, Programmers, developers who can point me in the right direction. The technology changes in the blink of an eye, I'd like a good starting point to begin learning & understanding relevant code.
I think your best bet is to learn Python because
It is simple and easy language to learn
Python is capable of doing what any other main stream language can do
Python is also a very good choice for web development, with good frameworks like Django, Pylons, Turbogears etc
Google uses Python and using google appengine you could be able to quickly write web applications.
Python is also great for cross-platform desktop applications using wxPython, PyQT, Tkinter,gtk etc
Python has very rich set of libraries and frameworks e.g. PIL for imaging, numpy for computing, twisted for networking etc etc etc
Python has implementation in Java and .NET so you can program for those platforms in Python
I agree with most of the posts on here but I would like to add my own slant on this. Learning a programming language should change the way you think about programming and allow you to make useful programs. The list below is a mix of easy to learn (the basics) and helps you think about programming problems
Python it makes programming fun and easy. You will learn a lot about programming and make some cool programs in a relatively small amount of code. Will help you think about programs at a higher level than C which is a good thing.
C it's the basis of a massive number of languages and will teach you a good deal of stuff that is now considered low level. Stuff that will be useful for any programmer to know.
Haskell its a functional language which will have you thinking about programming from a different perspective. It is very useful to know this stuff - can help reduce many bugs.
I would start by gaining a basic knowledge. i.e. be able to make a text based Connect 4 game in each of these three languages (in order). Which books help you do that is largely personal preference.
Programming is not only about the code and the language. It's about everything you do at the computer read The Pragmatic Programmer and Code Complete 2. Extra points for SICP and Hacker's Delight
From there if you want to know more about how programming languages work by writing a interpreter for Scheme (by reading SICP again) And/or look at FORTH. Or learn more about how to program by writing more and more programs. Once you get basic knowledge write, then re-write as many different computer programs as you can.
It all depends on your focus.
If you're looking at getting into straight development, I would recommend C#, Java or C++. (C++ is a learning curve though, and would be great to "learn", whereas C# and Java will get you started a lot quicker in doing "cool" things)
If you're looking at Web Development, look into PHP (as it's free to setup and run with) or ASP.NET (which will link to platform at a point, as you use C# or VB.NET syntax).
If you're looking at something different, have a look at ERLANG or Prolog, or those types, however I don't recommend it for a start, as it's not AS quick to get results that you might be looking for.
You'll get a dozen different people all pushing you to learn their favourite language.
When it comes down to it though it doesn't make a lot of difference. As long as you pick something that is modern and object oriented you should be fine.
Assuming you are talking about programming and not web development, any of the following would be a perfectly acceptable first language:
C#
Java
Python
C++
Ruby
VB.net (not VB6)
There are advantages and disadvantages to each; there probably aren't as many jobs in Python and Ruby, C++ is harder for a beginner, but it's stuff you need to know eventually, C#/Java hide you from that hard stuff to begin with, but like I said you'll need to learn it eventually. VB.net is derived from BASIC syntax so you might feel at home to begin with, but a lot of programmers prefer C style syntax.
If you have a specific focus in mind, then that might dictate some choices over others, but if you are just out to learn programming, then any will do. If you are ever planning on being a good programmer you will naturally learn several.
Well, technically, technology doesn't change in the blink of an eye. For instance:
Lisp: Came out in 1958. It's always had a cult following in various fields, but it's becoming more hip now with the clojure variant.
C: Came out in 1972. Obviously influences C++, Java, JavaScript (as does lisp), and still has a strong following.
Smalltalk: Came out in the 70's. Now it's hip via the ruby language.
I'm not suggesting you learn these, just that if you had learned them in the past, you'd still have relevant skills. Many of the modern languages actually take aspects from past languages. JavaScript, for instance, is a scripting language with object oriented aspects (Smalltalk, C++), functional aspects (lisp), and the syntax of C.
Learn what you're interested in, and find out what will help you accomplish your goals . But learn one and you can learn many.
The question is what you want to achieve in learning a programming language.
Do you want to get used to the basics? Then you might want to try a scripting language like Ruby or PHP. I would recommend Ruby as it's really easy to learn and advance (e.g. with IRB).
Want to write "fat" (desktop) applications? Then you should stick to C++, Java or C#.
For web applications you should use Ruby on Rails, Django (Python) or a similar web framework for the language of your choice. So you should already know a bit of the language.
C
Because it's not difficult to learn. TO LEARN, not to do "cool things".
Because is the languague that any good programmer SHOULD KNOW at least if he wants to know what's happening in the machine.
When you've learned C, then you should go to OOP: I would recommend C++ or Java, but there are a lot of OPP languages (C#, .Net), so you can choose.
Java, C++ may change a lot, but not C. So, first learn C.
Furthermore, if you want to do some Web Development, the step C -> PHP is trivial, really.
PD: C is not my favourite language, but I know that if you learn C, you will be able to learn any language you want in very few time.
Nobody can really tell you which language you should learn. Just try a few of them and then decide for yourself. Just take the one that you like the most.
Of course I wouldn't start learning a language that's already "dead", but every modern language is good for something. What you should actually do is to decide in which area of programming you want to code - so, for example, would you like to develop desktop or web applications, should the program run on any platform or are you fine with just windows or just linux or whatever. When you have decided on that, take a look at the languages that are commonly used for the area you choose and try all/many of them. Then take the language you like the most.
Read and do the assignments in The C Programming Language before anything else. It will really help you get a solid grip on fundamentals and some of the trickier issues like memory management. Then go on to OOP whether it be Java, .NET, C++ or Python.
If you start in C you'll have a tougher time starting out but will learn a lot more by the time you understand the language as compared to starting with another language. C won't teach you Object-Oriented Programming though, so after C it would be easy to move to C++ and learn the differences and then about Objects. A good book to learn C from is The C Programming Language.
Or you could go a route where you start off easier so things aren't so frustrating to start, learn a bit less, and then slowly pick up more and more about programming. You could start with Python and understand the basics of programming very quickly, and then start expanding what you know by learning other languages.
I personally started with C++, which then made a lot of other higher level languages, like Python, super easy to learn. If you want to start out learning more of the basics of programming I would probably recommend C++ first as it is a bit easier than C, and then you can learn C afterwards and it will be a bit easier, and then it'll be super easy to pick up something like Python, Java, Ruby, etc.
I think choosing a language or technology is overrated, especially when you have to learn fundamental things like object orientation or algorithms. Try to focus on the basics first and especially try to use more than one language.
In order to understand the concepts you should at least learn a dynamic language (Ruby, Python, PHP) and a "traditional" one (I would recommend either Java or C#). Functional languages are all at rage now and provide a different view onto programming than the latter two approaches.
New technologies are always nice to know, but in the end a good set of fundamental knowledge will empower you to learn them faster than they disappear.
I would say there is a massive difference between a Programming language & a Programming Language + Framework(s), usually when people say Learn Language X they are probably thinking about the Framework(s).
So if you want to actually Learn to program, try to learn the language with as little framework 'baggage' as possible, perhaps C?
Once you have gained enough working knowledge of a programming language (eg variables, loops, conditions) then move onto more broader subjects like OOP, then start looking at functional style etc.
From personnel experience I would say try and learn as many programming languages as possible (it actually gets easier the more you learn) but you will never master them all, just have enough to get by.
You will then realise that the language is the easy part, the framework and related methodology is what your actually learning when going from one language to another.
Much as I love Delphi, I think I would suggest either Java or Python. Why? Assuming you are learning on your own, I think these languages have the clearest texts and web sites for learning on your own (esp. Java).
Seeing that you're coming from two different fields (networking and web development) you can either work your way top down or bottom up in terms of high- or low level languages. If you think you want to make use of your networking knowledge (which I assume is pretty close to hardware), you might want to start with something like C, maybe Unix network programming. If you want to build on your web developer skills, you might want to try something more high level. I think Python is a good suggestion, but also Java - maybe in combination with JSP. C# would be a good choice too in my eyes.
Don't forget about platform. Are you most interested in web, mobile, or desktop development? As for languages, there are a ton out there and you'll never be able to learn them all. So I think you should determine what your goal is and whether you plan to program for fun, profit, or both. But most important of all, be sure the journey is fun for you and that you're building stuff you love.
A good reason to learn Java - besides the fact it's currently the most popular language - is that the Java Trails tutorials are really good, and really far-reaching.
C# is very, very similar to Java in most regards; also interesting to learn, and it's gaining marketshare while Java slows down.
Other than those two, I'd also strongly consider Python, for being easy to learn and very, very useful personally and professionally.

Using VB for Artificial Intelligence

Do you think VB is a good language for AI? I originally did AI using mainly Lisp and C/C++ when performance was needed, but recently have been doing some VB programming.
VB has the following advantages:
1. Good debugger (essential!)
2. Good inspector (watch facility)
3. Easy syntax (Intellisense comparable to structure editors of late 80's Lisp environments).
4. Easy to integrate with 3rd party software.
5. Compiles to fast code (CLR performance pretty good)
6. Fast development.
By the way, thanks for all the useful replies. I've upvoted everyone who contributed.
I would suggest you go with C# rather than VB.Net.
You get all the nice features that you discuss but a better (and more familiar) syntax.
Which VB are you talking about here? If you're talking VB.NET then yes, and no.. I would suggest C# or maybe F#.. F# is a functional language and hence is generally better suited for many of the patterns you'll be dealing with when programming AI. The newer versions of C# also have support for language features such as lambda expressions, anonymous delagates et al which may also benefit you!
When you say AI what do you mean? Its a very broad field. If you're just skimming the basics, like guided search and simple knowledge bases then yea VB .Net may seem beneficial. But the language structure and syntax makes it very inadequate when you start to delve into theorem proving, ILP and other areas of machine learning you'll begin to realize that language like Lisp are still being used today because they provide a more natural syntax for expressing AI concepts.
1, 2, and 3 are all aspects that any sufficiently advanced IDE has, so that's not much of an issue for most languages. As for 4, 5, and 6: Python fits 4 and 6, but not 5, as it is not very fast, though some implementations of Python do have better speed than others, depending on their configuration. (Just mentioning Python because you tagged your question with the python tag.)
If you do plan on using the .NET Framework, though, might I suggest C#? The syntax is similar to that of C and C++ (about as similar as the Java syntax is), so it'll be more familiar to you, and it does exactly the same things that VB does (and has all the same IDE features, as they both use the Visual Studio IDE, though I suppose you could use an alternative IDE if you wished, as the VB and C# compilers actually come with the .NET Framework itself and not with Visual Studio).
VB has the following advantages: [...]
But then you go on and list stuff that most modern implementations of Common Lisp offer, especially the commercial ones.
Have you tried Common Lisp recently? What parts of VB.NET do you miss when you're programming in CL?
It depends what you mean by "AI".
One common meaning is just "leading edge software technology" (e.g. chess playing is as of 2010 no longer consider to be very much about artificial intelligence, just a set of basic supporting techniques, because it's not leading edge any longer). For the leading edge stuff, the language should be chosen to suit the particular technology. Neither VB (various variants) nor C++ are likely to be good candidates then.
On the other hand, one might take AI to mean literally "artifical intelligence", the attempt to create true AI, even if just at the level of worm or housefly intelligence. Then the main stumbling block, as noted by Scott Fahlman very very long ago (eighties? seventies?), is the ability to perform huge set intersections in huge semantic nets very rapidly, in parallel, e.g. for recognition of that dangerous animal. And since current hardware isn't up that (the clock speed doesn't at all compensate for the von Neumann bottleneck), except conceivably stuff used by NSA and suchlike, it's a fight for sheer computing efficiency, which means that C++ could be a good choice for the lower levels.
Cheers & hth.,
– Alf
Doesn't matter what language you code AI in, if that language allows you to do complex mathematics. VB.NET has the same features as C# because it uses the same framework. Accessing those parts of the framework may have different callers.
AI requires a lot of optimizations for memory and trimmed custom functions... Get familiar with Reflection namespace for Un-managed memory callers. Pointers are possible and useful in un-managed memory; VB allows for these also which is what all the C# guys fight about because they don't know how to do it in VB. Memory / Pointer and Disc allocation is located in the Marshall Class which is an Interop Service.
http://msdn.microsoft.com/en-us/library/vstudio/system.runtime.interopservices.marshal%28v=vs.100%29.aspx
Anyone that tells you, C++ is the only way to go doesn't understand programming or is simply a bigot that believes C++ is the only language in the world.
AI is typically defined by math delegates that are functional representations of an action; therefore if your mathematics is no good; your code will be no good.
Neural Networks doesn't care what platform they were written in when they are assembled; they are Assembly.

Should I learn Python after C++? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I`m currently studying C++ and want to learn another language.
For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful.
I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back to C++/Java from Python because they started thinking in it, get used to absence of memory management, etc.
What do you recommend?
There's no right or wrong answer, really. But I think you'll benefit more from learning Python. Given the similarities between C# and C++, you'll learn a different way of thinking from Python. The more ways you learn to think about a problem, the better it makes you as a programmer, regardless of the language.
The benefit of going from a more static language to a dynamic language is to change your programming paradigm -- it's not a matter of becoming "lazy" so much as realizing new ways of accomplishing things, which will make you better in any language.
Well, I've learnt Python after C/C++, Java and C#. Python is a great language, and its simplicity and consistency have improved the way I code. It has also helped me think more clearly about the algorithms underlying my code. I could go on about the benifits it brought me, instead I'll summarize the reason to learn it ->
Learning a new lanuage doesn't take away, it adds to your programming skill and keeps you sharp by teaching you to shift between the frames of mind that each language requires.
So go out there and learn Python. Your code will improve(TM).
P.S.
1.You'll lose C++ (or any other language) skills, if you neglect their upkeep and maintainance. Thats entirely up to you.
2.Programmer (intelligent) laziness is a virtue.
Many would argue that you would benefit from learning Python before C++.
The syntax hurdles are much, much lower;
Debugging is much more friendly
There are a plethora of libraries---batteries included, you know. It's easy to
experiment with web scraping, XML, etc. in Python. Again, the barriers to entry
in C++ are much higher.
It's still good to learn C/C++, because of its close connection to the machine. But a new programmer can learn an awful lot from exploring in Python.
I don't think that "Python makes you lazy" (nice title, anyway!).
On the contrary, in programming as in life, knowing more than one language is important; I think you'll find python amusing and sufficiently different from C++ or C# so that the languages will not get mixed in your head...
Python is complementary to C++ and easy to integrate with C++. (As evidence of this claim, the C++ gurus from Boost use Python.)
And as you said, Python gives you a way to get a perspective outside the Microsoft orbit. But even there, if you need to integrate Python with MS tools, there's IronPython.
Learning more languages can only make you a better developer, regardless of their approach. Besides, your experience with C++ (or, at least C) will come in handy for writing high-performance parts of your applications using Python's C API, which lets "raw" C and C++ code intermingle nicely with the pure Python stuff.
I still write code in Objective-C (1.0... before memory management) and Python on a daily basis. The variety is actually fun, rather than confusing; keeps things from being boring.
Flex your brain and improve your skill set. Give a functional language a whirl.
I learned C/C++, Java, Python & C# in that order.
The two I actually invariably end up using are C++ & Python; I find the niche Java & C# occupy between them to be too narrow to feel the need to use them much (at least for the stuff I do).
I also think I didn't really "get" C++ functors and boost::bind until I'd been exposed to Python.
Many languages are quite similar to others, but to move between imperitave and functional / dynamic and static / Object and Procedural languages you do need to train yourself to think within the constraints of the language you are using. Since most projects are at least a few weeks, this is generally not a problem after the first few days.
You will find it more difficult to switch away from a language+environment you enjoy in your after-hours / hobby development.
C, Macro Assembler => basically the same - difference is mainly libraries
C++, Java, C#, Delphi => basically the same paradigm - you learn quickly how to leverage the features of the specific language and adopt concepts from one syntax to another. It's basically the same way of thinking, the biggest exception is how you think of memory manangement.
Python - good language, strategically a better choice than ruby, although there are other aspects of ruby that can be argued to be superior. What make python a good choice is the presence of a formal language body which keeps python environments on different platforms very compatible to one another.
If you are interested, read this http://cmdematos.com/?p=120 on making a strategic language choice.
It is up to what exactly is the kind of applications you want to program, for example for Websites that need access to databases I would go for Ruby( and Ruby on Rails framework ) , for financial applications or applications that need a lot of parallel processing I would go for a funcional programming language like Haskell, oCaml or the new F#, these last 3 wil make you a better programer even if you don't programm a lot in them , by the way c# has been lately in the latest versions adding more and more funcional programming features. I would learn Python for a security and exploits kinds of applications.
You could learn a new programming language, like python, and use it to do all the tasks you'd normally perform in your 'core' languages; or you could take a language (like python, or perl) and use it to complement your core language.
You could learn VBScript and use it to write scripts that glue your code and others together. If you want something less Microsoft, then python, perl or bash scripting would be a good idea - not just to learn how to code in the new, but also how to do things differently from the usual 'code an app' way.
From a utility perspective, it is good to learn one of the more dynamic languages like Python (or Ruby or Perl) too. Not only do they stretch your mind, but they are superior for certain kinds of tasks. If you want to manipulate text, for example, C++ is a lot harder to use than Python. It gives you another arrow in your quiver to use when appropriate.
I learned, in order:
BASIC
Pascal
Ada
(A little bit of Haskell)
Java
Python
C++
C#
I don't feel Python inhibited my ability to learn or use C++. I am glad though that I learned pointers in Pascal before encountering reference types in Java, Python and C#, because I feel it gave me a good basis to understand the idea of the differences between "value types" and "reference types". I think for me the most important of those languages are Python, Haskell and C++. All of them complement each other, and although there are times I'm working in one and wish I had a feature from another, on the whole I think I benefit greatly from a deeper understanding of things like type systems, object orientation and metaprogramming by seeing the different ways these languages approach these things.
Try LISP instead (or afterwards, it's your call). You are at least partially right, though. using Python for a while makes you not want to go back to a statically typed and compiled language. It's just sooo much more comfortable not to have to please the compiler like ALL THE TIME ;). And yet another aspect is the readability of python code, which is awesome.
It is true. After learning python, everything else will seem like too much effort for the same amount of real work being done. You'll get used to the clean, small syntax and the freedom of GC. You will enjoy working in list comps, generators, etc. You'll start to think in python and C++ and Java will be like building a ship in a bottle one twiggy little stick at a time.
But since it's that much easier, doesn't it tempt you to try it all the more?
I think it is always good to know several programming languages. I've learned c++ at school and I've used it a lot in the past years because it is really a standard in the industry. I've learned python by my own and I am using it to make a lot of nice tools that would be too long to write in c++.
Python has just a very positive influence on my c++ skills. It gives another way to think.

What languages have higher levels of abstraction and require less manual memory management than C++?

I have been learning C++ for a while now, I find it very powerful. But, the problem is the the level of abstraction is not much and I have to do memory management myself.
What are the languages that I can use which uses a higher level of abstraction.
Java, C#, Ruby, Python and JavaScript are probably the big choices before you.
Java and C# are not hugely different languages. This big difference you'll find from C++ is memory management (i.e. objects are automatically freed when they are no longer referenced). You would chose these if you were interested in desktop style applications, or keen on static typing (and you'd probably choose between them based on how you feel towards Microsoft and the Windows platform). In both cases you'll find much richer standard libraries than you'll be used to from C++.
Python and Ruby take a step away from static typing, into a world where you can call and method on any object (and fail at runtime if it's not there). That is both a blessing (a lot less boilerplate code) and a curse (the compiler can't catch those errors for you anymore). Once again, you'll find they have richer standard libraries, and are higer level again than Java / C#. Performance is the main downfall, with Python being somewhat faster than Ruby as I understand it. To choose between them, you'd probably choose Ruby if you're interesting in web development for the Ruby on Rails framework community, and otherwise go with Python.
JavaScript is even more different from C++ in that it does away with classes entirely. Objects are simply cloned from other objects and can have methods and properties added to them at runtime. Very flexible, but also very easy to make into a total mess. JavaScript is the only real choice if you're interested in running applications in a browser, which is really coming into its own as a platform. You'll find the standard libraries available rather limited if you're not doing a lot with the browser, but there are quite a few good frameworks which fill in some of the gaps.
Some other interesting, though more niche choices are
Smalltalk - More or less in the Ruby and Python camp, and significantly faster as I understand it. Be careful though _ I've seen lots of good engineers learn Smalltalk and never come back ;)
Objective-C - When C went object oriented, C++ went one way (static typing), and Objective-C went the other (dynamic typing). It's quite Smalltalk inspired, and has a good standard library if you're in Mac / iPhone land. In terms of memory management, unlike everything else I've listed, it's not garbage collected (though that's now an option on Mac OS X 10.5), but it does have a reference counting scheme which makes life significantly simpler than managing memory by hand.
Lisp - I've never learnt it myself beyond what I needed for minor Emacs hacking. As I understand it, the libraries were nice in their day, but though the language remains supremely elegant, they've fallen a little behind the times.
Haskel - If you wanted a complete break from objects and classes, Haskel and it's functional approach is an interesting way to go (or Lisp as above, or F# if you are in .Net land). Basically, you're giving up loops and variables in favour of doing everything recursively. Takes some time to wrap your mind around, and probably isn't practical for most real world applications, but it's a good one to learn.
Eiffel - I love it - Very clean syntax, and designed for serious engineering type systems. Statically types like C# and Java, and with a weaker standard library, but it will make you really think about language and class library design.
ActionScript and Flex - The programming interface to Flash, which is based on what seems to be a statically typed version of JavaScript. I've played with it a bit, and it's quite slick if you're interested in developing media based applications. You can also push beyond the browser with Flex and into the Air platform to build real desktop apps.
I would say that from your question you probably haven't finished learning about C++. If you're still doing your own memory managment then you still have a long way to go my friend!
Check out the auto_ptr and shared_ptr - check out the Boost libraries.
Similarly with abstraction - what are you specifically complaining about? AFAIK there's not much you can't do with C++ that is present in other strongly-typed languages.
I know this doesn't answer your question - you want to move forwards, but C++ is one of those things where you never really stop learning. If you get bored, take a brief foray into templates and template meta-programming...
I see a lot of excellent suggestions so far. However, I think there's something missing, assembler.
Why learn assembly language?
It's not as difficult as you may think. Assembly language is a lot smaller in scope than many modern languages, there are a few tricks you need to understand for it to make sense, but it's not that complicated.
It broadens your knowledge base. Knowing the fundamentals is almost always beneficial, even when working at a high level.
It can be extremely useful when debugging. Especially debugging native code without the source, the knowledge you gain from learning assembler enhances your ability to debug in these situations by leaps and bounds.
It gives you more options. When the rare circumstance comes up where assembly code is needed you won't be helpless.
It's good for your resume. It shows that you learn beyond just the bare minimum needed to keep your current job, it shows a curiosity about fundamentals, and it puts you in a different class of programmers, and that class tends to be more experienced and more capable.
It's just plain cool.
Some assembly language resources:
Sandpile.org (assembly language / processor architecture reference)
Gavin's Guide to 80x86 Assembly (a decent online tutorial)
Assembly Language for Intel-Based Computers (5e) (a decent textbook for x86 assembly)
Trying something really foreign like Haskell will allow you to think in different ways. It also helps you to think recursively. C++ has recursion but it infiltrates many more parts of functional languages.
ditto Lisp,.. or scheme
Even if you don't ever use it, it's handy. I only really got template programming after learning it.
Another one is prolog. it puts you in a non sequential mindset.
If you're comfortable with C++ syntax and style, you might find D to be an interesting language. Or if you want to branch out, any of Python, C#, Java, Ruby would be excellent choices.
C# if you're in the Microsoft ecosystem.
Python and Ruby seem to have the most traction in the Linux/Unix/etc space.
ObjectiveC is dominant on the Macintosh and iPhone. The most recent MacOS implements garbage collection for a subset of the frameworks, but to use the rest you'd have to do resource management yourself.
You could learn Java, as it does garbage collection as well, but the number of frameworks you'd need to become familiar with to be a productive Java developer is daunting.
Well if you're looking for a very high level of abstraction and memory management then I'd say lisp would be an ideal candidate. I'm learning it now, slowly, and it's the most fun I've had with a new language.
Having said that Python or Ruby may be a better compromise between expressiveness and popularity. Python's Django framework is one of the better RAD frameworks if you're looking for web application stuff.
I'd say it depends on the kind of programming you want to try. If you want to stay on the OOP side, learn Python or Ruby, both languages provide an easy way to create bindings to use your C++ code from a script (for efficiency reasons).
If you need another approach to programming, learn a "functional" language like Lisp or Haskell.
And if you need to include a fast and small scripting language inside your C++ application, try Lua.
Last but not least, if you know Java and hate it, you can try Scala, a language where you can mix your Java classes with your Scala code, very interesting.
Scheme.
The Little Schemer and Structure and Interpretation of Computer Program will stretch your mind in strange and wonderful ways.
DrScheme is a good IDE for beginners. The Scheme Programming Language makes a good, free reference.
try c# much :)
if you want to abstract memory management, Java comes to my mind instantly.
I suggest learning database design and a query language such as SQL.
You can start with a desktop tool like Microsoft Access or use the free SQL Server Express or Postgre or MySQL.
Well I think there is no predefined route in learning programming languages. You may learn your next lang based on your job needs, academic research, just for fun, etc. There are many options.
In you feel comfortable in C++, you can go down and learn some assembly. It's a dark art but you'll be glad when you encounter some hard debugging session.
In terms of more abstraction, Smalltalk is extremely fun, OOP-pure and 100% dynamic (debugging is a pleasant thing to do, which is not in static-typed languages). Dolphin Smalltalk is a good implementation for Windows, even the free community edition gives enough to play with. In multiplatform Smalltalk VMs, go for Visualworks or Squeak. Visualworks is extremely stable and comes with a lot of documentation.
Python is used today in many, many fields. I don't know anything about Python excepting the basic syntax and semantics, but it's required today for many jobs.
Java it's, well Java. It's interesting that Java never catch on me. You may get interested on Java, altough. Ask here for advantages of using it over C++ or other OOP languages.
For Web development go for Javascript, specially considering the AJAX wave. It's getting interesting those days. We've talked about Smalltalk, all right, Seaside is an amazing framework for web development. It works (at least I tried on) Squeak /Visualworks... it's beatiful.
Well, there are a lot of more to get your hands on: Scheme, LISP, Ruby, Lua, Bash (!), Perl (ugh), Haskell... Try them all and have fun!
Qt
Why not learn Qt? Its a great application development framework available on all platforms and even mobile devices!
Clojure is well worth exploring as it meets both of your criteria:
It has a strong emphasis on programming with higher level abstractions. see e.g. this video: Clojure: The Art of Abstraction
It has automatic memory management / garbage collection (via the JVM, which has some of the world's best GC implementations)
I'll give some examples using just one abstraction: in Clojure you can manipulate pretty much any data structure via the sequence abstraction.
;; treat a vector as a sequence and reverse it
(reverse [1 2 3 4 5])
=> (5 4 3 2 1)
;; Take 10 items from a infinite sequence
(take 10 (range))
=> (0 1 2 3 4 5 6 7 8 9)
;; Treat a String as a sequence of characters, calculate the frequencies
(frequencies "abracadabra")
=> {\a 5, \b 2, \r 2, \c 1, \d 1}
;; Define an infinite lazy sequence of fibonacci numbers, take the first 10
(def fibs (concat [0 1] (lazy-seq (map + fibs (rest fibs)))))
(take 10 fibs)
=> (0 1 1 2 3 5 8 13 21 34)
Since you are already into C++, next step would be to learn .Net through managed C++ or managed extensions for C++..this will get you a step in the big world of .Net framework..Once you understand the framework, makes it more comfortable to learn other .Net languages like C#, VB.Net etc.
One of the areas that MC++ excels in, and is in fact unique in amongst the .NET languages, is the ability to take an existing unmanaged (C++) application, recompile it with the /clr switch, have it generate MSIL and then run under the CLR. This extraordinary feat is aptly termed "It Just Works (IJW)!" There are some limitations, but for the most part, the application will just run. The C++ code can consist of old-fashioned printf statements, MFC, ATL, or even templates!
I recommend python as it's not only a sexy language, but also very widely used and easy to integrate with C++ through Boost.Python.
But as Thomi said, there's lot to explore in C++ and with the help of Boost libraries it's becoming really easy to develop in.
Rather than suggest a specific language, I would recommend you pick any language or languages that offer the following 4 features:
Automatic Memory Management
Reflection/Introspection
Declarative/Functional constructs(e.g. lambda functions)
Duck Typing
The idea here is to expand your programming perspective to include concepts that the C++ language does not offer you out of the box.
It depends on what you want to do. If you have some specific tasks that you are interested in accomplishing then look at languages that are best for those types of tasks. The best way to learn a language is to actually use it.
I'd say get started with Python. It has a higher level of abstraction and it teaches you the importance of indenting and making "pretty" code. Not that "pretty" is very important, but it will make the future maintainer of your code a lot happier :)
There's a lot of example code out there, and if you are into Linux there are various distributions out there who have all (or most) of their tools based on the language. If you like digging into how managing an operating systems works (something most programmers do) it's a good start. Before I get the flames I said managing, not the actual kernel stuff for that you mostly need C and you should have that covered.
On the other hand it might be nice to dive into the C side of things, ignore the OO stuff and learn functional programming. If you head down that road I also suggest to start with basic assembly language like one of the upper posts suggested. Maybe HLA (High-Level Assembly by Randall Hyde, he wrote a great book called Art of Assembly Language Programming) is a good start. You'll either learn to love memory management or hate it for the rest of your live. Good to know in case you want to start a career in programming :)
However if you're looking to make a job out of programming, Java and J2EE is an easy money maker if you know what you're doing. IMHO it gets boring really quick though.
Personally, I have been programming in Java, Python, C/++ and my favorite has to be python. Although C++ can do everything Python can do and more, I wrote a Python program with about 10 lines that would take about 50 in C++. So, moral of the story, use python.
If you haven't already, try out a scripting language. It should change the way you work & think. Hopefully, in a good way :)
I've got to put up a separate answer for Perl. While Python is roughly equivalent in functionality and considered more clean and modern, Perl has an elegance all of its own - the elegance of pure pragmatism. It also boasts a truly great library support. Take a look at Perl to expand your brain in the direction opposite to Haskel :) (although Perl aficionados claim that it can be used for functional programming).
Rust
Syntactically similar to C++
Designed for performance and safety, especially safe concurrency