News for hackers. Stuff that matters.
Re:John Carmack working on Scheme as a VR scripting language by jcromartie on Wednesday July 01, 2015 @08:30AM (#9811383)
Is this just trolling? Why a let and "hello0"? Is that just to make it look weird on purpose?

    (define (hello)
      (displayln "Hello, World!"))
    
    (hello)
Re:John Carmack working on Scheme as a VR scripting language by thechao on Wednesday July 01, 2015 @09:10AM (#9811557)
I used to program in a LISP (the language predates Lisp) derivative called "Boot". (It booted a computer algebra system.) It added two rules to LISP: unparenthesized expressions bind "to the function call", using dynamic lookup to determine arity, and failing if the binding wasn't unambiguous; and, ';' to delimit expressions. It's been a decade since I used the language, but it would look something like this:

    define (hello)
        displayln "Hello, World!";

    hello;
The boot 'compiler' only did name resolution and parenthesization, then it kicked everything back to an underlying LISP. (In this case, SBCL, which rocked!)

The second level language built on Boot was Spad, which used a slightly friendlier syntactic top-form:

    e : t = x
With compact forms:

    e := x
    e = x
    e : t
    e
Which lets you uniformly parse packages, modules, domains, categories, functions, annotations, etc. etc. For instance, we had a Spad-lite syntax:

    Monoid : Domain = public :
        _* : (y : Monoid), (x : Monoid)
        _0 : Monoid
Then you could assert membership:

    assert(Integer, Monoid) :=
        _* : (y : Integer), (x : Integer) = (_*:Integer)(x, y)
        _0 = (0:Integer)
An implementation would be:

    Monoid : Domain = public :
       -- see above.
    = implements :
       -- implementations.
Re:John Carmack working on Scheme as a VR scripting language by agumonkey on Wednesday July 01, 2015 @10:36AM (#9812079)
Quite a beautiful addition to sexps. I've seen implicit rules about top-level expression being implicitely wrapped in parens you one can write

    defun fact (n)
      (cond
         ..
         ..)
which makes lisp so much more bearable to parensophobic people.
Re:John Carmack working on Scheme as a VR scripting language by ahoge on Wednesday July 01, 2015 @08:37AM (#9811418)