Ask HN: What language is the most fun to learn
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:<p>- 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&amp;feel is not &quot;native&quot; to your system, as it&#x27;s built from scratch, but it&#x27;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&#x27;s an eye-opening experience which will show you how incredibly user (the tinkerer kind) unfriendly basically every GUI currently in use is.<p>- Prolog was mentioned by others, and I second that. There&#x27;s also Logtalk, which is Prolog with OOP baked in - it&#x27;s a surprisingly powerful and practical language, but it may be hard to get into without first going through something like <a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog</a> (same goes for Mercury, which is also interesting, but not easy to get into without a warm-up)<p>- J: I&#x27;d recommend APL or K, but I unfortunately don&#x27;t know them well enough to do this. J is an array language by Ken Iverson, it&#x27;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&#x27;t see anywhere else. Worth taking a look; one important note, though: it&#x27;ll take you <i>years</i> to become able to read J code on your own, so in the beginning don&#x27;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&#x27;re going to execute and experiment for <i>hours</i> before understanding a single line of J. That&#x27;s normal. Don&#x27;t be discouraged. That line probably expresses computation that would need hundreds of lines in &quot;normal&quot; language.<p>- Forth: it&#x27;s basically a REPL for Assembly. It&#x27;s interactive, lets you define and execute programs by typing them at the prompt, yet it&#x27;s usable on the most underpowered microcontrollers out there. See the (free) book &quot;Thinking Forth&quot; by Leo Brodie, it&#x27;s a good overview. Also, personal note: don&#x27;t try to do everything via the stack: it&#x27;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&#x27;t provide them.<p>- OCaml: F# can be viewed as a dialect of OCaml, but, due to it having to fit into .NET, F# left out the &#x27;O&#x27; from OCaml. While the ML base of OCaml is solid, it&#x27;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&#x27;ll be able to learn F# in a weekend, so it&#x27;s hitting two birds with one stone.<p>- Elixir and Erlang. Depending on what you want out of it, I&#x27;d start with Erlang and then learn Elixir after that. That is because Erlang is a very simple language, with no &quot;magic&quot; at all: whatever&#x27;s happenning is in plain sight, visible in the source. Of course, it&#x27;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&#x2F;OTP basics down, transition to Elixir, which adds a convenient syntactic abstraction in the form of macros and a more complex&#x2F;powerful module system.<p>- Nim: I like it personally, but I&#x27;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&#x27;s libc.<p>- Haxe + LuaJIT: this is what I&#x27;m currently investigating. There&#x27;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&#x27;t hurt to know it beforehand (not a strict requirement, though, unless you want to write comipiler plugins.)<p>- Common Lisp, Clojure, Racket: I&#x27;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&#x27;t like that last part. ClojureScript is now a serious contender, as it became bootstraped and can work with JS engine alone.<p>- 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&#x27;t need them in the beginning, and by the time you need them, you&#x27;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.<p>There&#x27;s so much more I&#x27;d like to say, but I don&#x27;t have the time right now :( Shoot me an email or ping me on Discord if you&#x27;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.