Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Lisp, Scheme better than C for AI?

Name: Anonymous 2013-08-02 18:42

Hello. It seems everyone believes that Lisp-like languages are better than proceedural languages like C for AI. Why is that?

I suspect that recursion plays a part, but could use specific examples. Recursion is also possible in C, but not to the same degree or with the same ease, perhaps? Also, the distinctions between "live" processes and "dead" data have been said to be less clear in dialects of Lisp. Does this imply some valuable sorcery not easily wielded in C yet essential to AI advances? Examples and natural-language responses would be appreciated.

Perhaps a discussion of what's essential to AI and what's not (with respect to programming techniques and paradigms) is the thing I crave, something beyond the many FAQ-level responses.

Name: Anonymous 2013-08-02 18:52

Is is too low level of a language to do the exploratory programming required in exploring AI. C requires users to deal with busywork like tracking memory allocation and dealing with explicit type definitions. You can write generic Lisp functions that will work on a huge range of data. On top of that, Lisp's macro system makes it easy to write DSL to deal with certain systems. I also like writing anonymous functions in Lisp, it helps in cognition to show the programmer that a certain procedure can be factored into a function without needing to add to the function namespace of the "more important" functions.

Name: Anonymous 2013-08-02 20:02

https://www.google.com/search?q=why+lisp+for+ai
About 1,620,000 results (0.43 seconds)

Name: Anonymous 2013-08-02 20:42

Sure, it could be done. All turing complete languages can be used to achieve the same thing. But it would be a waste of time. Any AI experiment is going to be a failure 99.999% of the time anyway, so there is no need to waste resource worrying about how the prototype implementation runs with regards to speed or efficiency. It's more important to be able to be able to implement ideas quickly and save time for the programmer, who can spend more time thinking about what to write and less time worrying about whether whitespace is going to make Boost shit all over the linker.

If you're writing code that is actually going to do something important, like an autopilot or something, it would be best to rewrite it in C (or more likely Ada, the government loves that shit), where it can be tuned to the hardware and ensure that there is absolutely no room for error. If you're writing controls for a nuclear power plan, you'd better prove that shit is correct, down to the last bit. You could do this in Lisp too, but it's abstract enough to need you to prove the interpreter as well.

Working on machine vision? No one gives a flying fuck if that microcontroller crashes. Write it in Lisp. It'll be more elegant and readable than C, and it won't take nearly as long to write.

Name: Anonymous 2013-08-02 21:33

Lisp is better for mathematics in general. In C, 2*x is just an expression. You can't do anything with it. In lisp, (* 2 x) is an expression and a data structure. You can easily write a function to take its derivative or integral. You can also store it in a list to include it in vector and matrix operations. These are all very important in AI.

In practice however, most AI is done in C++.

Name: Anonymous 2013-08-02 22:42

>>4,5
You idiots know nothing about LISP. How about you just go the fuck back to /g/.

>>5
Lisp is better for mathematics in general. In C, 2*x is just an expression. You can't do anything with it. In lisp, (* 2 x) is an expression and a data structure. You can easily write a function to take its derivative or integral. You can also store it in a list to include it in vector and matrix operations. These are all very important in AI.
And that can't be done in Sepples? Only if you're an idiot.

Name: Anonymous 2013-08-03 0:25

>>6
And that can't be done in Sepples? Only if you're an idiot.
C++ users are idiots. All of them.

Name: Anonymous 2013-08-03 0:27

>>1
Lisp:
(to compile-builtin xs ! match xs
  (("fn" args . body) (compile-fn args body))
  (("if" test then else) (compile-if test then else))
  (("quote" x) (compile-quote x))
  (("set" place value) (compile-set place value))
  (("goto" label) (compile-goto label))
  (other (bad "builtin {xs}")))


C/C++:
asm *compile_builtin(expr *xs) {
  expr *xs, *args, *body;
  if (is_string(expr_head(expr)) && string_equal(expr_head(expr), "fn")) {
    xs = expr_tail(expr);
    if (list_end(xs)) error("invalid fn form");
    args = expr_head(expr);
    body = expr_tail(expr);
    if (list_end(xs)) error("invalid fn form");
    return compile_fn(args, body);
  }
  ...
}

Name: Anonymous 2013-08-03 0:31

>>2
Actually, you can do AI in C/C++, but it would be mostly limited to initializing neural-net shaders for GPU.

Name: Anonymous 2013-08-03 3:50

C bashing is going too far. In many ways, C is a much more powerful language than common-lisp. I can think of many non-trivial applications that require number-crunching, text searching and sorting, and/or massive I/O that can't afford to wait for garbage collection or consing of any sort. -- David Magerman

Name: Anonymous 2013-08-03 3:50

>>10
David Magerman
Shalom!

Name: Anonymous 2013-08-03 5:27

Name: Anonymous 2013-08-03 5:30

>>12
I am also the founder and president of The Kohelet Foundation, a private foundation focused on Jewish education. Our two main projects are: Kohelet Fellowships and Kohelet Yeshiva High School (formerly Stern Hebrew High School). I'm involved in a number of local and national Jewish philanthropic efforts, including Partners In Torah (which operates Jewpiter for Birthright alums), In His Image, The Chevra, and Jewish day schools in the Philadelphia area.
Ololo!!!

Name: Anonymous 2013-08-03 8:03

The swearing will continue until code quality improves.

Don't change these.
Name: Email:
Entire Thread Thread List