Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Searching language

Name: Anonymous 2010-11-03 7:14

I'd like to have a language which
1. Is strongly typed;
2. Can be both interpreted and compiled (no virtual machines);
3. Has a good library;
4. Well integrates linux;
5. Object oriented;
6. Not complex as C++.

Any suggestion?

Name: Anonymous 2010-11-04 2:10

1. Is strongly typed;
C, C#, Java, ...

Why is strong typing a requirement? Do you really like specifying types for everything?
Better questions would be: typed vs untyped, statically typed vs dynamically typed, implicit/explicit typing, auto-conversion vs explicit coercion. I'm not a fan of strong typing, simply because strong typing only implies that you have to specify the types manually. Let's review some modern high-level languages:
- Common Lisp and Scheme: dynamically typed, which basically means in its context that variable names don't hold types, but values themselves are typed.
- Haskell and ML: statically typed, and the types are inferred from what you do with your variables. Varible names are thus typed.

Neither Haskell, ML, Common Lisp or Scheme are strongly typed, because in one case, the types can be inferred at compile-time, while in the other case, the types can be checked at run-time (they can also be checked at compile-time in some implementations). One major implementation difference is that CL/Scheme usually has to use tag bits or some way of specifying the type of a given data, as well as include the needed typechecks where appropriate, while the other one knows what the type is, and thus can just use raw data without tags (this does lead to some programming restrictions). C, on the other hand, is statically typed, but also strongly typed, so you have to specify types for everything, and you may sometimes even do this incorrectly (errors would be bought by the compiler in Haskell and ML, while in CL/Scheme, very detailed and sometimes even recoverable errors will be possible at either compile-time or run-time), which can lead to the usual buffer overflows, integer overflows and other kinds of errors - it also makes it a pain to write generic or polymorphic code, unlike the other languages.
2. Can be both interpreted and compiled (no virtual machines);
This is an implementation issue. Any language can usually be both, unless it has some feature which only makes it suitable for one or the other. Most in-use languages tend to be compiled or at least JITted for performance reasons(C, C#, Java, Common Lisp, Scheme, Haskell, ML), while some are at least compiled to bytecode (Python, PHP(yes, even that), Java) for JIT or interpretation. It's also common for Lisps to have interpreters written for them due to the sheer easyness of writing them, however most implementations are compiled by default.
3. Has a good library;
Most in-use languages have lots of code written for them. Do you mean large standard libraries? Common Lisp, Python, C#, Java, Ruby have reasonably sized standard libraries and a LOT of user-provided libraries. Scheme is reasonably tiny, but with R6RS and all those SRFI's, I could say it also classifies as having decent libraries (portability is another story altogheter).
4. Well integrates linux;
I can't think of many languages which suck on Linux. Maybe Microsoft Visual Basic series. Even .NET is well-supported with Mono.
5. Object oriented;
This is a stupid request, because object orientation is buzzword and its meaning got so diluted over the ages that just about anything can qualify as object-oriented. If you want some truly amazing OO, I'd recommend you check Common Lisp's CLOS (and its MOP) - it's most certainly the most flexible OO system I've ever seen, and if that's not enough, you can use the MOP (read AMOP) to practically define any kind of OO system you can imagine in plain CLOS. If you want something more classical, you can check out Smalltalk. And if you want your buzzword definition of OOP (single-inheritance), go for Java or C#.
6. Not complex as C++.
Few languages are as messy as C++. One large problem with C++ is how syntax and semantics are coupled, making a huge mess. Do you want something very simple or do you want something industrial-strength? For simple, go with Scheme (R5RS). Otherwise, Common Lisp, or even Python would work. CL seems to fit with everything, except your first requirement (which is specifying types), however if you really want to annotate types, it does let you do so (for performance/optimization reasons), however unlike C, you don't really have to do it, except when you want to give hints to the compiler.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List