4 ms·
Why are people still using languages like scheme? I learned that in university and always hated all those parentheses and thought I would never have to use it a
by baby 12y ago
Why are people still using languages like scheme? I learned that in university and always hated all those parentheses and thought I would never have to use it again.
- kryptiskt 12y agoScheme is used a lot in programming language research because it is a very clean and minimal Lisp. It's a great base for experimenting with new language constructs and compilation techniques. The parentheses is just a thing to get used to, once you have done that you see the structure, not the characters. It 's also a win for research in that no effort need to be wasted on syntax, which usually isn't the object of study anyway.
- glibgil 12y agoLanguages like scheme and lisp do not have real syntax, but are more like abstract syntax tree markup languages. That is both the appeal and the dissuasion. Attempts have been made to create syntax for these languages, but it never catches on. https://www.google.com/webhp?#q=alternative+syntax+lisp+%7C+scheme https://www.google.com/webhp?#q=alternative+syntax+lisp+%7C+...
- ffreire 12y agoThis is anecdotal, but I've come to really appreciate the subtle syntax changes that Clojure has adopted. With an editor that provides support for "rainbow" parenthesis I've found Clojure to be the most readable of all the Lisps I've had the pleasure of working with (Guile and Racket among them).
- foobarbaz1234 12y agoI am a fan of Scheme but never got that statement. Why do people say Scheme/Lisp has no syntax? I mean clearly it has a _simple_ syntax, i.e. an expression is either an atom (an identifier, a number, a lambda expression, etc.) or a list of expressions, denoated by "(expr0 expr1 ... exprN). I would say it has a simple, well-thought and powerful syntax.
- thecombjelly 12y agoIt is true that it is a little more nuanced than "has no syntax". The core of the language has very little syntax relative to many of the more popular languages but it still does have some syntax. The confusion also arises because often the syntax it does have looks just the same as function invocation. "or" is syntax whereas "+" is not but they both look the same in invocation. (or fu bar) and (+ 1 2) but "or" is short circuiting and "+" is not. "or" is syntax but it doesn't look like the syntax a lot of people are used to. In fact, if you use scheme extensively you will probably use more syntax than most languages. Scheme and other lisps are very good at allowing you to create new syntax which is very helpful in creating DSLs which you will run across a lot in scheme libraries and the SRFIs.
- taylanub 12y agoIt has no syntax (of its own) in that it hijacks s-expression syntax instead. When you want to write Lisp code, you actually write some data structures in the s-expression data format, like when writing some data in JSON or XML. Then a Lisp interpreter or compiler uses an s-expression parser to read that data structure into memory, and operates on that. Then again, not just every Lisp dialect but even pretty much every implementation has its own s-expression parser with its own extensions to s-expression syntax to make it most convenient to write code in, so there's not a very good decoupling after all. :-P Nevertheless it provides some benefits. Like being able to use something like "paredit" to edit code structurally, and making macro systems somewhat simpler (though hygienic macro systems cannot work with pure s-expression data; it must be annotated with lexical context). You might find it hard to believe but I love Lisp syntax with all of its parentheses, and am explicitly against, for example, Sweet Expressions (SRFI-110). (Though SRFI-105 is fine.) By the way another meaning of the word "syntax" actually refers to something within the data structures after the actual concrete syntax has been parsed away. For example when you have a list and its first element is the symbol "if", then that list is a usage of the if syntax. This syntax takes three arguments (further elements of the list): a test, consequent, and alternative. So "syntax" is something like a function here, except it operates during compilation and its arguments are unevaluated sub-structures (roughly, code snippets, though the syntax could interpret them however it wants, like for example how the "lambda" syntax's first argument is a parameter list). That's why we can say "in other languages you can only implement new functions; in Lisp you can also implement new syntax." (In the form of macros.)
- innguest 12y ago> I learned that in university No you didn't. It is a huge misconception to think that just because you attended lectures, that you learned the material. It's clear from that comment that you did not learn Scheme.
- 1ris 12y ago>thought I would never have to use it again. See: There is your mistake.
- cpach 12y agoTo each his own.
- klibertp 12y agoNo, you didn't learn it. Reminds me of this: http://www.psmag.com/navigation/health-and-behavior/confident-idiots-92793/ http://www.psmag.com/navigation/health-and-behavior/confiden... As for why: because they learned it and are able to recognize problems where using such a language would be beneficial. That's all there is to it, really.