Live data from Hacker News

How Lisp is Going to Save the World

landoflisp.com

221–230 of 239 posts

Re: How Lisp is Going to Save the World

#221
post #215

Earlier quoted context omitted.

The opengl bindings don't really need documentation, as they're automatically generated to mirror the C API. Really, if you want to know how to use `cl-opengl`, you memorize a simple naming convention and the rest is a matter of "how do I use OpenGL," not "how do I use cl-opengl?"

And where do I find this "simple naming convention"? I tried google and found repos to the project, but nothing that told me how to read the C documentation and translate it into LISP.

I've never used cl-opengl, but the usual nameing convention for lisp names is as follows:

  name-with-multiple-words

  *global-variable*
so GLOBAL_VARIABLE and NameWithMultipleWords or name_with_multiple_words are easy to figure out. Any body who has used lisp for more than a few days knows how to name things, and since the combinations of naming schemes in C is finite, figuring this out is close to common sense. so glLoadIdentity() in lisp is (gl:load-identity).

Happy Hacking!

Re: How Lisp is Going to Save the World

#222

Earlier quoted context omitted.

That's great, but I haven't learned C. Besides that, leveraging documentation from another language is a hack. As it stands, there isn't documentation around for learning to create 3d graphics without needing to know other languages first.

Are you trolling? First off, learning C well enough to understand opengl documentation will take you much less time that understanding opengl it self(since you'll only need to read and not write C). You have a problem, people gave you a solution, having separate cl docs for opengl that have THE SAME contents, but using lisp function names instead of C ones(as it was explained, it is simple function to transform one i…

Why are you angry? It look like you've decided that if people complain about something, those people must be broken and not the system.

And why do people complain about Lisp? It's because the syntax is amazing. It's an incredible language to write in. It is more expressive than anything anyone has ever used, but then they can't do anything with that because it takes so much more effort with lisp to do things that are taken for granted in other languages. GUI libraries and frameworks are so easy with C based languages, because they contain powerful tools that I don't have to write myself.

Re: How Lisp is Going to Save the World

#223

Earlier quoted context omitted.

That's great, but I haven't learned C. Besides that, leveraging documentation from another language is a hack. As it stands, there isn't documentation around for learning to create 3d graphics without needing to know other languages first.

It's NOT a hack because the bindings are calling directly into C . CFFI is a way for lisp to directly run C functions, and a CFFI wrapper does just that: for every function that exists in the OpenGL API, the same function (with the same arguments) exists in the CFFI OpenGL bindings. Duplicating documentation needlessly is a hack. If your library that you program uses another library, are you required to document that…

Thankyou for changing my perspective. I've used a fair few high level programming languages, but it's time to get closer to the metal.

Re: How Lisp is Going to Save the World

#224
post #33

With the deepest reverence to John McCarthy, I regret to say that Lisp is our cosmological constant. It creates a static universe that is otherwise expanding; it reduces the problem to a solvable one and then declares victory. The truth is, it's all state. All of it. Remember that movie "Boy in the Plastic Bubble," about a boy with an immune system deficiency who lives instead a hermetically-sealed, sterile bubble? T…

So because there is state you want to have a messy pile of it. Many lisps have more advanced system for states then most other languages. Common Lisp has a better object system then any other in the world. Clojure has a time and state managment system.

I rate Moose (http://moose.perl.org) up there with CLOS when it comes to power, extensibility and features.

However saying these are the best OOP systems in the world is still very subjective because I do have a fondness for the simplicity and elegance of Prototype based OO especially as implemented in languages like in Io, Rebol & Self.

Re: How Lisp is Going to Save the World

#226

Earlier quoted context omitted.

Are you trolling? First off, learning C well enough to understand opengl documentation will take you much less time that understanding opengl it self(since you'll only need to read and not write C). You have a problem, people gave you a solution, having separate cl docs for opengl that have THE SAME contents, but using lisp function names instead of C ones(as it was explained, it is simple function to transform one i…

Why are you angry? It look like you've decided that if people complain about something, those people must be broken and not the system. And why do people complain about Lisp? It's because the syntax is amazing. It's an incredible language to write in. It is more expressive than anything anyone has ever used, but then they can't do anything with that because it takes so much more effort with lisp to do things that are…

  GUI libraries and frameworks are so easy with C based languages, because they contain powerful tools that I don't have to write myself.
But you DO have to write them your self. Thats just how open source works. Open source isn't about getting free stuff. People had to write those tools, and they did, because they cared. Lisp isn't so great because McCarty made it great, it's great because for 50 years people worked fucking hard to make it great. Standardizing common lisp took 10 years and a shit ton of money. Every library took months or years out of someones life. You get all that for FREE. If you really care about lisp, you will actually work to make it better. You will be one of those who spend their time and money on it.

Being one of the countless people complaining on forums impresses no one, only makes your ego feel better, doesn't actually help at all. In fact, it's hurtful to lisp, because curious people might read your comments and conclude that lisp isn't worth it for them, and for some of them, it might be, it certainly was for me. So that is why I'm angry. I'm actually trying to help you and lisp, not trying to insult people. If you care about lisp, you'll make it better, if you don't, just do something else, and be happy with it, if lisp can't make you happy. Complaining is a non solution, and I dislike non solutions.

Re: How Lisp is Going to Save the World

#227
post #192
post #183

Earlier quoted context omitted.

Without that application, there would have been another.

It wasn't.

That "it wasn't" doesn't mean that "it could not have been" (which was the point the other guy made).

This is more than an elementary logical mistake on your part, this is pure crazy.

By the same logic all those COBOL and Java applications that are deployed for something major (from banking to taxation to multi-national logistics) prove that COBOL and Java are as good as Lisp (and irreplaceable at that, seeing that "there wasn't something else deployed in their place").

What app was used in ONE war doesn't matter at all to explain which language is better than another.

Lots of far more crucial operation than the logistics in a minor war held by a superpower to a small third world country, used other languages. For example, NASA missions used assembly and C.

Does that prove anything relate to the suitability of those languages in general?

Quit the BS Lisp-proselytisation with bogus arguments and hand-waiving.

Re: How Lisp is Going to Save the World

#228
post #143

Earlier quoted context omitted.

without that application, nobody would have been there.

Well, if you go as far as to say that without Lisp nobody would have been there... Is it fair to say that Lisp started the war?

LOL! "Coalition for Peace Against LISP".

Re: How Lisp is Going to Save the World

#229

Earlier quoted context omitted.

(please excuse my poor knowledge of lisp... check out the wikipedia page if my explanation falls apart: http://en.wikipedia.org/wiki/Referential_transparency_%28com... ) My clojure interpreter gives "10" not "20". The function "or" is referentially transparent, because if you call it with the same argument values you are going to get the same result every time. (or 10 20) is the same as 10. However, the following fun…

It seems to me that what you've demonstrated is that side effects are possible in Clojure, esp. with sufficiently obfuscated (read: un-idiomatic) code. But you're working too hard anyway; Clojure explicitly admits mutability already, through various concurrency pieces like atoms and refs. That said, if any admission of mutability is sufficient to disqualify a language from claiming to encourage or support referential…

I should have known that my poor knowledge of lisp would not be excused on HN ;-)

Anyway, I tried learning enough clojure to prove that routine metaprogramming would often be not referentially transparent.

First, note from the wikipedia page that "referentially transparent" essentially means that the same function with the same arguments will always produce the same result, and that you can call it more (throwing away the result) or fewer (replacing calls with the result) times without affecting the meaning of the program.

So, mutating variables (assignment) violates it, as does reading mutable variables other than the arguments. So, using "def" on a variable that already has a value is not referentially transparent.

But let me show you something closer to what I had in mind when I said that referential tranparency and metaprogramming are essentially inconsistent.

Take the simple macro:

  (defmacro swapargs [x] 
    (list (nth x 0) (nth x 2) (nth x 1)))
First, I'll show that the argument that it takes must be the code itself, rather than the result of evaluating the code. The "or" macro before made it hard to tell whether it was taking the code as arguments or the result of evaluating the code as arguments. But with the macro above, it's easy to see:

  (swapargs (mod 7 5)) => 5
  (swapargs (mod 10 8)) => 8
If we are trying to show that swapargs is referentially transparent, we assume that it will return the same result given the same arguments. Because (mod 7 5) = (mod 10 8), then we know it must not be taking the result as an argument (because the result of the mod is 2 in both cases, but the result of swapargs is different). So it's taking the code itself.

Next, we show that give the same code-as-an-argument, it may return different results in different contexts. That's easy to show:

  (defn foo [a b] (swapargs (mod a b)))
  (foo 7 5)
  (foo 10 8)
Now, we can't replace the call to swapargs with its result, because it changes depending on the values of "a" and "b" at the time, even though the argument is always the same code "(mod a b)".

So, this kind of advanced metaprogramming doesn't seem compatible with referential transparency. Perhaps some subsets are, but I don't even think the C macro system could be supported in a referentially-transparent way.

I also think that kind of metaprogramming tends to defeat many kinds of static analysis, such as advanced type systems. I'm less sure of that one, but for practical purposes now it seems to be true.

So, I think lisp and haskell are close to local maximums for their particular philosophies, but neither one is any kind of epitome of programming or "more powerful" than the other.

Personally, I think lisp-style metaprogramming is very cool, and I am happy I spent a few minutes trying out clojure. However, I don't think it is solving a problem that is very important to me at a practical level. I am trying to learn haskell because it is trying to solve the kinds of problems that I actually have -- mainly software engineering problems (greater confidence in code, more readability and maintainability). Not sure whether it will help solve those problems for me, but they are trying very hard to do so, and make some pretty compelling arguments.

Re: How Lisp is Going to Save the World

#230
post #209

Earlier quoted context omitted.

"Compared to Haskell I found the syntax very obtuse and it was not obvious why Lisp would be more powerful than Haskell." Language "power" is ill-defined, and basically means "good". If you think that homoiconicity is good, then you probably like lisp. If you think that referential transparency is good, then you probably like haskell. Those are mutually exclusive, so one language can't really have both. But either on…

> If you think that homoiconicity is good, then you probably like lisp. If you think that referential transparency is good, then you probably like haskell. Those are mutually exclusive, so one language can't really have both. This mutual exclusivity is a strange claim that I have never encountered before (but I'm not a computer scientist). Could you explain it?

I gave some more technical details in another reply. It's one of those things I thought for a long time, and I didn't think was very controversial, but I suppose it is.

Really, what I meant was the metaprogramming associated with homoiconicity can't be done in a useful and referentially transparent way. That's because "eval"-like things are not referentially transparent.

However, there are other uses for homoiconicity aside from executing the code in an eval-like way. For instance, a text editor might use that property to inspect and transform the code being edited more easily. Also, I'm sure there are plenty of times it just makes things easier.

I think metaprogramming is also at odds with static analysis (e.g. a good type system), simply because the code itself is not static enough to analyze.

Post reply on HN