Comment by maxfurman

2 years ago

I am not getting a good sense from the website of what is special or unique about Shen. The top line feature (above the actual list of features) is the presence of an "S series kernel" which as far as I can tell is Shen-specific. After that the top feature is pattern matching, which has become common in the mainstream languages lately (Java and Ruby come to mind)

A little further digging shows that this language is a Lisp. Great! I love lisps and functional programming, and I have a particular soft spot for Clojure. Are there any domains where this language would excel and CLJ would not?

Shen is a very unique language, and one of the ways in which it is unique is that so much of its marketing, information, etc is non-obvious, and less accessible than you might want.

I think the main thing that I find compelling about shen is its type system, especially its sequent calculus system (for defining types in a way that would not be possible for most languages).

The other thing about it that is compelling is how portable it is. the main language is implemented in a simple kernel language; someone who wanted to port the language to a new environment would need to implement a small (relatively) set of primitives, and then you can run the entire shen environment on top of it.

Its worth looking into, however I do caution that it has plenty of rough edges etc.

For me personally I think of it as an inspiration for programming languages I wish to develop someday. Additionally, if you ever worked in a certain environment and really dislike that the language is a bit weak, shen might be something you could port to that language and use. For example, I recently updated https://github.com/deech/shen-elisp so that some of its rough edges were a bit smoothed down and should be more usable; I haven't actually written any shen yet that runs in emacs. That's still a ways away.

  • > I think the main thing that I find compelling about shen is its type system, especially its sequent calculus system (for defining types in a way that would not be possible for most languages).

    That sounds interesting. Can you give an example of a type defined this way that would not be possible in most languages?

    • One quick example is that the language allows for (nearly) arbitrary computation in the definitions of types, i.e. defining an enumeration/sum type of the employees of a company as:

      {datatype Employee

        if (element? emp read-file “employee_list.txt”)
      

      ______________________

      emp : Employee

      }

      where the enumeration type contains a case for each employee listed in the text file.

      The concept is similar to algebraic datatypes where user defined types are created from sum and product types in combination. However, in Shen the Sequent Calculus based datatypes are definable and constructable using any well formed sequent. Then add on the computational content of the sequent clauses to that and you get a system that is wildly expressive.

      7 replies →