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

Yet Another Lisp Dialect

Name: Anonymous 2007-08-01 20:42 ID:dHzFpar2

I think that fexprs have been unfairly denounced by the mainstream Lisp community. Furthermore, I believe that macros, especially "hygienic" ones, are kludged up constructs that take away from the "purity" of Lisp. Hence, I present here a general idea for a language that should satisfy the little minimalists-with-OCD in all of us.

... primitives:
def, st!, bd!, clone, pair?, null?, flam, and eval.
def, st! and bd! are shortenings of define, set! and bind! The difference is that they evaluate BOTH their arguments. Why have both a set! and a bind!? Well, sometimes we want to only modify a binding, and at other times we're trying to alter a value itself. Suffice it to say that bd! does the former and st! does the latter. def has no side effects, and you can probably guess what cloning does.

The most important primitive here, however, is flam. flam works kinda like the flambdas of old with the argument specification syntax of Scheme. When a flam object is called, the raw expressions are bound to the given arguments.

"Whoah there," you must be thinking, "how would we get the value of an argument, then? Is he seriously suggesting... *gasp* DYNAMIC SCOPE!?"

No sir, I am not. This language is thankfully wholly statically scoped. And here, I shall introduce two (semi-)new constructs: current-continuation and caller-environment. The former is a symbol dynamically bound to where each flam is supposed to return. Without invoking this, the flam won't return anything. The latter is also a dynamic symbol, bound to (you guessed it) the environment of the procedure that called this flam. Yes, that means we have both first class continuations and first-class environments, compilability be damned.

Thus, lambda can be implemented in terms of flam, with each passed raw expression being (eval <expression> caller-environment)'d on the fly, and the last expression returned through (current-continuation <expression>).

Speaking of eval, you might have noticed that it is also a primitive. This is regrettable, since having a metacircular evluator has always been one of the defining features of scheme. Alas, we have no other ways of accessing environments without having to introduce more primitives, or making environments associative lists. No, eval is necessary here. Feel free to prove me wrong.

"But wait," you ask, "where's car, cdr, and quote?" Good man, I assure you: these can be easily constructed with flams.

Of course, there's other little details, like how () means false and everything else is true, and how everything besides symbols and lists eval to themselves, etc. The gist of it is that this language removed the necessity of macros, reduced the number of primitives, and added even more power by a revision of the way Lisp tends to do things.

Name: Anonymous 2007-08-01 20:48 ID:zGDfXmku

Interesting, but you'll never end up with a pure, perfect and useful language. Basically because people want to use it to actually get things done.

Name: Anonymous 2007-08-01 21:01 ID:iSFZ3TZI

>>1
fucking
give me a fucking implementation THX U.

Name: Anonymous 2007-08-01 21:17 ID:T95NWT5Z

this is, basically, a reinvention of TCL.
Also, I do not see what do you gain removing macros. you still can and will be doing macros, just with different elements.

Name: Anonymous 2007-08-01 21:44 ID:iSFZ3TZI

>>4
DON'T HELP HIM

he is complete failure

Name: Anonymous 2007-08-01 22:01 ID:Heaven

>>2
Wrong. Take a look at Haskell.

Name: Anonymous 2007-08-01 22:13 ID:zGDfXmku

>>6
Not exactly useful though, is it.

Name: Anonymous 2007-08-01 22:37 ID:dHzFpar2

>>7
You're just too entrenched in conventional programming to bother to learn Haskell syntax and appreciate its power.

>>5
lrn2grmr, fgt.

Name: Anonymous 2007-08-01 22:41 ID:zGDfXmku

>>8
Tell me something useful that's been coded in Haskell please

Name: Anonymous 2007-08-01 22:52 ID:iSFZ3TZI

>>9
XMONAD, see the recent thread on /prog/

Name: Anonymous 2007-08-01 22:56 ID:zGDfXmku

>>10
Not impressed. Anything else?

Name: Anonymous 2007-08-01 23:00 ID:T95NWT5Z

>>6
sorry, haskell is not really "pure" in the sense of few, homogeneous elements the OP is formulating. OP disdains macros cause macros are written differently than functions, which are the base element of the lisp dialect he formulates.
In haskell, not everything is a function. "=" is not a function. the do notation is not a function. A type constructor is not a function. And so on... in fact haskell, especially if syntax is involved, is quite complex, much more than say, scheme, though it's easy to keep the haskell model all in your mind.
lemme quote the paper on liskell:
"ghc internally uses 57 types and 227 constructors to represent
a parsed Haskell syntax tree."

Name: Anonymous 2007-08-01 23:56 ID:dHzFpar2

Whoops, forgot mah if, eq? and eqv?
null? is unnecessary, since it can be defined as (lambda (x) (eq? x '()))

Oh, and 'scheme' in paragraph 7 should be 'Lisp' in general.

Name: Anonymous 2007-08-06 14:48 ID:7Saij6QP

Yeah yeah, yet another Lisp-ish language. Yet none of them actually go anywhere. I wonder why that is.

Goo was a bit interesting though. Of course it never went anywhere either. Its syntax for constructing curried functions was interesting however, and thus co-opted in a Lisp macro like fifteen minutes after publication.

Name: Anonymous 2007-08-06 15:29 ID:kfNkrE9D

is the OP going to release code or not?

Name: Anonymous 2007-08-06 17:27 ID:rx0+I0Yr

How did I originally miss this thread? Anyway, the concept is quite interesting, although it seems to exist for solving a problem that only exists in OP's head. When you have a rudimentary implementation ready, make sure to post it.

Name: Anonymous 2007-08-06 18:09 ID:vCfqns5g

common lisp is lexically scoped. You fucking suck.

Name: Anonymous 2007-08-06 18:51 ID:jfRoSFuw

>>17
I don't see your point. OP never argued otherwise.
Yes, it's pretty unpractical and trollable(see >>4, who is me), but it's a cool idea.

Name: Anonymous 2007-08-06 18:58 ID:kfNkrE9D

>>16
maybe you should write an implementation, you sound quite a bit more capable than the op ;)

Name: Anonymous 2007-08-06 19:08 ID:s5v+VUHW

>>19
maybe you should write an implementation, you sound quite a bit more capable than >>16 ;)

Name: Anonymous 2007-08-06 19:12 ID:qkdnPVK9

>>21
maybe you should write an implementation, you sound quite a bit more capable than >>20 ;)

Name: Anonymous 2009-02-25 7:44


The FUTURE I SURVIVE   ON A DIET   OF DIOXIN AND.

Name: Anonymous 2011-02-03 6:19

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