logo
首页技术栈工具库讨论
hs-duktape

hs-duktape

[Index] [Quick Jump] For package maintainers and hackage trustees Haskell bindings for duktape, a very compact embedded ECMAScript (JavaScript) engine. Here's a simple REPL example: Aeson's Value type is used for exchanging values between Haskell and ECMAScript. lens-aeson is a good library for working with Value, um, values. You can also call functions that are on the global object (or any object that's on the global object): And expose Haskell functions (same as with calls: set on global or a property of global): The functions must be of type IO (), IO Value, Value -> IO Value, Value -> Value -> IO Value... and so on. (Or with any ToJSON/FromJSON values instead of Value) Instead of createDuktapeCtx, you can use createGovernedHeap to enforce termination via a timeout: Note: The duktape configure script invoked by Cabal/Stack requires python 2 with the PyYAML library installed. pip install PyYAML is one way to achieve this. Use stack to build. Please feel free to submit pull requests! By participating in this project you agree to follow the Contributor Code of Conduct. The list of contributors is available on GitHub. Licensed under the MIT license (see to the LICENSE file). Haskell bindings: Copyright (c) 2015-2018 Greg V greg@unrelenting.technology Duktape: Copyright (c) 2013-2016 by Duktape authors (see duktape/AUTHORS.rst)
由 
bruceshi2021-01-13 收录
--
推荐
不推荐
更多信息
HACKAGE
carbal install hs-duktape
查看
标签
根据用户添加的标签生成
暂无标签