Live data from Hacker News

Mal – Make a Lisp, in 68 languages

github.com

41–50 of 74 posts

Re: Mal – Make a Lisp, in 68 languages

#41
I tried finding the lines of code in each language with cloc. C/C++ Header contains a sum of C and CPP header files. Python has been used across different language dirs as wrapper script or so, otherwise, it's own implementation is probably 1350 lines at max. This would also probably include bugs in cloc.

    github.com/AlDanial/cloc v 1.70  T=2.86 s (433.6 files/s, 67570.0 lines/s)
    --------------------------------------------------------------------------------
    Language                      files          blank        comment           code
    --------------------------------------------------------------------------------
    Visual Basic                     36           1569            132           8036
    Swift                            36           1199           1606           7951
    SQL                              36            956            649           7594
    Pascal                           19            704            951           6253
    Ada                              28           1975            380           5856
    Elm                              19           1619            226           5647
    awk                              16            290             15           5169
    Lisp                             37            825            256           4562
    VHDL                             17            434             32           4228
    C#                               20            658            346           4175
    Python                           37            574            394           4018
    make                             89           1244            873           4010
    C                                19            466            392           3499
    Perl                             35            413            171           3450
    Go                               17            281            148           3397
    Rust                             18            304            130           3331
    JavaScript                       43            449            247           3235
    Forth                            18            516            158           3228
    C++                              18            568             71           2986
    Java                             17            325            135           2938
    D                                17            363             10           2938
    Racket                           35            480            385           2740
    TypeScript                       17            284             56           2740
    Markdown                          8            714              0           2730
    Rexx                             17            283             47           2713
    Bourne Shell                     30            390            315           2692
    Tcl/Tk                           17            284             43           2416
    Dart                             16            255             41           2303
    F#                               20            337             13           2298
    Objective C                      17            285            150           2189
    Erlang                           17            277            191           2185
    MATLAB                           26            184            128           2165
    Haxe                             19            254             79           2161
    Crystal                          18            417             58           2146
    vim script                       17            242             50           2076
    Haskell                          17            331             99           2000
    PHP                              18            249            120           1955
    Lua                              18            248             87           1874
    Scala                            16            221            113           1816
    Elixir                           19            366             35           1809
    JSON                             28            246              0           1765
    R                                17            201            100           1612
    Groovy                           17            170             98           1582
    Kotlin                           17            312              0           1554
    Julia                            17            189            126           1405
    Nim                              16            320             36           1397
    lex                              18            209              0           1355
    Ruby                             17            167             87           1264
    OCaml                            15            109             98           1211
    PowerShell                       11            128             71           1146
    ClojureC                         15            257            129           1053
    CoffeeScript                     17            195            126           1037
    CSS                               6            150            132            792
    C/C++ Header                     22            266             44            752
    HTML                              2             36             35            486
    Bourne Again Shell               47              1              4            135
    YAML                              2              6             10             86
    Maven                             1              2              7             85
    Clojure                           2              8             12             65
    ClojureScript                     1              1              0              2
    --------------------------------------------------------------------------------
    SUM:                           1242          24806          10447         158293
    --------------------------------------------------------------------------------

Re: Mal – Make a Lisp, in 68 languages

#42
post #34

I am curious why is hackernews always so happy and obsessed with lisp, there is almost daily a lisp post on the frontpage. I dont really care/mind but I am just curious as why people love lisp so much. The only thing that I notice about Lisp are the bracket jokes and memes.

After being a user of languages for a long time, writing my own LISP was the experience of leaving Platons cave and seeing what the thing I use daily really is made of. What is "if"? What is a boolean, a variable, a function?

It's a beautiful thing. I wish I would never have to climb down into the cave (languages with more advanced parsers) again.

Re: Mal – Make a Lisp, in 68 languages

#43
post #34

I am curious why is hackernews always so happy and obsessed with lisp, there is almost daily a lisp post on the frontpage. I dont really care/mind but I am just curious as why people love lisp so much. The only thing that I notice about Lisp are the bracket jokes and memes.

Thanks for all the explanations. Now I understand why u guys get excited from it. Almost sounds to good to be true.

Re: Mal – Make a Lisp, in 68 languages

#44
post #42
post #34

I am curious why is hackernews always so happy and obsessed with lisp, there is almost daily a lisp post on the frontpage. I dont really care/mind but I am just curious as why people love lisp so much. The only thing that I notice about Lisp are the bracket jokes and memes.

After being a user of languages for a long time, writing my own LISP was the experience of leaving Platons cave and seeing what the thing I use daily really is made of. What is "if"? What is a boolean, a variable, a function? It's a beautiful thing. I wish I would never have to climb down into the cave (languages with more advanced parsers) again.

You climed in the wrong direction. What you want is assembly. That's where software ends up.

Also, it's interpreters all the way down. Even assembly is interpreted.

Re: Mal – Make a Lisp, in 68 languages

#45
post #20

Earlier quoted context omitted.

While we're at it, why don't we replace high school math tests with one question: "Solve the Riemann hypothesis". We can replace the physics curriculum with "Unify quantum mechanics with general relativity", and throw out computing courses in favour of "Prove whether or not P = NP". It's important to re-do things which others have already worked out, in order to reach a greater understanding :)

Whatever. I learned how to implement Lisp by reading the source code for multiple compilers. Started with Franz Lisp, then KCL and CMUCL. I don't feel that a toy interpreter is going to teach the same things.

Perhaps you could write up the process you followed, in the form of blog post or something, so that you can pass on the knowledge. I, for one, would love a guided tour through those implementations to see which parts are worth studying to understand how an established Lisp is built.

Re: Mal – Make a Lisp, in 68 languages

#46
post #44
post #42

Earlier quoted context omitted.

After being a user of languages for a long time, writing my own LISP was the experience of leaving Platons cave and seeing what the thing I use daily really is made of. What is "if"? What is a boolean, a variable, a function? It's a beautiful thing. I wish I would never have to climb down into the cave (languages with more advanced parsers) again.

You climed in the wrong direction. What you want is assembly. That's where software ends up. Also, it's interpreters all the way down. Even assembly is interpreted.

>Also, it's interpreters all the way down. Even assembly is interpreted.

Speak truth to power. Every time someone says this there seem to be nothing but haters.

Re: Mal – Make a Lisp, in 68 languages

#47
post #44

Earlier quoted context omitted.

You climed in the wrong direction. What you want is assembly. That's where software ends up. Also, it's interpreters all the way down. Even assembly is interpreted.

>Also, it's interpreters all the way down. Even assembly is interpreted. Speak truth to power. Every time someone says this there seem to be nothing but haters.

>Even assembly is interpreted.

Could you please elaborate on this point? I'm still very much in the cave.

Re: Mal – Make a Lisp, in 68 languages

#48
post #20

Earlier quoted context omitted.

While we're at it, why don't we replace high school math tests with one question: "Solve the Riemann hypothesis". We can replace the physics curriculum with "Unify quantum mechanics with general relativity", and throw out computing courses in favour of "Prove whether or not P = NP". It's important to re-do things which others have already worked out, in order to reach a greater understanding :)

Whatever. I learned how to implement Lisp by reading the source code for multiple compilers. Started with Franz Lisp, then KCL and CMUCL. I don't feel that a toy interpreter is going to teach the same things.

I don't have the time to learn it that way. It's this or never doing it at all.

Re: Mal – Make a Lisp, in 68 languages

#49

Earlier quoted context omitted.

>Also, it's interpreters all the way down. Even assembly is interpreted. Speak truth to power. Every time someone says this there seem to be nothing but haters.

>Even assembly is interpreted. Could you please elaborate on this point? I'm still very much in the cave.

I'll use x86-32 for elaboration [1]. When the CPU sees the byte sequence 0xB8 0x90 0x41 0x5A 0x7B, it has to interpet what those bytes mean. It sees the 0xB8, so then it knows that you are loading the EAX register with an immedate value. The next four bytes (0x90, 0x41, 0x5A, 0x7B) are read and stored into EAX (as 0x7B5A4190, because Intel is little endian).

That is the case for all instructions. Each one is interpreted by the CPU. And for modern CPUs, even translated into an internal format that is futher interpreted.

[1] Sans power right now. Using my cellphone as a hot-spot and my iPad as a laptop. The aftermath of hurricanes is brutal in Florida.

Re: Mal – Make a Lisp, in 68 languages

#50
post #44
post #42

Earlier quoted context omitted.

After being a user of languages for a long time, writing my own LISP was the experience of leaving Platons cave and seeing what the thing I use daily really is made of. What is "if"? What is a boolean, a variable, a function? It's a beautiful thing. I wish I would never have to climb down into the cave (languages with more advanced parsers) again.

You climed in the wrong direction. What you want is assembly. That's where software ends up. Also, it's interpreters all the way down. Even assembly is interpreted.

Not the wrong direction, just not far enough.

Learning assembly is great, and every programmer should dive into at least a simpler version of it, but it's not exactly the best way to learn how your high-level language is implementing tail-call optimization.

Post reply on HN