否则,没有任何理由不能直接编译这些 Haskell 实现对于 Android,使用 NDK。只要它们是用 C 语言编写的,就应该可以在 Android 上运行。对于 C++,这有点棘手,因为 Android 没有所有 C++ 头文件。
Surprisingly, I couldn't uncover any existing Haskell interpreter for Android.
But here are some instructions for writing your own interpreter for the Scripting Layer on Android. That's assuming you're willing to try mapping the haskell functions on top of the Java android ones (which is not a perfect solution, I know). You'll also want to refer to their scripting layer written for Scala, because that's the one that comes closest to Haskell (which is not very close I admit).
Otherwise, there shouldn't be any reason why any of those Haskell implementations couldn't be directly compiled for Android using the NDK. As long as they're written in C, they should work on Android. For C++, that's a little bit more tricky since Android doesn't have all the C++ headers.
It's not as solid as a dedicated app or scripting layer would be, but honestly, for your use cases, it would provide almost exactly the same functionality as those options (if not more). And it would be just as "mobile" as a website (depends only on the uptime of the host and the connectivity of the client).
You can use tryhaskell.org from your mobile browser. It will accept any valid expression, but keep in mind that defining your own data types won't be possible.
For some negative information, all the work I've seen for GHC on Android (such as http://ipwnstudios.com/) is based on cross-compilation, rather than building GHC for android or ARM.
I just found IDEone in the Android Market, which sends your code to an online service. It works, but programming on Android isn't much fun. Btw: In case you don't want to register see BugMeNot
发布评论
评论(6)
令人惊讶的是,我找不到任何现有的 Android Haskell 解释器。
但这里有一些为脚本层编写自己的解释器的说明安卓。假设您愿意尝试将 haskell 函数映射到 Java android 函数之上(我知道这不是一个完美的解决方案)。您还需要参考他们为 Scala 编写的脚本层,因为这是最接近 Haskell 的脚本层(我承认这不是很接近)。
否则,没有任何理由不能直接编译这些 Haskell 实现对于 Android,使用 NDK。只要它们是用 C 语言编写的,就应该可以在 Android 上运行。对于 C++,这有点棘手,因为 Android 没有所有 C++ 头文件。
Surprisingly, I couldn't uncover any existing Haskell interpreter for Android.
But here are some instructions for writing your own interpreter for the Scripting Layer on Android. That's assuming you're willing to try mapping the haskell functions on top of the Java android ones (which is not a perfect solution, I know). You'll also want to refer to their scripting layer written for Scala, because that's the one that comes closest to Haskell (which is not very close I admit).
Otherwise, there shouldn't be any reason why any of those Haskell implementations couldn't be directly compiled for Android using the NDK. As long as they're written in C, they should work on Android. For C++, that's a little bit more tricky since Android doesn't have all the C++ headers.
Hugs 是用 C 语言编写的,非常可移植。应该可以移植到Android上。
Hugs is written in C and quite portable. It should be possible to port it to Android.
根据 imz 的说明,您所需要的只是
它不像专用应用程序或脚本层那么可靠,但老实说,对于您的用例,它将提供几乎完全相同的功能 作为这些选项(如果不是更多)。它就像网站一样“移动”(仅取决于主机的正常运行时间和客户端的连接)。
Taking a note from imz, all you need is
It's not as solid as a dedicated app or scripting layer would be, but honestly, for your use cases, it would provide almost exactly the same functionality as those options (if not more). And it would be just as "mobile" as a website (depends only on the uptime of the host and the connectivity of the client).
您可以通过移动浏览器使用 tryhaskell.org。它将接受任何有效的表达式,但请记住,无法定义您自己的数据类型。
You can use tryhaskell.org from your mobile browser. It will accept any valid expression, but keep in mind that defining your own data types won't be possible.
对于一些负面信息,我在 Android 上看到的 GHC 的所有工作(例如 http://ipwnstudios.com/) 基于交叉编译,而不是为 android 或 ARM 构建 GHC。
For some negative information, all the work I've seen for GHC on Android (such as http://ipwnstudios.com/) is based on cross-compilation, rather than building GHC for android or ARM.
我刚刚在 Android Market 中找到了 IDEone,它将您的代码发送到在线服务。它可以工作,但是在 Android 上编程并不是很有趣。顺便说一句:如果您不想注册,请参阅 BugMeNot
I just found IDEone in the Android Market, which sends your code to an online service. It works, but programming on Android isn't much fun. Btw: In case you don't want to register see BugMeNot