How Nested Functions Work, part 2

bearophile bearophileHUGS at lycos.com
Mon Sep 21 14:14:10 PDT 2009


I know, I have to explain why...

Jeremie Pelletier:

>Java is mostly popular in academic contexts,<

In my university they teach mostly Java the fist two years, but usually Java is not seen as a research language. For that they usually use parallel languages or functional ones, or logic ones, etc.
Java is the most used on servers and for business-oriented situations.


> it may have nice features
> but I don't see it getting popular among systems programmers anytime
> soon.

This is true, but the percentage of system programmers isn't very large compared to all programmers.


> C# and .NET have some nice features but just like Java they lack
> what systems languages provide: liberty.

C# gives a lot of freedom, you can inline asm, you can define and use structs and values, you can give a specific layout to such structs, you can even use enums. You can use pointers is unsafe sections of code. This is not full freedom yet, but it's quite more freedom than Java offers, and it's enough for lot of people.

Regarding the "system language" purposes, that is to write an operating system kernel, take a look at the one Microsoft is writing using an extended language based on an extended language based on C# :-) Such language is smart enough, so it's able to remove most of the overhead caused by being "safe". The result is something that may be efficient enough even for a kernel.


> Its no wonders why companies like amazon and ebay write their web
> applications in systems languages, they get so much load that using
> anything else would require them to spend way more on more servers than
> they would on more competent programmers. Google also wrote their own
> web server program to get every ounce of performance they can out of a
> machine, something no scripting or "safe" language can achieve.

Today Java is usually fast enough for such purposes. Google uses some C++ for some core components of its search engine (probably the ones that have to process brutal amounts of data), but it also uses a ton of Python (and Java) for many other purposes. I think C++ is almost a niche language at Google.


> In the end, different languages have different target audiences, dynamic
> languages target mostly the people who don't want to learn the full
> semantics of how computer works and quickly develop small to medium
> scale applications. Systems languages target programmers who understand
> how the computer works at its lowest levels and write real time or large
> scale programs.

Probably today Java allows to write programs bigger than C++ ones.

Dynamic languages and Java/C# aren't for ignorant people, they have and use higher abstractions. They are designed to avoid bugs, to write programs in less time, and allow programmers to focus more on the problems and less on the ways to write the programs.


> That's what most people I met who praised CS around failed to grasp:
> there are no "wrong" languages, and no "better" languages. But when you
> spent 3+ years of your life studying something your ego can get the best
> of you when you're given something else :)

CS teaches you lot of important things that are harder to learn elsewhere. For example if you want to write a new compiler for Haskell you have to know your good CS courses :-)

Bye,
bearophile



More information about the Digitalmars-d mailing list