from Hacker News

Show HN: A stack-based pure functional language for touch devices

by pschanely on 9/22/15, 1:14 PM with 19 comments

  • by gamegoblin on 9/22/15, 9:35 PM

    Before I comment, I'll just express how insanely cool this is. Mobile programming environments suck right now and this is a step in the right direction. Good proof of concept.

    Excuse me if this is implemented and just not in the README:

    It would be super awesome if there was a type inference engine that fed into the UI to increase productivity.

    For example, if I start to define a function that returns an int, when I go to write out the definition, it suggests functions to me that return ints.

    Suppose I pick a function "string_length" which takes strings and returns ints. Now I continue the composition, so it suggests functions (either built-ins or user-defined) which return strings.

    Suppose I pick "bool_to_string" which takes a bool and returns strings. Then to finish off the function I pick from a list of bool-returning functions, say I pick "xor".

    So now with a few keypresses I have defined a function that, in C, would look like:

        int foo(bool x, bool y) {
            return string_length(bool_to_string(x ^ y));
        }
  • by madkangas on 9/22/15, 2:29 PM

    My first thought was, "How does this compare to Swift?" But this is totally different: you want to create useful programs _on_ the touchscreen device.

    It's purely functional and stack-based. This is a clever approach to the UI problem - how to program when you can't typeLongWords? Answer: use the stack! I expect the act of writing programs will feel a lot like using an old programmable calculator.

    Really excited to see how this progresses!

    PS: How do I run that demo locally?

  • by reilly3000 on 9/22/15, 9:12 PM

    1. Holy shit that is a fantastic way to do mobile UX. Radials for each thumb? Fucking brilliant. I could imagine this could also make a great keyboard layout for certain domains

    2. I would flip out even more if this UI was available for more mainstream functional languages like Haskell or Clojure. Do libraries break the process? I don't think they have to.

  • by V-2 on 9/22/15, 11:42 PM

    Very interesting, but it could be explained better. I have to admit that I didn't really get it until I read some comments here.
  • by tluyben2 on 9/22/15, 9:45 PM

    Nice work! I have been playing around with touch programming concepts for a while but did not yet dare to show any to the world. Let this stimulate me in that and hope others will follow. Even if just for fun.