The Shen Programming Language
shenlanguage.org
shenlanguage.org
https://github.com/mthom/scryer-shen/
Several innovations are documented in the README. Both the Prolog implementation and the type checker are written in / hosted by Scryer (Prolog implementation is done, the type checker is in progress). Scryer has many powerful constructs for monotonic reasoning which should help to take Shen's type checker in particular to new heights of power!
If you want to jump straight into what makes Shen interesting, read Part 10 of the manual, starting with recursive types: https://shenlanguage.org/OSM/Recursive.html
Sadly, the lack of extensive free documentation is probably harming Shen's popularity.
Edit: The book is available online, but is scanned in low res blurry format, very not readable.
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?
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.
That sounds interesting. Can you give an example of a type defined this way that would not be possible in most languages?
{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.
Specifically though for Shen, what causes me pause is how frequently this kind of "call an arbitrary term-level function in the type system" is done; it is quite frequent, and thus all my mental alarm bells sound. Debugging issues that arise in things like this can be quite challenging.
Sharp/dangerous tools are often necessary, but what I find unfortunate is that you need to use those sharp tools constantly, when a safer tool could do just as well!
OTOH reading an input file is one effect that a compiler inevitably has anyway. A clean way to load and interpret an input file as a part of comptime computation would be very helpful, without the problems of arbitrary effects.
But ya know back when make was the way of doing things this would be easy to set up. Now in the age of each tool having its own build system it is different.
"Coding a Lisp Interpreter in Shen by Mark Tarver", "Shen Tutorial: Sequent Calculus by Neal Alexander", and " Defining Types in Shen by Chris Double" - these all illustrate what is going on in different ways.
That said, even if I don't use this a lot, I pay for Shen Professional to support development. Like you, I got and read the book and like the ideas, and I decided to support the project because I rather be sold something explicit (a programming language) than who knows what I get sold through a language that is open source but depends on a few or even one big company to pay the devs.
Edit: seems the github stuff is ancient (before m1) and not maintained. Should be indicated in those repositories really. The way to get it to (very easily) work, is to install sbcl, download a kernel here[0] and compile it. Works fine.
Shen doesn't have one. Perhaps the author and/or poster should remedy that?
Sounds like a great opportunity for you to contribute. Especially since the work is basically already done and your main concern is discoverability.
As developers, we exist within a shared ecosystem where we all depend on one another. Especially for non-commercial open-source projects, those who put themselves out there are doing so out of goodwill, not because they want to gain fame or money from you (beyond maybe covering the cost of hosting the project). The least we all can do is support them in some small way and thus help build the world of great free software.
Looks like it's been around for a while and I'm curious what folks have used it for.
Sounds like it is?