4 ms·
Well since people are going to answer with languages they think are universal enough anyway, I'll say what I think comes closest to a universal language at the
by tinco 12y ago
Well since people are going to answer with languages they think are universal enough anyway, I'll say what I think comes closest to a universal language at the moment. Keep in mind, I do my daily programming in Ruby and Javascript, and my hobby/personal projects in Haskell so I'm not a mindless Microsoftie.
The language that I know comes closest to a universal language is C#.
C# has a rich static typesystem with generics, is typesafe, has a garbage collector, can be precompiled and has runtimes for most operating systems.
C# also has a dynamic type system, that can be enabled with a keyword.
C# has an embedded functional language, has function references and lambda expressions.
C# has extensive libraries for Server applications, CLI applications and GUI applications, including asynchronous and syncronous I/O, events and accelerated graphics.
C# supports reflection and code generation at runtime.
Over the years Microsoft has managed to cram almost every programming paradigm that's out there into C#, yet has carefully avoided it becoming a multi-headed unusable monster like C++ is (I'm not saying you can't write beautiful code in C++, just saying there's a lot in there that you shouldn't do).
About the only thing that's not in C# as far as I am aware is predictable/high performance, like C and C++ have. You can not disable the garbage collector and can't embed machine language.
So why, if I think C# is such a cool language, don't I use it? Well.. I just really like Ruby's type system and syntax. And I just really like Haskell's typesystem and syntax. There's really no need to have all features in one language when you can do just as well with multiple programming languages that might have specific advantages.
- moron4hire 12y agoYou can't embed assembly code in C#, but you can write unsafe blocks of code that deal with manually allocated and deallocated memory, lose array bounds checking, and allow for pointer arithmetic. Also, if you pool resources and use the reinitialization pattern rather than constantly destroying/reacquiring resources, then you can obviate a LOT of garbage collection. It's very common in game programming in C#.
- runT1ME 12y agoC# is missing good type inference, implicit conversions, implicit parameters, higher kinded types (huge loss), lightweight method syntax, currying, pattern matching...
- noblethrasher 12y agoC# has implicit conversions. It doesn't have pattern matching, but it does have proper sum types.