top | item 16012091

Shen Programming Language for Android

44 points| doall | 8 years ago |chatolab.wordpress.com | reply

16 comments

order
[+] eggy|8 years ago|reply
Chris Double ported Shen to Wasp Lisp, which is a very interesting combination. Wasp and MOSREF (a secure remote injection framework) are something I have been playing with over the years, and having Shen in there makes for an interesting combination [1]. He also ported Wasp Lisp to Android [2].

  [1]  https://github.com/doublec/shen-wasp
  [2]  https://bluishcoder.co.nz/2013/05/09/building-wasp-lisp-and-mosref-for-android.html
[+] Wildgoose|8 years ago|reply
Shen is a genuinely interesting Lisp that is implemented using around 46 primitive functions - porting Shen then just requires the implementation of this 46 function substrate in whatever programming language you are using.

In addition to a built-in Prolog and also optional type checker it also uses pattern-matching like other modern functional programming languages. This is unlike Clojure which to my mind wrongly downgrades pattern-matching to simply an optional library. (Apparently Rich Hickey isn't keen on pattern-matching).

Shen is certainly worth investigating if you have an interest in Lisp.

[+] lmm|8 years ago|reply
I'd be very careful of looking at it given the author's ...unusual... views on copyright/licensing. In particular the author claims that releasing derivative works of Shen under the GPL is copyright infringement; Shen's license is a standard license that is widely agreed to grant the right to release derivative works under the GPL, but few people would want to have that fight, or the unknown other fights you might get into with an author with a wildly different interpretation of their license from the common consensus.
[+] mcguire|8 years ago|reply
Just tried building shen-c[1]; it seems my gcc (5.4.0) doesn't like the code with -std=c99 and prefers the -lgc at the end of the line.

[1] https://github.com/otabat/shen-c

    diff --git a/Makefile b/Makefile
    index 3ae5a55..458200d 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -26,5 +26,6 @@ ${TARGET}: ${SRC_OBJS}
     #	cc -g -O3 -std=c99 -lgc -lprofiler -Wl,-no_pie -o $@ $^
    -	cc -O3 -std=c99 -lgc -o $@ $^
    +#	cc -O3 -std=c99 -lgc -o $@ $^
     #	gcc-6 -g -O3 -std=c99 -L /usr/local/lib -lgc -lprofiler -Wl,-no_pie -o $@ $^
     #	gcc-6 -O3 -std=c99 -L /usr/local/lib -lgc -o $@ $^
    +	gcc -O3 -o $@ $^ -lgc
     
    @@ -34,5 +35,6 @@ ${OBJ_ROOT}/%.o: $(SRC_ROOT)/%.c
     #	cc -O2 -std=c99 -fno-optimize-sibling-calls -c -o $@ $<
    -	cc -O3 -std=c99 -fno-optimize-sibling-calls -c -o $@ $<
    +#	cc -O3 -std=c99 -fno-optimize-sibling-calls -c -o $@ $<
     #	gcc-6 -g -O3 -std=c99 -fno-optimize-sibling-calls -Wall -I /usr/local/include/gc -c -o $@ $<
     #	gcc-6 -O3 -std=c99 -fno-optimize-sibling-calls -Wall -I /usr/local/include/gc -c -o $@ $<
    +	gcc -O3 -fno-optimize-sibling-calls -c -o $@ $<
[+] msl09|8 years ago|reply
Pretty cool language but there's no way to save your work in the app.