
Shen: A Sufficiently Advanced Lisp [video] (2014) - sea6ear
https://www.youtube.com/watch?v=lMcRBdSdO_U
======
616c
Also interesting and worthy of note is that this project transitioned to BSD
recently, and they are doing it as part of a donation drive.

[http://www.shenlanguage.org/shenbsd.htm](http://www.shenlanguage.org/shenbsd.htm)

I am an amateur Lisper, and like others I whined (perhaps irrationally) that
their custom non-OSI only one implementation of the language or else license
was scaring people off. Not that the BSD license assuages my concerns about
community weirdness (hard to describe, but this ia a very personal opinion and
you can dismiss it), but I would like to see if the demand will drive open
sourcing the code.

Also very cool is that you can find Shen implementations in more than one
flavor: Common Lisp, Clojure, Ruby, and more. Definitely check out the site if
you have not yet.

~~~
lomnakkus
That was a really weird "episode" in the history of Shen, IMO. I mean, the
outcome was good and all, but it was really weird to ask for donations to
change the license. I don't think there was any real explanation for that
other that "we want money"?

~~~
doublec
I believe it came from a discussion where to draft a new license would require
the original developer to pay a lawyer. Someone suggested raising money to pay
the developer the money to transition to BSD, a known license, instead of to a
lawyer for yet another unknown license.

~~~
lomnakkus
Wow, that's even weirder than I imagined. Regardless, I'm glad it's been freed
due to the generosity of some individuals :)

------
dgreensp
It's pretty strange to see a "Lisp" with so much syntax. Lots of infix
notation, and even semicolons! Usually Lisps have a very simple reader that
reads S-expression and a few other things, but here we have this:

    
    
      (define map
        { (A --> B) --> (list A) --> (list B) }
        F [] -> []
        F [ X | XS ] -> [(F X) | (map F XS)])
    

And this is one of the cases without any semicolons.

Shen also uses the atrocious "curried form" of function types, where the
function that adds two numbers has type number->number->number, and the reader
must do the mental gymnastics to convert it to (number,number)->number (and
good luck when it's more complicated than that).

I wonder if you took a language like Haskell and changed some of the syntax to
look Lispy if it could masquerade as a Lisp? I'm not saying that's what's
happening, it's just hard to wrap my head around a syntax like this that
claims to be Lispy.

~~~
deech
You don't have to use any of the syntax if you don't want to. You can write
directly in KLambda. Here's how `map` is defined in KLambda:

    
    
       (defun map (f l)
         (shen.map-h f l ()))
    
       (defun shen.map-h (f l accum)
         (cond ((= () l) (reverse accum))
               ((cons? l) (shen.map-h f (tl l) (cons (f (hd l)) accum)))
               (true (shen.f_error shen.map-h))))

------
codygman
Put this in my "watch later" queue. I'm _very_ interested in a Lisp whose type
system is on par with that of Haskell/Ocaml.

EDIT: Especially since Shen is now BSD licensed.

~~~
AnimalMuppet
To me, it seems impossible to have both macros and a type system on par with
Haskell. Either your macros can no longer do arbitrary textural
transformations, or your type system can't reason about macro cases. (Or, I
suppose, your type system has to run after the macro transformations, and you
could get a type error then just like you could get a syntax error then. But
that means your IDE/development environment can't give you any type assistance
on macro calls - you have to compile it to find out if it works. (Or, I
suppose, your IDE has to run the macro for you and then do the type checking
on the resulting post-macro code.))

I am open to being proven wrong, though...

~~~
necubi
Scala has macros [0], and as you reasoned the type checker has to run after
the macro expansion. That's not a huge downside; to the user it still appears
to be a single pipeline (parsing -> macro expansion -> type checking ->
compilation).

Haskell also has very powerful metaprogramming facilities, like template
haskell [1].

[0] [http://scalamacros.org/](http://scalamacros.org/) [1]
[https://wiki.haskell.org/Template_Haskell](https://wiki.haskell.org/Template_Haskell)

------
alvatar
Once again, types are way overrated. However, Shen is an interesting new Lisp
to watch. Needs a more open community, though (like a free book and/or deep
documentation).

~~~
lomnakkus
> types are way overrated.

Please show your scientifically rigiorous evidence. Because it appears very
few other people have any (either way), so at the very least you could earn a
prize if you shared yours! :)

~~~
fchollet
> Because it appears very few other people have any (either way)

If there is no evidence either way, yet every other developer raves about
types all the time (the way "connaisseurs" rave about fine wine and expensive
scotch despite being unable to objectively tell the difference), doesn't it
follow that types are overrated?

~~~
lomnakkus
Wow. Way to bias the discussion by segueing into to wine and/or whisky! We're
not discussing neither wine nor whisky, so... maybe you'll dispense with the
hyperbole?

What is your actual point and what is your evidence?

------
mordocai
Unfortunately I found shen a pain to get into due to it still being mostly a
teaching tool. However, if the community builds some nice tooling around it I
will definitely give it another look.

~~~
tluyben2
Working on it!

------
juliangamble
Shen stands above other languages (apart from Idris and Coq) in the area of
dependent types.

~~~
doublec
I haven't looked at the ability to have dependent types in Shen - it'd be
great to see some examples. A quick search on the mailing list found:

[https://groups.google.com/d/msg/qilang/lokvvf0xLJc/20y8ZkzoN...](https://groups.google.com/d/msg/qilang/lokvvf0xLJc/20y8ZkzoNH4J)
[https://groups.google.com/d/msg/qilang/D3tmhQvfnOE/qcsXhRomF...](https://groups.google.com/d/msg/qilang/D3tmhQvfnOE/qcsXhRomFb0J)

