The Shen Programming Language

2 years ago (shenlanguage.org)

I've spinning up a new Shen implementation from scratch, in Racket, which integrates directly with my Prolog implementation, Scryer Prolog:

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!

The author, Dr. Mark Tarver, is perhaps best known for the essay The Bipolar Lisp Programmer: https://marktarver.com/bipolar.html

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

  • He has also published The Book of Shen, which is really interesting.

    Sadly, the lack of extensive free documentation is probably harming Shen's popularity.

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?

      8 replies →

Has the license for Shen changed in the last few years? Last I remember it was a custom one that was off putting. I got and read the book years ago, interesting ideas, but not so interesting as to try and go further with a language with a weird license.

The Shen releases for Mac OS X seem to all (I tried 2.7 to 3.0) segfault on m1. That's not great.

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.

[0] https://shenlanguage.org/download.html

  • There is kernel update even on Feb. Just not sure how to use it or install it. Is there a source something that is installable under sbcl. Can it do quick lisp? What is it?

When I want to get a quick feel for a language I've never heard of, I usually look for the Learn X in Y Minutes[0] page for it.

Shen doesn't have one. Perhaps the author and/or poster should remedy that?

[0] https://learnxinyminutes.com/

Given he wrote the bipolar issue of lisp and lisp users, what/how/why this language solve this issue?

I see that it has an inbuilt compiler-compiler, prolog, and features for DSLs. Is the idea that Shen good for implementing statically typed, compiled languages? Or for metaprogramming?

Looks like it's been around for a while and I'm curious what folks have used it for.

Tip for anyone trying to show off a language: put a hello world or fizz buzz on the front page

  • this is not one of "those" languages that is begging for your use / mainstream adoption.

    • > Our mission is to bring the power of Shen technology to every major programming platform used by industry and deliver to programmers the great power of Shen.

      Sounds like it is?

      3 replies →

[flagged]

  • While we've been doing pottery for about 30,000 years, and woodworking for perhaps 10,000 years, we've only been programming (digital) computers for about 75 years or so.

    We're still figuring out how to do it. Trying new programming language ideas is a big part of that... I started with Fortran 77, and man oh man am I glad I can program in Go now.

    Thank you language experimenters!

    • And even that, in woodworking there's been three "new" methods of sharpening in the last decade or so which all became trends (and counter-trends); and new tools, new jigs, new tricks pop up all the time, so...

      2 replies →

  • Shen is well over a decade old: https://news.ycombinator.com/item?id=3026384

    • Actually

      > Shen owes its origins to work done in the 90s by Mark Tarver on applying high performance automated reasoning techniques to the problem of type checking programs. The first version of the work SEQUEL (SEQUEnt processing Language) premiered at the 1993 International Joint Conference on Artificial Intelligence under the title 'A Language for Implementing Arbitrary Logics'.

      https://shenlanguage.org/OSM/History.html

      3 replies →

  • Shen was on here ages ago. Probably back in like 2012 if not earlier. Programming languages and discussions on them pop up all the time as new folks discover them and it makes for good continuing talks.

  • Well, this is a site that a lot of programming nerds read. Programming articles seem to interest enough people here that they keep making the front page.

    Maybe just ignore the articles that don't interest you?

  • yep, it's great. One of my favourite things about HN.

    I, for one, will lament these days when the AI overlords take over and we just ask AlexaSiriGPT to write all our code in the same breath as turning on the radio.

Love the name. Literally the only reason why I clicked into this-- "Hey, is this referencing what I think it's referencing?" Neat.