我如何用runhaskell增加堆栈大小? [英] How can I increase the stack size with runhaskell?

查看:119
本文介绍了我如何用runhaskell增加堆栈大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一些一次性的Haskell脚本来解决一些 Project Euler 问题。我不想编译它们是因为我经常需要做的更改的次数很多,但是在一些情况下,我发现我已经用完了堆栈空间。


$ b $ < runhaskell 的文档表示以下语法应该增加堆栈空间:

  runhaskell + RTS -K5M -RTS Script.hs 

这永远不会有效(在我试过的任何排列中)。堆栈大小始终为8,388,608。这令人生气,我在Google上找不到太多帮助。



有什么建议吗?我在做什么错了?

解决方案

我猜你正在使用GHC。新发布的6.10.1用户手册第四章说:

lockquote

目前唯一的runghc标志是-f
/ path / to / ghc,它告诉runghc使用
GHC来运行程序。

我没有看到在 http://hackage.haskell.org/trac/ghc 上记录的错误。对我来说似乎很蹩脚。我建议询问irc #ghc或者cvs-ghc邮件列表。

在其他Haskell编译器/解释器中,只有nhc98似乎允许您设置最大值堆栈大小。根据您的操作系统,nhc98可能是一个选项。

I'm writing some disposable Haskell scripts to solve some of the Project Euler problems. I don't really want to have to compile them because of the number of changes I'm constantly having to make, but in a few cases I've found that I've run out of stack space.

The documentation for runhaskell says that the following syntax should increase the stack space:

runhaskell +RTS -K5M -RTS Script.hs

This never, ever works (in any permutation I've tried). The stack size always remains 8,388,608. This is maddening, and I haven't found much help on Google.

Any suggestions? What am I doing wrong?

解决方案

I'm guessing you're using GHC. Chapter 4 of the User's Guide of the newly released 6.10.1 says:

The only runghc flag currently is -f /path/to/ghc, which tells runghc which GHC to use to run the program.

I don't see a bug logged at http://hackage.haskell.org/trac/ghc . Seems pretty lame to me. I'd suggest asking on irc #ghc, or the cvs-ghc mailing list.

Of the other Haskell compilers/interpreters, only nhc98 seems allow you to set the max stack size. Depending on your OS, nhc98 could be an option.

这篇关于我如何用runhaskell增加堆栈大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆