Announcement

Collapse
No announcement yet.

Vim Creator Bram Moolenaar Aiming To Improve Vim Performance With Vim9 Fork

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by uid313 View Post

    But you're one of those weirdos who code in Clojure. It is not even on the top 50 in the TIOBE list.
    ...and Java is at the top, but that doesn't mean that I want to write it. It also helps that Clojure runs on the JVM and that I have the entire Java ecosystem to work with. I don't always choose what I get to write, but when I do, it's Clojure.

    Comment


    • #22
      Originally posted by jrdoane View Post

      ...and Java is at the top, but that doesn't mean that I want to write it. It also helps that Clojure runs on the JVM and that I have the entire Java ecosystem to work with. I don't always choose what I get to write, but when I do, it's Clojure.
      To be honest, I can't even read Clojure. I have no idea how it works or what it does. It looks super confusing to me. I could never code in any Lisp dialect.
      There are so many other interesting languages like C#, Python, Kotlin (for those who like JVM) and Go, Swift, Rust, etc.

      Comment


      • #23
        Originally posted by uid313 View Post
        To be honest, I can't even read Clojure. I have no idea how it works or what it does. It looks super confusing to me. I could never code in any Lisp dialect.
        That's too bad because it's not really any different than reading any other Lisp in the most basic sense. It's really not too difficult. http://www.4clojure.com/ is a good place to start because it doesn't require you to spin up a project or anything, but in its basic sense, you're just working with data because that's the Lisp way.

        Code:
        (+ 1 2 3)
        I'm assuming you can tell what the above does.

        Defining functions isn't horrible.
        Code:
        (defn my-function [arg-1 arg-2 arg-3]
          (+ arg-1 arg-2 arg-3))
        And calling them is just like the above example.
        Code:
        (my-function 1 2 3)
        One of the big things that i think sets Clojure apart is the format of the code, which is the same format as the data that Clojure code produces (EDN.) So, the language is homoiconic, unlike all of your language examples. So not only can I run something like `my-function` above with the arguments 1, 2, and 3, I can evaluate that list as if it were data:
        Code:
        (map symbol? '(my-function 1 2 3))
        Which would return:
        Code:
        (true false false false)
        The nice thing about that is that you can write code that transforms code before executing it which lets you make syntactic changes to the language without redefining the language itself (macro.)

        Honestly, I didn't want to learn Clojure way back when and I also found it hard to read, but it has completely changed how I write code in other languages and it has become one of my favorites to write. There are a lot of advantages to a language that's homoiconic, functional, encourages immutability through and through, while running on a widely used platforms (The JVM, JavaScript, and the CLR.)
        Last edited by jrdoane; 05 January 2020, 01:12 PM. Reason: Fix an example.

        Comment


        • #24
          Originally posted by uid313 View Post
          Either way, if Python and JavaScript are too big, then there is Lua.
          Lua is under-appreciated. I think it should be a platform dependable library, because it's fscking small (It runs in my house on all my lighting controllers), while in the same time being extremely fast and having the full compiler.
          If only systemd would use Lua for whatever they do, or network manager, we could finally have smart scripts that know the difference between routing tables, and we could finally have multihomed hosts without doing it all by ourselves.

          Comment

          Working...
          X