Ada - The type system and the manner in which it can be used to constrain your software (in a positive way) makes ensuring certain safety/reliability much easier. Compare in C, an int is an int. If I make a "temperature_t" it's just a double or something that's aliased. Where as "kelvin_t" in Ada can be made to be only the positive real numbers.
Lisps - I'll include Common Lisp, Emacs Lisp, Scheme, Racket, clojure, etc. The meta programming (ruby has this too, actually) makes it much easier to develop large programs almost automatically. The meta programming nature allows you to, within the same language as the primary program you're aiming for, extend your language and program. This reduces the friction of the meta programming tasks, consider C. You can use meta programming, but it requires at least one other language.
Plenty of others, three (languages and families) off the top of my head.
Erlang's language is concise, well-designed, and oriented around the concurrency model. Try tacking it onto C and it won't work well [0]. Take that concurrency model and put it into Python or Lisp or Smalltalk, and it could work fine. Those are expressive languages that are sufficiently malleable to bring in foreign concepts in a native looking fashion.
[0] It won't look as clean. It'll work, but it won't be clean. We actually use a very similar model in a project at work. But there's so much bookkeeping because it's C that Erlang hides from you. Other expressive languages would be able to absorb that bookkeeping and hide it from you as well, but C isn't expressive. It's precise. It does what you tell it to do. But it's not able to hide things cleanly behind abstractions that the language itself isn't already built to handle.
And Shen which has a Turing complete type system meaning it is very flexible but type checking may never halt in certain conditions. I do not know of another language with these properties.
Haxe allows you to target absolutely anything and if you miss some exotic it is trivial to allow generation for it. It is also quite mature language with a macro system. Again, maybe MonkeyX compares somewhat but has far less backends and making a backend is not so straightforward.
K and Q and their parent APL which allow you to write the most terse code you will ever see (some make a sport of it).
Forth you can implement in a few hours on any platform and yet is a very powerful language which makes it easy, once you get used to it, to write terse but easy to understand code. This one I would say is, compared to other languages including Lisp, easier to implement naively while still keeping solid perf. There are also lists of minimal instruction Forths which show you how powerful and easy the basic constructs are and how rapidly you can make a toy language.
One-line that reads the file, splits multiple lines into an array:
<?php
$l = explode("\n", file_get_contents("in.txt"));
Want to sort them alphabetically? Add sort($l);
Trim them? $trimmed = array_map(trim, $l);
Remove duplicates? $unique = array_unique($trimmed);List<string> lines = File.ReadAllLines("/file.txt").Distinct().ToList().Select(l => l.Trim()).Sort();
with open("foo.txt.") as f: foo = sorted(list(set(line.strip() for line in f])))
with is a context manager that will automatically close the file once it's out of scope, not required but it's much cleaner and safer. Should the code change you don't have to worry about the call to close the file getting lost. The call to set() could be replaced with a set comprehension, {i for i in sequence}, but for clarity I used set().
It's certainly not the most efficient way to do it but it's simple and clear.
File.read("in.txt").split("\n").sort.map(&:trim).uniq
No need for X temporary variables and N lines of code in ruby.Also notice the better readability as everything happens from left to right?
$l = file('in.txt', FILE_IGNORE_NEW_LINES);T Extends Foo | Bar
T Extends Foo & Bar
http://elixir-lang.org/getting-started/enumerables-and-strea...
I think I want to learn either OCaml or Elixir next.