5 ms·
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 pr
by gamegoblin 11y ago
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));
}
- pschanely 11y agoYes! Typing is a BIG question here and I think some form of static analysis is going to be a critical piece of the puzzle. Completely dynamic menus I think can make users have to think too much, but it could work if you have static menus that pop up based on type (for instance, I just hit bool_to_string, so I'm already getting ready for the string-based menu that I know is going to come next...)
- gliese1337 11y agoIf you haven't already, you may want to look into "row polymorphism". I've been working on and off on a statically-typed stack-based language with type inference called Parles; it's not 100% yet, but you can check out my type inference algorithm in the git repo: https://github.com/gliese1337/Parles https://github.com/gliese1337/Parles I've got a few blog posts about it here: http://gliese1337.blogspot.com/2014/03/parles-language-with-less-irritating.html http://gliese1337.blogspot.com/2014/03/parles-language-with-...
- pschanely 11y agoFantastic; I was unaware of row polymorphism, and I'll certainly dig into it deeper. Partly, I intentionally wasn't thinking about the typing because so many incredibly intelligent people are already working on that.
- evincarofautumn 11y agoI’m working on a statically typed concatenative (stack-based functional) language called Kitten, and it’s one of the eventual goals to use type information to enable better editing environments, including on touch devices as seen here. The language is still a research project at this point, but it might be something you’d like to keep an eye on. https://github.com/evincarofautumn/kitten https://github.com/evincarofautumn/kitten
- pschanely 11y agoI had no idea this many people cared about this sort of thing! I'll totally follow along. I think there's something real in all this; we just need the right combination of ideas, and perhaps the will to collaborate.
- evincarofautumn 11y agoStatically typed concatenative programming may be at the point that lazy functional programming was a few years ago. As valuable as separate research and hobby projects are, at some point we should probably put our heads together and collaborate on a single vision. I’m more than willing to lead the effort if there’s enough interest—but as it is, it seems like those most interested in seeing it happen are those least interested in actually helping. So I just keep working on Kitten. Factor is an impressive piece of engineering, and for those who like dynamic typing, I’d strongly encourage people to use it, and see how useful a dynamic and reflective programming environment can be. It’s just not the language I want to build.