
Ask HN: What language is the most fun to learn - xupybd
Looking for a hobby language to learn. Thinking F#, Haskel, Elm, Elixer or Nim but want something fun. Any recommendations?
======
morty_s
Currently having a blast with Haskell. Rust is probably my favorite overall,
however, for pure fun: Scheme.

\- Scheme: pure fun. Pairs well with, Structure and Interpretation of Computer
Programs

\- Elixir: also a lot of fun, I really enjoy the elixir help-docs/man-pages...
Really ergonomic, almost no hassle.

\- Haskell: endless fun; tbh, for me, setting up a Haskell environment wasn’t
what I hoped it’d be. It’s getting there, but if you’ve used Cargo (rust) or
Mix (elixir) and expect to have a similarly smooth experience in Haskell,
you’re going to have to work for it.

\- ReasonML: I’m pretty excited about this and interested to see how it goes.
I’m a big fan of OCaml-flavored languages.

\- Racket or Clojure: both are cool, docs/guides for both are great. The
online Clojure docs/reference are fantastic. Same with racket.

If you’re leaning towards F#, try to lean Scala. Just my 2cents.

~~~
xupybd
F# is only slightly winning due to Excel interop. But that can be delegated to
other languages.

------
hazz99
Either of these:

\- Elixir

\- Haskell

\- Ada

Are all unique and quite enjoyable to learn. Each of them has challenging new
concepts that are amazing once you get your head around them (and a bit
painful beforehand).

Each one will teach you something new and valuable.

Ada has an incredibly advanced concurrency model that blows everyone else out
of the water. It is also incredibly safe -– this is the language that powers
airplanes and spaceships (and missiles). Beware: after using Ada, you will
hate the concurrency primitives of other languages.

Haskell is a great and enjoyable introduction to functional programming with
concepts that can be taken anywhere.

Elixir can create extremely robust software through the "let it crash"
philosophy and supervisor tree structure. Also a great intro to highly
distributed systems, probably the only language where I found the lack of
types to be an advantage. The concepts have been replicated in other languages
(e.g. Akka, various actor frameworks)

~~~
nix23
+1 For Ada!!

------
tikej
If you do something with some number crunching it’s Julia.

First it’s nice because notation is very similar to math and turning
algorithms into code is easy, but then comes multiple dispatch, nice dynamic
type system and lisp-like ability to modify the code.

~~~
disabled
^ This. Julia also has amazing differential equation packages and features. It
also has some interesting AI stuff too, although my work with that is limited.
There are some cool Markov chain Monte Carlo packages too, that are updated
relatively often. For more cohesive references, there are books on Julia via
Packt Publishing.

While Python has its purposes, Julia is just a fun language to use.

------
avinoth
For me I've had most fun with Erlang. There are lots of new paradigms i
discovered that I wasn't exposed to before, like, pattern matching, OTP
system., Programming Erlang by Joe Armstrong is a really book and lots of
credit goes to the book for making it enjoyable.

~~~
non-entity
> Programming Erlang by Joe Armstrong is a really book and lots of credit goes
> to the book for making it enjoyable.

Oh man I was really enjoying learning Erlang from this book, but put it down a
while back after getting lost on some part.. I need to get back into it.

------
alexmingoia
Haskell. No contest. It will blow your mind and completely change your
perspective on programming.

------
meitham
Prolog to me. The way it forces you to think about the problems in terms of
facts and predicates, and the use of backtracking is very different from every
other language.

------
karmakaze
I did more than half of the Advent of Code to try learning F# over the
holidays. The learning curve seemed very gradual. The only really weird thing
I ran into were how arrays initialized/mutated. Wish it was promoted more
rather than have C# incrementally gain its features over far too long a time
and in a less concise way.

------
tech_dreamer
ReasonML / OCAML if you are into ML. Clojure if you like LISP.

Node if you want to convert into money making opportunity

------
karmakaze
Hamler looks really exciting to me.

[https://news.ycombinator.com/item?id=23491516](https://news.ycombinator.com/item?id=23491516)

------
thirtythree
I'm learning Elixir at the moment. I've mainly done OO programming so there's
a few new things.

------
klibertp
So late to the party... Still, I feel like I have a chance to contribute due
to my hobby being programming languages (see my blog.) So, a few suggestions:

\- Smalltalk: I played with Pharo Smalltalk for a bit and enjoyed the
experience very much. Pharo is image-based, which will probably surprise you -
very few PLs share this characteristic. Pharo includes an IDE within the
image, including incredibly powerful debugger; the look&feel is not "native"
to your system, as it's built from scratch, but it's not ugly either; the
upside of using Morphic as a base for GUI makes it flexible, so much so that
only the Web (with browser developer tools) comes close to it. There are
downsides, but if you hit one of them, just shoot me an email. Overall it's an
eye-opening experience which will show you how incredibly user (the tinkerer
kind) unfriendly basically every GUI currently in use is.

\- Prolog was mentioned by others, and I second that. There's also Logtalk,
which is Prolog with OOP baked in - it's a surprisingly powerful and practical
language, but it may be hard to get into without first going through something
like [https://www.metalevel.at/prolog](https://www.metalevel.at/prolog) (same
goes for Mercury, which is also interesting, but not easy to get into without
a warm-up)

\- J: I'd recommend APL or K, but I unfortunately don't know them well enough
to do this. J is an array language by Ken Iverson, it's general-purpose with
heavy emphasis on expressing complex data transformations succinctly. The core
of the language is not that big, its rules are simple, but they combine in a
way you won't see anywhere else. Worth taking a look; one important note,
though: it'll take you _years_ to become able to read J code on your own, so
in the beginning don't even try - the trick is to use the interpreter, which
has 3 or 4 different ways of displaying expressions to make them more
manageable, but in the end you're going to execute and experiment for _hours_
before understanding a single line of J. That's normal. Don't be discouraged.
That line probably expresses computation that would need hundreds of lines in
"normal" language.

\- Forth: it's basically a REPL for Assembly. It's interactive, lets you
define and execute programs by typing them at the prompt, yet it's usable on
the most underpowered microcontrollers out there. See the (free) book
"Thinking Forth" by Leo Brodie, it's a good overview. Also, personal note:
don't try to do everything via the stack: it's perfectly ok to use named
variables. Especially since you can implement the support for them yourself
(or fetch one from the net) in case your chosen implementation doesn't provide
them.

\- OCaml: F# can be viewed as a dialect of OCaml, but, due to it having to fit
into .NET, F# left out the 'O' from OCaml. While the ML base of OCaml is
solid, it's not that unusual (well, if you have experience with other
languages in that family...); it OOP part, though, is a real gem, and from the
looks of it it was a major influence on Scala OO features. F# also left out
functors, IIRC, which are also an interesting feature. Also, after you learn
OCaml, you'll be able to learn F# in a weekend, so it's hitting two birds with
one stone.

\- Elixir and Erlang. Depending on what you want out of it, I'd start with
Erlang and then learn Elixir after that. That is because Erlang is a very
simple language, with no "magic" at all: whatever's happenning is in plain
sight, visible in the source. Of course, it's tedious and verbose as a result,
but considering that the OTP is damn hard to really grok, having a simple
language actually helps a lot. Once you have Erlang/OTP basics down,
transition to Elixir, which adds a convenient syntactic abstraction in the
form of macros and a more complex/powerful module system.

\- Nim: I like it personally, but I'd wait a bit before delving into it. As
far as I understand, the parts around the GC are being redesigned, and from
the looks of it the new design will be rather different than the current one
(also better, IMO). Other than that, I use Nim regularly for writing simple
scripts, which are not much longer than Python or PERL equivalent, yet they
are statically linked executables with excellent performance and ability to be
dropped on any of my systems where there's libc.

\- Haxe + LuaJIT: this is what I'm currently investigating. There's a lot to
like about Lua, but lack of static (even if optional) typing, the module
system design, and non-existent stdlib are a huge pain points. Haxe is a
language which compiles down to Lua (among 9 other targets) and it covers all
the problems, leaving you with the incredible speed and other goodies (like
proper tail calls) ready to use. The Haxe compiler performs dead code
elimination, so you only pay (in terms of the lenght of produced Lua code) for
what you use. Finally, Haxe has proper macros, a bit similar to those in Nim,
but with additional layer of sugar, similar to syntax-case from Scheme. BTW:
Haxe compiler is written in OCaml, so it won't hurt to know it beforehand (not
a strict requirement, though, unless you want to write comipiler plugins.)

\- Common Lisp, Clojure, Racket: I'm running out of time for writing this
post, but these all have many good things going for them. Personally, I
started with Racket, then learned CL, and only later I learned Clojure, which
required JVM to run. I didn't like that last part. ClojureScript is now a
serious contender, as it became bootstraped and can work with JS engine alone.

\- Scala: honorary mention, being tied to JVM is not that bad in its case, and
it is actually quite well designed langauge. Of course, the chains of
implicits or higher-kinded types are hard to grasp, but you don't need them in
the beginning, and by the time you need them, you'll be able to understand
them, probably. The problem of it becoming a write-only language is real, but
IMO much exaggerated: a bit of discipline goes a long way here.

There's so much more I'd like to say, but I don't have the time right now :(
Shoot me an email or ping me on Discord if you'd like to chat about this
stuff; it (PLs) has been my hobby for more than a decade right now, and I have
played with pretty wide selection of languages, so I might be able to give a
more precise advice if I knew what do you need the new language for.

------
ineedausername
Haskell

------
mapandey
Clojure

------
scared2
R

