Why for works in the field of artificial intelligence often choose any of the dialects of Lisp or Prologue, that in them is something that can not be done in C #? They are interested in the comparison of possibilities (which can be done in one programming language, but it is impossible or problematic in another) of the language, and not of ready-made algorithms / methods or their number.

upd : Found IronScheme project, Github mirror

IronScheme implements over 99% of the R6RS specification and specified behavior.

work example from C # , documentation

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants aleksandr barakin , lexxl , PashaPash 1 Aug '16 at 9:38 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    The answer does not pull (nothing about C #). In a booted link Why Lisp? I liked the phrase> As a motto for Common Lisp, a description like "programmable programming language" is best suited to a Zen koan. Apparently, this property of the language should be close to the developers of AI. In essence (if we put aside the applied aspects) intelligence is the ability to think, which give rise to reflections, increase the level of knowledge (of course, building on the observed facts). - avp
  • > that there’s something that you cannot do in C # with C # problems with automatic type inference in general and for delegates Func and Action in particular is the only thing I don’t like about it - Specter
  • And where does Lisp and Scheme with their dynamic typing? - alexlz
  • There is no compile time metaprogramming in C #. In languages ​​of the LISP family it is. (Syntactic Macro) - Sarge Borsch
  • In C # there are no anaphoric lambdas and pandoric macros. - typemoon

4 answers 4

It is quite legitimate to put the question more broadly: a comparison of the possibilities of procedural, functional and logical programming. The question is very broad and requires at least a good academic article.

In principle, the capabilities of most languages ​​of all these groups are quite close. The question is only in the simplicity and ease of implementation of certain tasks. I think that everything that can be done on Lisp or Prolog is quite possible to implement in C #. Only where in these languages ​​this or that operation will take a couple of lines, can it take a couple of dozen in a procedural language.

  • 2
    There is a Turing hypothesis (unprovable). Simplistically, it says - any algorithm can be programmed on a Turing machine. The consequence is that if in a certain language it is possible to emulate a Turing machine, then any algorithm can be programmed on it. But I would like to see how to implement the # unification of terms - with renegator
  • one
    @mikillskeg C # is a language with procedural, generous, and functional tools. Here is the logical programming (if I do not confuse) here by the cash register. - alexlz
  • @alexlz, the Prologue was just mentioned in the question. - skegg
  • one
    I agree in essence, but disagree with the wording. This is too general an answer to a very specific question. It is not clear from your answer why there are different languages ​​at all then, you did not cite a single example. - 11111000000
  • @renegator please at C #: yieldprolog.sourceforge.net - Dmitry Ponyatov

Scheme is an elegant and simple language ; in addition, the proximity of syntax to the corresponding AST Tree allows the programmer to intuitively generate the necessary languages using macros . In general, for Scheme it is natural that the code is data . This is useful for developers of all sorts of matan , in tc specific for AI (processing and generating graphs is a strong place for any Lisp), but also for online stores ....

There are in Scheme fundamentally missing entities in C # , for example: Continuations , like first-class objects. This actually means that the state of the entire program can be saved and restored at the language level.

Scheme is a multi-paradigm language, its philosophy does not impose OOP, as well as pure-functional or reactive programming. The Scheme Ecosystem supports advanced tools for any, incl. and experimental techniques.

Although there is no single repository of the Scheme-code and the standard of modularity, but developed a theory and a good tradition of re-using functions built (possibly) in different styles. There is also a base of high-quality code on Scheme. Let's say there are even a few of them.

REPL is a LISP-traditional way of communicating with the interpreter, “growing” environments. Changes are made to a continuously running program — in a similar way, mathematicians work with Maxima and its analogs. For some modern languages, the same C # , a special IDE is absolutely necessary. However, there is also an opinion that the IDE as a whole complicates the development process , in any case, the iterative development process obviously helps to relieve the programmer’s RAM.

There are Scheme compilers and interpreters for any architecture - ARM, Webkit / ECMAScript, .NET, Java ... Thanks to simplicity, Scheme is one of the most portable languages ​​in the world. Recently, it has been chosen as the standard GNU extension language , and on this platform a GUIX distribution kit with the Shepherd initialization daemon (replacement of init and systemd) is built.

  • "... the first version of Javascript, like most modern languages , was written in Scheme." Can you give more details? C? C ++? C #? Java? Go? Rust? Ruby? Python? Swift? - VladD 5:53
  • It is not clear why you listed so many non-modern languages, but I agree - this is a very controversial statement, it is worth removing it from the answer so as not to breed holivar. However, in nature there is such information about many languages, for example Haskell. And Ruby its creator (Matz) generally calls Matz-lisp, although the first version of it was written in C. But at the time of design, the author obviously thought of Scheme or, at least, in AST-tree. Here it is necessary to distinguish between what the interpreter is written on for practical reasons (usually C) and what the language was created - 11111000000
  • Well, what do you think modern languages? Maybe C is out of fashion, but C ++ is actively developing, and C # is definitely ahead of the rest. - VladD
  • one
    funny by the way, that C is more relevant than bulky C ++ , which has many replacements. C has remained indispensable and is used in the biggest project of our time - the Linux kernel - 11111000000
  • one
    @ 11111000000 "in the biggest project of our time - the Linux kernel" - in what units? if in SLOC, then there are projects larger. informationisbeautiful.net/visualizations/million-lines-of-code - Stack

There are many programming languages. Here for algorithms or AI you need specials. training. And there are not many such specialists. Now select from this number of people those who know the same C # at a professional level. So it turns out that those engaged in AI, it is easier to write (()) O () in a couple of lines - and everything is ready. There is no strict typing for you, and OOP is not (almost) necessary to learn. In general, there would be an opportunity, I would learn F #. I even have a book on it. But the language really seemed complicated to me.

  • F # is a good book Functional Programming for the Real World , the whole presentation is based on the principle of comparing this language with C # - Specter
  • one
    "But the language really seemed complicated to me." There are not so many difficulties in it - the bardarity from OCaml and OOP from .NET. Unless the usual problems of studying functional programming for those with imperative experience. But there's nothing you can do ... - alexlz
  • "the language really seemed complicated to me" - after c # - I agree. The code is very compressed, sometimes very закрученный . and more features, such as active pattern - Stack

Probably the fact that the Lisp ideology itself, unlike the C # ideology, is more suitable for writing self-modifying code — a code that analyzes and modifies itself.

That is, Lisp can process its own source as data.