Ask HN: What's the most underrated programming language?
Recently I started reading about erlang[1][2], And I started feeling why its not widely popular as python or go. Though I have very little knowledge about functional language and tradeoffs when it comes to using them. Just wanted to know more about it and any other languages which are underrated
[1]blog.whatsapp.com/index.php/2012/01/1-million-is-so-2011/ [2]https://stackoverflow.com/q/2708033/2577465
168 comments
[ 2.6 ms ] story [ 193 ms ] threadGiven (historical) alternatives of flash and java:
Want some simple scripting on a web page? JavaScript, hands down
Want a full page takeover as an app? Java didn't make much sense here- the startup time was awful, and you might as well have literally just made a java desktop app. Flash too had limitations- you could (and I have) throw something together pretty quickly with flex, but the loss of the mobile market was unfortunate.
With that said, you are afforded many paradigms, from fully OO to fully functional (from GWT, to Angular, to React, to Purescript), with everything from static, compile time safety (typescript and flow) to runtime clojure-spec ish typing supporting ADTs (tcomb, io-ts, folktale, fantasyland).
There's canvas and webgl, but with the DOM having accessibility primitives built-in, you really don't need or want to go there unless you absolutely have to.
For every fault of the language, a third party came to the rescue- from module systems (require/amd => browserify/cjs => system/webpack/tsc/ => native modules) to macros (sweet.js) to DSLs (peg.js) to whatever you can think of, all on NPM (for better or worse).
There's a lot to hate about JS. There's a lot to love, if you give it a chance without carrying emotional baggage.
A lot of these things have absolutely ruined the modern web- I hate the popups on every news website wanting to send me push notifications, and every other blog pretending to be a SPA.
A lot of these things have made business advancements possible- I once took a downloadable part configurator app from a company, which could only be installed on windows, and converted it into a web site. Average quote turnaround went from 2-3 weeks to a salesperson could walk into a customer's office, walk them through the website on an iPad, and have a quote in 15 minutes.
JavaScript, and the web platform in general, have been maligned, misunderstood, inappropriately used, but it has also been a fundamental changing point in our usage of computers, in many cases for the better.
[0] http://luajit.org/luajit.html
[1] http://wren.io/performance.html
Though reading through issues and threads about it, and maybe high performance programmers using it have more than a few things to say about the state of the GC. I'm not sure if that's changed or not. I've only dabbled yet.
I'd like to see a community grow around it. It, or something like it, seems to me like the path a modern, low-level language should be going. It's not there yet, but in terms of the feature-set, optional safety, syntax, typing, etc, it's an attractive space.
It's a different style of programming, the mental state of the program when using prolog is to declare the rules that must hold true for the program to execute. You think less about state and more about logic.
In my opinion, here's what's amazing about this. There are programs that you might have a hard time solving via other means that you can easily solve with Prolog if you know the rule.
If you know the rules all you need to do is state the rules, and Prolog will find the solution for you. Besides being great for quick prototyping and application of rules. You can build complete systems with it. SwiProlog has HTTP, SSL, ODBC and even GUI support.
Logic programming just sounded like it would make sense for describing the behavior of a home automation system, and I think it works well.
... then Java happened.
I know sometimes it gets some hype but Haskell and its ilk is just so above the quality of any other language it's mind bending. Whenever a hard language design problem comes up in any new language, Haskell has solved it more than 2 decades ago.
The ecosystem (Hackage etc) is pretty bad though.
The language might be elegant at the core, but it's too far removed from reality (efficiency on real computers is super hard to control from Haskell) and it's far too focused on types (which, while they catch some errors, slow development down, and encourage unnecessary complexity ("easier" and "more type-safe")). After all, it's an academic language.
Current debuggers are built around very imperative notion of program state. I have breakpoints, I can look at variables (state in a given time)..
What would debugging look like if we looked at it from the functional perspective?
For example, execution "filters" instead of breakpoints. What happens if this function receives value that satisfies certain condition? Instead of variable watches, give out a breakdown of the data passed in and out from the function. Etc.
It's understandable to show skepticism about "the new shiny thing" (although Haskell is > 30 years old) because most new shiny things turn out to be not that great after all. I've been struggling to communicate the "no, but really" distinction without much success to other people and it's frustrating.
(...for purely egoistical reasons though, I don't really care what people are using as long as I get to use a sane language in my day job, which is currently not the case.)
If you think this is smugness, look into it. The features that come up with GHC extensions have no equivalent in other languages, because the commonly used stuff in Haskell so far ahead.
I think this has more to do with lack of polished UI editors (build tools) than with the language.
One could easily say that Qt was pleasurable because it was a well designed object-oriented and inheritance based toolkit. I have my reasons to believe this is objectively better within the context of UI design, and that pure functional programming in GUI design will never break out of it's magnificently tiny niche, but I'm not gonna go into that here. I'd rather just point out that some shared theoretical idea behind both Qt and Haskell UI design doesn't in any way imply that Qt's success could be Haskell's as well. Only Haskell programmers, working in Haskell code, could prove that idea. And if it really is that great, then surely they could do it.
But I’ve also wondered why D is not more widely used as it is a much nicer version of C++ and integrates fairly well with it.
Also a bit odd that OCaml and SML isn’t more widely used
Generally speaking applicatio startup time in Julia is poor (maybe because of the number of symbols in Base?), I only recommend using it for its original purpose - mathematical computation - which, by the way, it's insanely good at and an absolute joy to code in.
I'm someone who thinks there is room for lots of good languages, and each has its role, so I don't think languages should be pitted against one another necessarily.
However, with Nim you have something very similar to Python in its expressivity, but with performance comparable to things like Rust and C++. The metaprogramming is very well done as far as I've seen, and it seems very well thought out. It also has solid, useful compilation targets.
It just seems like the whole package for a lot of use cases and I'm not sure why it's not getting a lot more attention.
I still wish the coffeescript model had worked out where we could view or think about languages differently and compile them to a common one. But unfortunately it doesn’t work without a great deal of effort.
Could you expand on that? I always thought the core nim language was fine. But, I've also come to the conclusion that the few libraries I've used that were written in nim are of poor quality. Is that a function of the language? The community? Or both? I have no idea.
Taste is subjective ...
De gustibus non est disputandum:
https://en.wikipedia.org/wiki/De_gustibus_non_est_disputandu...
... so it is almost as though by default, you have to explain/justify your opinion on this :)
Nim is underrated indeed.
Edit: Specifically, Perl 5 + CPAN is what makes it so much better than many people think. The language itself is insanely flexible, which lends itself to extensions that greatly increase its expressiveness. IMO, if you start with Moose (from the CPAN) as part of your "core library" Perl 5 becomes a very powerful tool for writing very nice code, at any scale.
SQL seems to power nearly everything at some level, has much code written in other languages for the sole purpose of interfacing with it (for better or worse), has inspired other concepts and technologies (even as they are defined against it as what they are not), etc.
I don't think anybody mentioned C yet either, another foundational case…
Nobody needs to mention C because it is definitely not underrated - it's earned its reputation and is respected/feared by developers everywhere!
Compared to SQL, Datalog makes recursive queries very natural[1], making it good for manipulating graph-like structures. For example, here's reachability in a graph:
That was easy!Variants of Datalog pop up in unexpected places. Datalog dialects are often used for implementing code analysers (e.g. Semmle). Datomic's product is a variety of Datalog with S-expression syntax. UC Berkeley has a Datalog-based research language called bloom (http://bloom-lang.net/faq/) aimed at implemented distributed systems. Datalog was also an influence on the recently-shuttered Eve (http://witheve.com/) project.
In its original form Datalog lacks aggregations, which is probably a big part of why it didn't catch on - aggregations are important! Still, some Datalog implementations add support for aggregations. Unlike SQL, Datalog never really became a standard; more an academic ideal than a practical tool. I think this is a shame.
While Datalog doesn't have a canonical practical implementation, in terms of impact on how people think about data query languages, I think it's an academic gem.
[1] SQL has recursive queries ("Recursive CTEs"), but they're neither widely used nor particularly well-supported in most SQL implementations - they're basically tacked on. This is partly because they're hard to optimize due to a lack of restrictions; with Recursive CTEs, SQL is Turing-complete. Datalog deliberately isn't, and there's a large literature on optimizing evaluation of recursive Datalog.
a. Object oriented code done right is the best way to handle production code.
b. Java has introduced streams, lambdas etc.. has any other language shown this type of adaptation to times ?
c. Python, Ruby etc.. don't have equivalent performance
d. c++ obviously beats it on performance but I know the pain of porting c++ code
e. Most of the boilerplate code is either auto-generated or you can use Lombok type framework to generate them for you
f. Java made a really good comeback with Android
So the new kids in the block might not like Java because it isn't cool but Java has stood the test of time.
C#
"Adaption to times"? Lambdas are older than Java itself. It was outdated in v1.
I think OPs point was that the language has evolved more dramatically than other popularly adopted languages.
Of course it’s not popular for hobby projects, startups, academia or data science, but those fields are frankly dwarfed by enterprise on the job market.
C# has a stronger hold in the private sector, but scince most of the public software is produced by the private sector even there JAVA runs strong.
For people out there that look at all those getters and setters with contempt: you don't need them for your JSON objects. Just use public. The frameworks will still serialize and deserialize without issue. Use JSON annotations to define what a valid message is. Yes, you'll need a mapping layer between your JSON/inbound messages and your domain, but you need that anyway, otherwise your API is brittle.
JPA + Spring can lead to fast DB code and development time that rivals NoSQL with Postgres. You can have it autogenerate the DB during dev time with each boot, then create Liquibase migration documents for true devops stability.
After working with Go for a month, I really think Java just does things right. Servlet API is simple. Spring makes it easier. Transactional management + AOP is wonderful. So many cross-cutting concerns allow you to properly encapsulate and apply the logic in a few AOP. You just can't do that with GO without a lot of compiler work.
Autoconfiguration in particular seems nice at first but can cause all sorts of weird issues. I once had a situation where we added RabbitMQ, and some other JAR started trying to bind to a queue that didn't exist, but the framework was swallowing that exception and it took hours of screwing around in the debugger to figure out what was going on. That sort of thing simply doesn't happen with Go in my experience. Or probably Dropwizard, honestly.
As someone who has done a lot of Scala and Kotlin, I appreciate Java because I can anticipate the bytecode that will be generated. This is important to me on low-level JVM projects (profilers, fuzzers, etc).
Well, Lisp added CLOS, which was a huge adaptation to the rise of OOP. It also originated lambdas. I don't know if streams originated in Lisp, or if they were an adaptation from another language.
> Most of the boilerplate code is either auto-generated or you can use Lombok type framework to generate them for you
That's why I prefer a homoïconic language: I can write & generate the boilerplate in the language itself.
> Java made a really good comeback with Android
I don't know if that's true so much as there really aren't good options to Java on Android. I'd give my eye teeth for a good Go GUI SDK for Android, for example.
All the things you mention about Java were done in C# and much more elegantly.
Where Java shines is not the language but the runtime behind it.
> Object oriented code done right
Pick one.
But in all seriousness, Java is definitely underrated amongst many who are working with the trendier technologies. It's not perfect, but it gets the job done, and it's a solid platform with phenomenal tooling.
I don't think "Python, Ruby etc. don't have equivalent performance" is actually very important though. In practice, the availability of developers in a particular market, legacy code, and static typing & refactoring tools probably have much more to do with Java's success than performance.
* Instant recompilation
* One string type
* One error handling system
* Capitalized identifier = class name = file name = imported name
* English names for everything and no operator overloading
All these are ignored by e.g. Haskell or Rust.
You mean like, AbstractSingletonProxyFactoryBean? Sure, it's English, but when you end up with a project with that many layers of needless abstraction, it's not going to be easily and quickly comprehensible by anyone who isn't already familiar with it.
I think factories and beans are a sign that object construction in Java is a mess. In the applications I work with, most calls to "new" are dealing with data structures (lists, maps, protocol buffers), and behavior-heavy business objects are a mostly static call graph. Not sure if there's a name for this pattern though.
The Golang FAQ calls that stuttering; good term, I thought.
https://golang.org/doc/faq
See section:
What are the guiding principles in the design?
"Stuttering (foo.Foo* myFoo = new(foo.Foo)) is reduced by simple type derivation using the := declare-and-initialize construct."
Foo::Bar *Foo::foobar = new Foo::Bar(Foo::Bar::FOOBARENUMVALUE);
Clay is a language that is no longer being developed, but it was a well designed substitute for C. It was built with templates in mind from the ground up and has modules, move semantics and no garbage collection.
Also Intel's ISPC. If you want real speed, ISPC makes it much more practical to take advantage of SIMD, though it seems not many people know about it.
* It is functional and succinct by default, but allows you to go mutable and fast when needed (see the alioth benchmarks).
* Open source culture
* The tooling (thanks to kcieslak and others) is fantastic
* Web story is covered well by suave/giraffe on the backend, with fable-elmish as a personal favorite if I need complex front-end functionality (most stuff I have is just regular pages though).
* Mobile story through Xamarin(Forms is not my favorite, but Native works fine) or Fable
* To mention javascript again, I think Fable has a ton of well thought out features compared to other transpiled languages
* Testing via expecto (and just github.com/haf in general)
* A whole wealth of libraries through .net integration
* I can compile a binary to execute on linux for easy deployments, or target osx to create convenience command line applications for my coworkers
There are some negatives (some C# interop gets inelegant, some tooling is left to the community as a responsibility, other minor things), but overall it has all of the important things.
It really is a great successor to C++, with lots of new ideas taken from other languages too, and some very insightful language designers. I wish people would give it more of a chance and not stop at "it has a GC" and decide that this makes the whole language worthless.
It's been around for a while but hasn't gotten popular yet. I don't know if the weird license for the reference compiler is what slowed down adoption. At least for me, that's why I was hesitant to commit to D. After the license change, I've had so much fun with it.
Seriously! I've never seen anyone complain that e.g. Go has a garbage collector, and Go's is not even optional. The only thing Go has over D is a large corporate sponsor.
- predictable release process
- predictable language development
- predictable changes between versions
- clear direction
- no competing and non-interoperable standard libraries
- a backwards incompatible version 2 does not come out 6 months after version 1.0 deprecating it.
Oh. Wait. That wasn't just an "only" thing.