|
|
Up |
|
|
  |
Author: xahleexahlee Date: Aug 23, 2008 16:42
alright, as a consequence of the current thread “Xah on Lisp”, i took
some time to clean up my essay.
here's what i have so far on the syntax irregularity subsection:
----------------------------------------------
Fundamental Problems of Lisp
Xah Lee, 2008-07
In this article, we discuss 2 problems that are rooted in lisp. One is
the irregularity in its often cited regular syntax. The other is the
language's use of “cons” for list.
SYNTAX IRREGULARITIES
Lisp family of languages, in particular, Common Lisp, Scheme Lisp,
Emacs Lisp, are well know for its syntax's regularity, namely,
“everything” is of the form “(f x1 x2 ...)”. However, it is little
talked about that there are several irregularities in its syntax. Here
are some examples of the syntax irregularity.
* The comment syntax of semicolon to end of line “;”.
* The dotted notation for cons cell “(1 . 2)”.
* The single quote syntax used to hold evaluation, e.g. “'(1 2
3)”.
|
| Show full article (7.62Kb) |
|
| | 9 Comments |
|
  |
Author: leppieleppie Date: Aug 24, 2008 00:23
On Aug 24, 1:42Â am, "xah...@ gmail.com" gmail.com> wrote:
>
> (setq myListXY `(,@ myListX ,@ myListY))
>
> could have been:
>
> (setq myListXY (eval-parts (splice myListX) (splice myListY)))
>
> or with sugar syntax for typing convenience:
>
> (setq myListXY (` (,@ myListX) (,@ myListY)))”
>
No, it should be:
(setq myListXY (append myListX myListY))
Anyways the idea of the "reader shortcuts" is to remove extra braces,
your 3rd snippet, these reader shortcuts are simply re-definitions.
Cheers
leppie
|
| |
|
| | no comments |
|
  |
Author: xahleexahlee Date: Aug 26, 2008 10:15
2008-08-26
some people here has the belief that “semantics” is more important
than “syntax”, and quote a fashionable text book on this.
in this post, i like to correct some widely popular misconception.
syntax is much more important than semantics. Syntax influences
thought, and is all there is to computer langs. Semantics merely tags
alone as a form of more machine code. If the world are made up all
morons, then language semantics will improve, syntax won't.
the so-called semantics in comp lang is just a by-product of
engineering. It is similar to shits like int, long, float, double,
memory address (that induced so-called “garbage collection”), pointer,
cons business, tail recursion, iterator and enumerator, etc.
The gist of a computer lang is manifestly just its syntax. You should
think that a computer language is just its syntax. Once you embrace
this view, languages get better.
what's a good example?
|
| Show full article (1.59Kb) |
| no comments |
|
  |
Author: namekuseijinnamekuseijin Date: Aug 26, 2008 12:16
On Aug 26, 2:15Â pm, "xah...@ gmail.com" gmail.com> wrote:
> in this post, i like to correct some widely popular misconception.
Go ahead, genius.
> syntax is much more important than semantics.
Yeah right.
> The gist of a computer lang is manifestly just its syntax.
Really?! I thought the example from the "fashionable text book" made
it quite clear the same syntax used in java, c and ocaml/haskell meant
quite different things.
What about blocks like these: {}?
They mean lexically scoped blocks in Java, closures in Ruby, and
unevaluated arguments to Tcl procedures.
By reading a piece of syntax alone, you can infer almost nothing from
what it's supposed to mean.
I'm sorry, but behaviour/meaning/content is far more important than
the syntatic wrapper it comes in. And if you don't like current
syntax, in Lisp at least you can always define new more convenient
syntax at will.
|
| Show full article (1.35Kb) |
| no comments |
|
  |
Author: Peter KellerPeter Keller Date: Aug 26, 2008 12:31
In comp.lang.scheme xahlee@ gmail.com gmail.com> wrote:
> syntax is much more important than semantics. Syntax influences
> thought, and is all there is to computer langs.
I'd have to disagree with this. Syntax is a guide to the semantics of
a programming language. You can pick languages that show each in the
extreme and are basically useless for everyday use languages.
Let's take an example like the Unlambda programing language. Here is
a program to compute the fibonnaci sequence, emitting strings of asterisks
representing the number sequence:
```s``s``sii`ki`k.*``s``s`ks``s`k`s`ks``s``s`ks``s`k`s`kr``s`k`sikk`k``s`ksk
I'd call that some pretty regular and very simple syntax.
You can look it up on line to find out the exact meanings (is this
statement ironic in this context or what?) of the above symbols. But
basically, it is functional application and substitution.
However, the meaning of the above is not easy to discern.
> the so-called semantics in comp lang is just a by-product of
> engineering. It is similar to shits like int, long, float, double,
> memory address (that induced so-called ?garbage collection?), pointer,
> cons business, tail recursion, iterator and enumerator, etc.
|
| Show full article (3.51Kb) |
| no comments |
|
  |
Author: xahleexahlee Date: Aug 29, 2008 16:40
2008-08-26
First of all, if you don't have a master degree in computer science,
and, if your specialization is not in computer languages design (i.e.
logics, mathematical formalism, some elements of computational
linguistics), then, you probably won't understand this post. However,
if you are bright, and have a open mind, then the views expressed post
can be meaningful or beneficial to you.
To begin, let me make it explicit that this post is about the concept
of syntax and semantics in computer languages. For example, are
computer languages defined by syntax and semantics? Does syntax and
semantics comprise the whole of a computer language? What is a
computer language? What is syntax, what is semantics? etc.
First, lets note few facts:
• there is no formal and universally accepted definition of what is
meant by “semantics”. There may be some, if so defined, they are
typically based on “models” over idealized, abstract hardware (i.e.
operations on values in storage; as in finite state machine).
|
| Show full article (9.56Kb) |
| no comments |
|
  |
Author: Michael EkstrandMichael Ekstrand Date: Aug 29, 2008 17:54
> To begin, let me make it explicit that this post is about the concept
> of syntax and semantics in computer languages. For example, are
> computer languages defined by syntax and semantics? Does syntax and
> semantics comprise the whole of a computer language? What is a
> computer language? What is syntax, what is semantics? etc.
>
> First, lets note few facts:
>
> • there is no formal and universally accepted definition of what is
> meant by “semantics”. There may be some, if so defined, they are
> typically based on “models” over idealized, abstract hardware (i.e.
> operations on values in storage; as in finite state machine).
I think that something along the lines of "the results of evaluating an
expression or statement written in the language" would be a suitable
working definition. No, I don't have a citation for that. But in my
experience, people don't tend to be too confused as to what "semantics"
means.
|
| Show full article (7.15Kb) |
| no comments |
|
  |
Author: Ray DillingerRay Dillinger Date: Aug 31, 2008 08:18
> First, lets note few facts:
>
> • there is no formal and universally accepted definition of what is
> meant by “semantics”.
This statement is false. Formal semantics is mathematics. Figuring
out what a statement is supposed to do is proving a theorem given the
defined axioms of the formal semantics. The semantics of a statement
are a transformation of one program state into another. Usually we
represent the program states as strings, hence the relevance of grammars
for transforming one string into another.
> There may be some, if so defined, they are
> typically based on “models” over idealized, abstract hardware (i.e.
> operations on values in storage; as in finite state machine).
Granted, actual implementations on machines with finite memory tend
to be unable to fully implement the formal semantics of a language,
in much the same way that automated theorem provers on machines with
finite memory are unable to prove some theorems.
|
| Show full article (4.72Kb) |
| no comments |
|
  |
Author: Rob WarnockRob Warnock Date: Sep 1, 2008 00:22
Ray Dillinger sonic.net> wrote:
+---------------
| Even with the reduced power of a type-2 grammar (the context-free
| languages, which includes nearly all modern computer languages)
| you can directly solve most math problems using string manipulation
| rules. I know, because I implemented exactly that as homework once.
| You start by implementing incrementing, decrementing, doubling,
| and halving as string transformation operations, introduce
| nonterminal symbols that can prepend numbers indicating that one
| of these operations is needed, and go from there.
|
| I guess my point is that "transforming strings into strings"
| *is* a pretty darn good model of what a compiler does, and a
| pretty good model of semantics, and understanding the theory
| *is* relevant far beyond...
|
| Show full article (2.96Kb) |
| no comments |
|
  |
|
|
  |
Date: Sep 1, 2008 00:32
> "Rewrite-rule" or "reduction" computers were a quite active area
> of research several decades ago, though not so much these days.
I think Haskell is just about always implemented with graph rewriting
(reduction), though specified in lambda calculus. Clean is specified
in terms of graph rewriting which the authors claim has advantages.
|
| |
| no comments |
|
|