Programming language with native code support, No framework (I write the framework) - programming-languages

I'm looking for a programming language. It should be an easy language to learn, and should have a Garbage Collector. It should be a basic language with features like basic types (integer, boolean), arrays and etc, and I should write the framework.
It is for a game editor I want to write. The editor's designer will write the code of the UI in this programming language. The framework will be a 2D graphics and audio framework, and in the future it'll be 3D too.
I thought about the new Go language, but it doesn't have much support and theres no binding to OpenGL and etc.
Any ideas?
Thanks.

The obvious two are [C](http://en.wikipedia.org/wiki/C_(programming_language)) or C++. However, [D](http://en.wikipedia.org/wiki/D_(programming_language)) is closer to Java and C# given that it has a garbage collector in the standard, as well as an alternative standard library that is fairly closer to Java than the C++ standard library. The downside with D is that they tools are not as mature as C++ or C and the community isn't as large.
The obvious solution though it to look down the list of compiled languages on wikipedia and see which you like the look of.

Well, that's a fairly broad question and without more specific requirements it is difficult to give a focused answer, but it sounds like C (or C++) would fit the bill for you. The languages you described all owe their syntax to C. C will compile to native code. C is basic language in that there is not much to learn beyond the basic syntax and it has all the basic primitives that you require.
Now that you've added the requirement of a garbage collected language, I suppose that you could try Go, but that language is not mature and there's always a risk there.

If you don't want to manage memory all by yourself like C or C++, you can try the new Go language. It compiles to native code (albeit for Linux and MacOSX only for now) and comes with a basic framework that can be easily replaced with your own framework.
It has a very active user base, so IMO it is possible to mature quickly.

You may want to look at Lua.
Lua is a relatively tiny language which manages to be capable and universal with just a few concepts. The BNF specification for the whole language fits easily on one page. It has numbers, booleans, tables and functions, and surprisingly that's all the datatypes it needs. It can even work in an object-oriented fashion.
There's a compiler, Luac, that compiles Lua to bytecode.
Lua is already being used as a UI programming language for games. Addons for World of Warcraft and a few other games are programmed in Lua. I believe Lua is a very good fit for this kind of task.
You want OpenGL? OK... http://luagl.wikidot.com/ is an OpenGL library for Lua.

Since we don't know what you want to do, I don't know what are the chances we success. Therefor, what about a language where you have to set the probability of your statement to fail :
Meet GOTO++.
Don't say "thanks you", it's on me.

Enjoy a challenge?
Try go.
Here's a tech talk by rob pike, and here is a discussion group: http://groups.google.com/group/golang-nuts/topics
.

C++ is Great, it's not scripting lang, so you don't even need a scripting host.

Related

Advice on languages and places to learn them?

My final for my last java class will be Monday. What would be a good language with many free sources (poor college student here) to work off of? I've heard good things about Ruby and Erlang but both seem alien to me.
Perhaps there is something I should try in Java first before moving to another language like some kind of framework or libraries that would advice me more than adopting a new language so quickly?
As a Student, i hear those words a lot from many of my professors:
"Its not about the language, its about algorithms!!"
Which after almost 4 years of trying different languages, i find this to be true.
Because if you learn how to do something in one language... the rest is just applying your knowledge using different syntax.
My advice is to stick with what you started (Java), and after you master the basics, then deal with:
Inheritance
Polymorpism
Data Structures
Because you will find the above in almost every language.
Algorithm Animations helped me visualize and understand a lot.
Also read this post.
I would definitely recommend Ruby - as a fun language to learn more about programming. Java is statically typed and strictly object oriented, so it is natural that Ruby feels alien to you.
Ruby is strong in a number of paradigms - especially object oriented, functional and metaprogramming. Learning lots of paradigms and how to combine them will make you a better programmer no matter what future languages you use.
Having learnt Java, JRuby would be good implementation of Ruby to use - it is written in Java and runs on the JVM. Another advantage of JRuby is that you can use Java libraries from your Ruby code. Just install jruby from your package manager and you should be ready to go.
To learn ruby check out the following resources:
Ruby from Java
Ruby in 20 minutes
Programming Ruby
Since you already know java, get a taste of other styles like Python, Perl and Ruby. PHP, Java, and C++ are closely related style wise.
I would recommend looking at Scala, F#/SML/Ocaml and Haskell -- but Scala in particular:
The reason for this is Scala shows that a "fun" statically/strongly-typed high-level (in a real sense) 'OO' language can exist. There are many useful programming constructs that are not possible in Java due to design and implementation limitations. (Scala is by no means a perfect language.)
Even learning just C#3/4 (which generally has a less powerful type system than Scala, although not all areas overlap) will open eyes with constructs that are not easy to do in Java -- simply passing around "functions" as objects or being able to uniformly and easily run queries and manipulations over lists are something out of reach with Java. You can fake closures/lambdas in Java (look at anon-inner classes or the Functional Java library), but it is hardly pretty: Scala and C# add language support for these constructs so they are "natural".
I won't speak ill of Ruby or Python (or many other languages, excluding PHP ;-) -- but one thing that they lack is static typing. Some people find this a blessing, but I generally find it a curse (good static type systems can prove the absence of a number of type problems) -- the problem is that, if Java/C/C++ is/are the only statically typed language(s) you have dealt with, you will think that static typing has to be painful (and implies "too much type annotation" and "too brittle/closed types") -- this is simply not true in more advanced statically typed languages with type inference, view-bounds, typeclasses, etc.
Learning Haskell will really open your eyes up to a different approach -- but it really is a different beast and requires forgetting how language X works. You can write "Java in Scala", even if not advisable/idiomatic, but you really can't write "Java in Haskell".
If you are looking for web development, I would strongly suggest learning PHP (it is a really fun and useful language). If you are looking to develop for the desktop, C++ and if you want to try iPhone / iPad development, try Objective-C.
I took a Java class and I found that it gave me a good foundation for moving to Objective-c, you just need to be careful because the language does not manage your memory usage (no garbage collector). All of the above languages have tons of support freely available on the internet. If you are looking for a technique to learn a language, I find that looking at example code is the best way to go.
Hope this helps!
I Totally agree with what Chris said, Make sure that when you start learning, look for everything in Google, there are thousands of resources available for how-to's about the language you chose to go with.

How to go about making your own programming language? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Learning to write a compiler
I looked around trying to find out more about programming language development, but couldn't find a whole lot online. I have found some tutorial videos, but not much for text guides, FAQs, advice etc. I am really curious about how to build my own programming language. It brings me to SO to ask:
How can you go about making your own programming language?
I would like to build a very basic language. I don't plan on having a very good language, nor do I think it will be used by anyone. I simply want to make my own language to learn more about operating systems, programming, and become better at everything.
Where does one start? Building the syntax? Building a compiler? What skills are needed? A lot of assembly and understanding of the operating system? What languages are most compilers and languages built in? I assume C.
I'd say that before you begin you might want to take a look at the Dragon Book and/or Programming Language Pragmatics. That will ground you in the theory of programming languages. The books cover compilation, and interpretation, and will enable you to build all the tools that would be needed to make a basic programming language.
I don't know how much assembly language you know, but unless you're rather comfortable with some dialect of assembly language programming I'd advise you against trying to write a compiler that compiles down to assembly code, as it's quite a bit of a challenge. You mentioned earlier that you're familiar wtih both C and C++, so perhaps you can write a compiler that compiles down to C or C++ and then use gcc/g++ or any other C/C++ compiler to convert the code to a native executable. This is what the Vala programming language does (it converts Vala syntax to C code that uses the GObject library).
As for what you can use to write the compiler, you have a lot of options. You could write it by hand in C or C++, or in order to simplify development you could use a higher level language so that you can focus on the writing of the compiler more than the memory allocations and the such that are needed for working with strings in C.
You could simply generate the grammars and have Flex and Bison generate the parser and lexical analyser. This is really useful as it allows you to do iterative development to quickly work on getting a working compiler.
Another option you have is to use ANTLR to generate your parser, the advantage to this is that you get lots of target languages that ANTLR can compile to. I've never used this but I've heard a lot about it.
Furthermore if you'd like a better grounding on the models that are used so frequently in programming language compiler/scanner/parser construction you should get a book on the Models of Computation. I'd recommend Introduction to the Theory of Computation.
You also seem to show an interest in gaining an understanding of operating systems. This I would say is something that is separate from Programming Language Design, and should be pursued separately. The book Principles of Modern Operating Systems is a pretty good starting place for learning about that. You could start with small projects like creating a shell, or writing a programme that emulates the ls command, and then go into more low level things, depending on how through you are with the system calls in C.
I hope that helps you.
EDIT: I've learnt a lot since I write this answer. I was taking the online course on programming languages that Brown University was offering when I saw this answer featured there. The professor very rightly points out that this answer talks a lot about parsers but is light on just about everything else. I'd really suggest going through the course videos and exercises if you'd like to get a better idea on how to create a programming language.
It entirely depends on what your programming language is going to be like.
Do you definitely want it to be compiled? There are interpreted languages as well... or you could implement compilation at execution time
What do you want the target platform to be? Some options:
Native code (which architectures and operating systems?)
JVM
Regular .NET
.NET using the Dynamic Language Runtime (like IronRuby/IronPython)
Parrot
Personally I would strongly consider targeting the JVM or .NET, just because then you get a lot of "safety" for free, as well as a huge set of libraries your language can use. (Obviously with native code there are plenty of libraries too, but I suspect that getting the interoperability between them right may be trickier.)
I see no reason why you'd particularly want to write a compiler (or other part of the system) in C, especially if it's only for educational purposes (so you don't need a 100-million-lines-a-second compiler). What language are you personally most productive in?
Take a look at ANTLR. It is an awesome compiler-compiler the stuff you use to build a parser for a language.
Building a language is basically about defining a grammar and adding production rules to this grammar. Doing that by hand is not trivial, but a good compiler-compiler will help you a lot.
You might also want to have a look at the classic "Dragon Book" (a book about compilers that features a knight slaying a dragon on the front page). (Google it).
Building domain specific languages is a useful skill to master. Domain specific languages is typically not full featured programming language, but typically business rules formulated in a custom made language tailor made for the project. Have a look at that topic too.
There are various tutorials online such as Write Yourself a Scheme in 48 hrs.
One place to start tho' might be with an "embedded domain specific language" (EDSL). This is a language that actually runs within the environment of another, but you have created keywords, operators, etc particularly suited to the subject (domain) that you want to work in.

What are the new language choices for Experienced programmers?

I know the topic I started is too subjective. But I just
wanted some expert guidance learning new languages. I've
been working with .NET languages (C#, VB.NET) quite a few
years (around 4). And it's been years since I stopped
experimenting with new laguages after settling down in a job.
Few weeks back I just started working on my personal
project, which I am going to spend much time in the coming
months. During the analysis I found that I just can't
accomodate the luxuries of cost effective languages,
programs and IDEs. So I planned to move to the wide spectrum
of open source languages and tools.
And when I look at the current choices, I was just
speechless. Hundreds of promising open languages and
toolsets and I found it's hard to choose. And I can't even
think of evaluating each language myself (it's a worst
nightmare). Currently I started with Mono (for the sake of
C#).
I felt this is going to be a good chance for learning new
programming languages and models. So I am open to any
language that offers me the following:
more functional
dynamic language features
better language elegance (like lambdas, Haskel like SQL syntaxes or C# LINQ)
better community support
must be open
easy interaction with the web
support for parallelism and concurrency (easy threading)
better in performance
proven web frameworks
better IDE support (I got this ease of use syndrome after using years of MS tools)
I love the Haskel and Erlang language programming approach.
But I don't have a clue about these languages' web stack and
concurrency mechanisms.
EDIT:
i would appreciate few reasons along with your choices. It will be really helpful.
I think that all these meet your requirements:
Groovy + Grails or
Python + one of these Web Frameworks or
Ruby + Rails/Camping/Merb/Sinatra or
Scala + Lift
My bet is that you'll get the groovier IDE experience with Groovy (and it's Groovy Eclipse Plugin).
Learn OOP, DesignPatterns, understanding of Algorithms... the rest is "just" language. You will find, if You learn 5th... 8th language there are some similarities, some prons and cons... what You need learn is to move business needs to some technical platform.
Weird. I can't believe noone has suggested Python yet.
These are not new languages, but I vote that if you have experioence with them, then you will be a better programmer in whatever language you choose to use:
Smalltalk (or Objective-C), otherwise you have not experienced OOP.
Lisp for functional, reflective, meta programming.
Prolog for logic programming.
All of these are quite far from your basic C-like language, both in concept and syntax.
Alan Kay invented OOP and Smalltalk, he is quoted as "C++ is not what I intended", and C++ is what most of todays OOP-languages mimics. C++-style OOP is merely syntactic sugar ontop of structs with function pointers. OOP can be so much more. Ruby is closely related, but you would miss out on interleaved method names.
Lisp has been around since 1958, and the fans keep saying that everything that gets added to any new language is just something borrowed from Lisp. Maybe not strictly true, but somewhat accurate, Lisp had garbage collection 50 years ago. Easiest way to experience it today would be to write something in Clojure.
Prolog is based on formal logic. Prolog is declarative, where you declare facts and rules and is executed by constructing queries on these relations. Kind of like puzzle games in some magazines :).
In the .NET world sounds like you're talking either F# and IronRuby. IronPython might also suit your needs.
Personally I'm going to give a vote for Python, Ruby and Mono.NET.
Of the three you were probably on the right track when you said you looked at Mono; it's C# (which you have previous experience with), there are good, free IDEs available SharpDevelop being one which makes it cheap and there's a really solid community behind it all.
You don't really say what kind of programming you want to do. Do you already know C/C++? If not, I'd really recommend learning those instead of anything new and fancy.
However, if it's new and fancy that you want and you'd like to be able to write native apps, then I'd have a look at:
D
It's similar to C++, but hopefully better in many ways. It has the advantage of out performing most other new and fancy languages and most of the features on your wish list.

Lua, what is Lua? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I read something about Lua today, and I was wondering what it was.
I did a Google and Wikipedia search, I understood it until they began talking about C and API. I still don't understand it.
What is Lua and are there any tutorials for beginners?
Lua is a lightweight interpreted programming language developed in Brazil with a focus on embedding.
It is written in Pure ANSI C which means high portability, even as C++ code.
Here is an example:
print("Hello World!")
Wikipedia Summary
Official Site
I'm surprised everyone is getting this one wrong.
Lua is the Hawaiian word for "toilet".
Lua is a scripting language for C and C++. It allows to use the simpler syntax of Lua and execute these scripts in your C/C++ application. Therefore you don't have to compile the program on each change, but simply deliver a new script version.
For tutorials just use google, you'll find enough to keep you busy the next days.
Lua is a simple lightweight highly portable dynamically typed embeddable and extendable multi-paradigm scripting language. The "vanilla" (some would say official) implementation of it is made purely on ANSI C and has an awesome (simple yet powerful) C API that you can use to both embed Lua on your app or extend the behavior of the language itself. It is developed at the Informatics Department of the Pontifical Catholic University of Rio de Janeiro (PUC-Rio).
Thought it was not primarily designed for that, Lua found a big niche in game scripting, with big names such as "Grim Fandango" and "World of Warcraft". Nonetheless, because of its speed, simplicity and portability, it is also heavily used in embedded systems (see, for example, eLua project) and graphic computing.
Its philosophy is to be minimalistic, i.e its core libraries are very small with only minimum functionality (quite like C's standard libraries), though through the C API it is very simple to add features that wouldn't be possible through the pure core library, such as sockets, GUIs etc. In fact, Lua is so minimalistic that its main -and only- structured data type are 'tables', that could be described as associative arrays on 'roids.
Lua is procedural in its essence, but also supports multiple paradigms such as functional programming and object orientation.
Though Lua is not the fastest scripting language around (probably javascript's V8 project wins the prize) it is very fast (faster than vanilla Python or Ruby, for instance) and also features a non-official just-in-time implementation called LuaJIT.
In the end, Lua is actually no more than a fun language to play with, which I recommend!.
=)
About tutorials, I'd recommend the article about that on the lua-users wiki.
I hope I helped! =)
PS: I couldn't post all the links because I'm new on stack overflow, but it shouldn't be hard to find everything on Google. Sorry. =(
Lua is a scripting language. Link is to lua.org. It is heavily used in game development, most notably (to me) World of Warcraft.
Lua is a lightweight, embeddable scripting language. It's garnered a lot of popularity partly due to it's use in many popular games. A good example of this is World of Warcraft which uses an embedded version of lua to drive the behavior of the UI elements in the game.
A good intro to the language can be found here: http://computer-programming-languages.suite101.com/article.cfm/a_brief_introduction_to_lua_scripting
And the official online reference for the language can be found here: http://www.lua.org/manual/5.1/
It's a scripting language that is designed to work with C (and C++). It is designed to be embedded into C/C++ programs. Which means unlike a lot of other scripting languages, it makes no use of global variables and such, this means you can easily thread lua scripting engines.
It also makes claims about being the fastest dynamic scripting language.
I've made use of it in PC based C++ application for creating a plugin scripting interface, and also used it as a embedded scripting language. Its quite versitile, nice and small.
as a general purpose scripting language? Its not quite in the same league as your ruby/python/perl type stuff. It doesn't have as many libraries and the user community is pretty small.
But for extending C++/C apps? its awesome.
The C API, which looks to be the part that confused you, is designed to make it very easy for you to take existing C code (or new C code) and control it with a Lua script. This is what is meant by embedding. Via embedding, you can get a lightweight, programmable, interactive, text-based interface to any C code, for very little effort. Even if you don't embed things yourself, Lua is a very nice little scripting language.
My favorite example is that a nice person put a great many POSIX system calls into Lua. When I want something that is like a shell script but is more sophisticated, I can just use this library. Likewise with the MD5 library and with many others.
When learning Lua you can ignore the C API completely—just benefit from other people's work with the API—and if you ever need to embed your own code, you can come back to it later.
Lua is a SCRIPTING language written in C and is commonly used in game development because of its power and flexibility. Lua is also cross-platform so it can be used anywhere on any platform. Lua can also be used as a programming language with a handy program I use called AutoPlay Media Studio which allows you to create fully fledged applications for the Windows platform. I hope this clears things up for you.
Website: http://www.lua.org.
AutoPlay Media Studio: http://www.indigorose.com.
Lua is a powerful, fast, lightweight, embeddable scripting language.
Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.
for more you can read here

What are the most important programming languages to know for concepts? [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.
In your opinion, what are the most important languages for a programmer to know? I'm talking about concepts, not about how practical the language is.
List the languages and a reason. For example, Lisp for functional programming, JavaScript for prototype-based OOP, etc.
Must know:
1) C (system programming, understanding of machine architecture)
2) Perl or Python or Ruby (practical day-to-day tasks)
3) Java or C# or C++ (OOP, and quite important to get a job these days)
Really important:
1) Haskell or ML (functional programming; changes the way you think)
2) Lisp or Scheme (power of macros)
Nice additionals:
1) Forth (very low-level, explicit stack operation + joy to write your own interpreter)
2) Assembly languages (know how your CPU works)
3) Erlang (parallel processing)
4) Prolog (logic programming)
5) Smalltalk (true OOP and true interactive developent)
The assembly languages of as many chips as you can learn for low-level knowledge.
C to learn more practical knowledge of low-level workings, since almost all languages are implemented in C.
C++ for object-oriented programming on top of the low-level goodness of C.
Pascal to learn how to work with strong typing.
Java to see how you can shield yourself from low-level concerns.
Perl to learn regular expressions, weak/dynamic typing, and other good things.
Python to see strong/dynamic/duck typing.
Ruby to see how object-orientedness works on top of Perl-esque weak/dynamic typing.
Common Lisp for that functional enlightenment.
Scheme for the emphasis on recursion.
Emacs Lisp so you can extend Emacs.
Haskell to see pure functional programming done right.
APL so you learn how not to write code.
COBOL so you can make mad money maintaining legacy code.
Erlang to really learn about concurrency. (Thanks to Pete Kirkham for correcting me.)
Scala for functional programming on the JVM.
Clojure for a Lisp-like functional language on the JVM.
Prolog to understand logic programming.
D so you can see why all the D fanatics are always so pro-D.
C# so you can program for .NET (and Mono).
F# so you can do functional programming on .NET.
Forth for stack-based languages.
PHP so you can see how not to create a language. (Just kidding. Learn PHP beacause it's really useful for web development.)
JavaScript because it's basically the language for client-side web scripting.
bash for a good, general-purpose scripting language.
Visual Basic so you can read the code your boss wrote. =)
INTERCAL for "fun."
brainfuck so you can torture your friends.
LOLCODE so you can convince them to still be your friends after you subject them to brainfuck.
...And so on.
C for understanding how the most other language(-implementations) and operation systems are implemented
I think the three languages that best combine practicality and coverage of programming concepts would be
C
Python
Javascript
From these languages you can learn low-level system programming, pointers and memory management, static typing, dynamic typing, high-level scripting, event-driven programming, OO programming, functional programming.
Obviously you're not going to get as pure an intro to functional programming as you would with, say, Haskell, but you can learn a lot of the concepts in Python and (especially) Javascript.
It is not the languages rather the paradigms you should know:
procedural (like C, Pascal)
object-oriented (like Java, C++, Smalltalk)
functional (like Lisp, ML, Scala)
If you understood one of these paradigms in one language, it is easy to learn another language in the same paradigm. And there are even more fields specially supported by languages that are important to understand:
parallelism (in Erlang or Scala)
declarative templates (e.g. in C++ or Prolog)
dynamic languages (e.g. JavaScript)
At at last you should always know what goes on under the hoods, so you better have a look at assembler.
I would say:
C or Assembler to understand how the processor work.
Smalltalk (or C#, Java, Python, Ruby, etc) to understand object oriented programming.
Lisp (any Lisp, Scheme, Common Lisp, Clojure) to understand high level programming, meta programming (macros), etc.
Haskell to understand type inference and other functional concepts.
If you are into distributed systems, I'll consider learning Erlang too. Those are the language I recommend learning, even if only superficial, only for the sake of learning even if you never use them to write a real application.
Its best to know a variety. This gives you a better overall perspective of the art of programming, plus, you get to choose the best tool for the job.
My current list would be:-
C - programming close to the machine.
Python - programmers nirvana.
Perl - for when s**t happens.
Java - cause it will keep you in work.
C# - cause it will keep you in work.
lisp, scheme or something functional to get your brain out of a rut.
SQL - for managing large data sets.
JCL, COBOL, VAX DCL, CShell VB - just to remind you how bad things could be!
A good short list:
C for the machine concepts
Haskell for functional programming
Smalltalk (or maybe Ruby or Simula-67) for object-oriented programming
Prolog for logic programming
Icon for backtracking and mind-blowing string processing
Bourne shell for Unix scripting
Might also include
Scheme for macros
Awk or Perl or ... for regular expressions
FORTH for tiny bootstrapping postfix wonderfulness :-)
For concepts, I would choose assembler and Java.
The first because you should know in intimate detail how machines work.
The second because you should understand how to shield yourself from the intimate details of the way machines work :-). By that I mean a language with a rich set of data structures at hand (so really Java could be Python, C++ with Boost and so on).
Well. I'd say learn C and javascript. They are most widely used languages.
You might want to learn Java/some .Net language and/or python/ruby: they're more convenient, tho.
This have the advantage that all those languages are reasonably well designed.
For example, don't learn PHP or C++ because they're a mess. They're used widely, you might want to learn them one day, but they can seriously mess with your mind.
Limbo - a programming language with concurrency and channels, what C should have evolved into. ( see also D, another C successor )
No-one else seems to be mentioning any declarative languages, so here are a few:
Prolog - a declarative language for logic programming
Modelica - a declarative OO language for modelling systems.
XSLT - a declarative language for transforming XML.
For parallelism, you don't get much wider than shader language, and the related OpenCL - typically 512 processors in parallel on a high-end desktop, rather than Erlang's 4 processors in parallel ( though with many scheduled processes ).
This is a good question. I know a lot of people, myself included, get stuck in a rut where we are just churning out code like one would churn out burgers at a McDonald's. Coding becomes too mechanical—we understand how to get things done, but often times we forget why these things get done behind the scenes.
In my world it's been C++/C/ObjectiveC that have taught me the most, even though I write C# every day at work.
For the most part, learning C++ has helped me learn about memory management and how the various objects are stored in memory, etc.—the actual science of programming. What really opened my eyes was the Programming Paradigms class offered at Standford that you can get off of iTunes and I think YouTube.
You already mentioned two, here are a few more:
Java: Java is a good example of OOP 'cause you HAVE to use oop, and it's designed from the ground up to be an OOP language.
BASIC: Although obsolete, it's a good example of procedural languages and it has a very easy syntax.
For web programming: PHP, ANSI-SQL, javascript.
Some people may argue that HTML and CSS are not programming languages. But they are esential for web app development.
For Desktop app development, C++ with the Qt Framework. Qt gives C++ the additional "cross-platform" fizz.
Pascal or Basic for start and to master basics of procedural programming.
At school we learned Haskel for functional programming.
And then one should try assembler or C for getting deep and Java for OOP.
A have no arguments for this - that's only my taste and what I tried.
I would sat C/C++ cause it sets allot of basics for allot of other languages used around the world.
Personally I learned Java/JavaScript->VB(short course fortunately)->C#->C++, with a pinch of PHP and Perl on top of it all. Best part of that line was C# and then moving behind the scene in C++.
Look for a set of different programming languages:
C++ / C# / Java etc.
C / Assembler
Python, Ruby, Lua, Perl etc.
sh, awk, sed, regular expressions
Prolog (or similar)
Haskell / Lisp etc.
It doesn't really matter which ones you choose, but that you choose one from each "category".
Pseudocode for reading/writing documentation. :p
I think knowing C/C++ or any other low level language will help you with understanding the impacts of how managed/script languages works helps. Such as pointers will demystify variable references.
If you want to understand computers and the underlying hardware, C is the single most important language, commonly said to be the lingua franca of computers. The Stackoverflow podcast tends to cover this at least once a week.
There seem to be enough answers on this, so I'll just leave it at that.
You should know a scripting language so that you can prototype your applications faster.
Maybe python/ruby/perl . Groovy is also an alternative if you're a Java guy that likes his java libs.
Alot is already mentioned but I would definitely add C++ (already done) for the following reason:
C++ for learning how to use pointers and get the main idea about them.
Although there is the discussion if c++ is still the 'better' language (all depends on what you want to make really) it never hurts to understand pointers, just in case you do need them ever.
Having a scan through the answers so far I'm surprised I've not seen any mention of actionscript.
I think if you learn some C/C++, then some Java then that should prepare you for pretty much all of the decent languages out there.
I prefer to see my code in action and I find Actionscript 3 (not 2 or 1) along with Flex (which is MXML) great for quickly demoing visual concepts.
So C & Java helps to learn the syntax of the majority of languages.
Actionscript 3 (very similar to java syntax) & MXML for being able to express you code visually very quickly.
C - low level system programming plus to understand generic concepts about how memory is handled, stack, stack frame, heap and so on. These are helpful for understanding higher level languages
C++ - mainly std library (separation of generic algorithms and containers), templates, namespaces, but OO concepts as well. Templates meta programming will give you completely different perspective on writing software, this is compile time execution versus run time execution. Templates inheritance (static vs dynamic polymorphism).
Python - dynamic type system, list comprehension - functional programming (?), no memory management for developer, spaces for indentation
Objective-C - message dispatching (can dispatch to nil), dynamic type system (static as well), late binding, OO concepts
It may sound crazy, but I first learned to program writing VBScript macros for windows. I used a template, which is available here http://vbscript-macro-template.blogspot.com/ and I just added to it and also tried to understand everything that it did. Now, several years later I am writing my own desktop and database applications.
You should start from C and go through C++, Java and the goto WinForms,
Then better goto .NET

Resources