On Tue, Apr 19, 2005 at 04:28:50PM +0200, Santoemma Enrico wrote:
> Hello,
>
> may somebody give the directions to write an interpreter in Haskell?
> Is the parsec package enough, or I'll also need to write a 'grammar' and feed
> some tool with it?
> I want to put the language's source into xml a
On Tue, Jun 22, 2004 at 09:45:48AM +0100, Simon Marlow wrote:
> On 22 June 2004 06:11, Bernard James POPE wrote:
>
> > Ideally I'd like this function:
> >
> >blockThread :: ThreadId -> IO ()
> >
> > and thus:
> >
> >unBlockThrea
On Tue, Jun 22, 2004 at 10:37:54AM +0200, Volker Stolz wrote:
> In local.glasgow-haskell-users, you wrote:
> > Ideally I'd like this function:
> >blockThread :: ThreadId -> IO ()
> >unBlockThread :: ThreadId -> IO ()
>
> I should have some bit-rotted patches here for
> freezeThread :: Thre
On Tue, Jun 22, 2004 at 09:27:40AM +0100, Simon Marlow wrote:
> On 22 June 2004 03:51, Bernard James POPE wrote:
>
> > The mblocks_allocated variable should give me what I want.
> >
> > I think having access to this would also be useful to people who are
> > profi
Hi again,
Ideally I'd like this function:
blockThread :: ThreadId -> IO ()
and thus:
unBlockThread :: ThreadId -> IO ()
However I can see that there might be some tricky issues to resolve,
such as what happens if you try to block an already blocked thread?
Perhaps the return type could
On Mon, Jun 21, 2004 at 02:50:39PM +0100, Simon Marlow wrote:
> On 21 June 2004 09:14, John Meacham wrote:
>
> > There might be some RTS calls to query the heap, but someone else is
> > probably more qualified to comment on that.
>
> The value of the mblocks_allocated variable in the RTS will giv
Hi all,
Is there any way I can find out or estimate the memory size
of a program while it is executing?
This may very well be problematic and system specific, but
I haven't a clue where to look. Perhaps there is a posix
interface I am missing? Or a hook into the runtime?
Why do I want to know t
Hi all,
In buddha I've started using System.Console.Readline for the command
line (which btw is very nice, thanks to those who made the binding).
Buddha uses autconf to configure itself. I want to check whether the
host supports System.Console.Readline.
One option is to ask ghc-package to list t
On Tue, Apr 20, 2004 at 01:59:33PM +0100, Simon Marlow wrote:
> On 20 April 2004 12:48, Bernard James POPE wrote:
>
> > Results:
> >
> >method runtime (s)
> >---
> >pure0.7
> >ffi
On Tue, Apr 20, 2004 at 02:56:36PM +0200, Ketil Malde wrote:
> Bernard James POPE <[EMAIL PROTECTED]> writes:
>
> > Note each program was compiled with ghc 6.2 with -O2 on debian linux.
> :
> > main = print $ loop 1 0
>
> Isn't this go
Hi Andre,
> There's another way which you missed: using implicit parameters. I
> remember reading a paper a while ago called Global Variables in Haskell
> (sorry, don't remember the author -- Jones, perhaps?) which did similar
> benchmarking to yours, and carrying around the global variable wi
On Thu, Apr 15, 2004 at 10:43:22AM -0700, Carl Witty wrote:
> > > However, if you have any suggestions about how to make a FAST
> > > global counter
> > > I would be very glad to hear it. From profiling it seems like
> > > this code
> > > is a little expensive (also it is called quite frequently)
On Tue, Apr 13, 2004 at 02:03:21PM +0100, Simon Marlow wrote:
>
> > On Fri, Apr 09, 2004 at 03:27:01PM +0200, David Sabel wrote:
> >
> > > you can turn off let-floating by compiling without optimizations,
> > > i.e. without using a -O flag or using -O0 explicitly.
> > > The disadvantage is that
On Fri, Apr 09, 2004 at 03:27:01PM +0200, David Sabel wrote:
> you can turn off let-floating by compiling without optimizations,
> i.e. without using a -O flag or using -O0 explicitly.
> The disadvantage is that most of all other optimizations
> are turned off too.
That is exactly what I'm doin
On Tue, Apr 06, 2004 at 09:38:38AM +0100, Simon Peyton-Jones wrote:
> Strangely (and bogusly) there is no such flag in GHC6.2. Someone must
> have noticed this already because it's there in the HEAD
> (-fno-full-laziness), and has been since Feb 2004. Strange.
Thanks,
I think it would be good f
Hi all,
In the documentation for System.IO.Unsafe
it says:
Make sure that the either you switch off let-floating,
or that the call to unsafePerformIO cannot float outside a lambda.
My question is how can you turn off let floating? I can't seem to
find a flag that suggests this behaviour
Peter wrote:
> BTW, does Language.Haskell.Parser.parseModule already perform infix
> resolution?
Unless it changed very recently, then no.
I have written some code for this very task:
http://www.cs.mu.oz.au/~bjpop/code/Infix.hs
You give it the infix rules that are in scope and a mo
Hi all,
During my work on buddha (haskell debugger) I've had the need
to print arbitrary values from a running program.
Along the way I've written some code that works with GHC
to do this.
Just in case there are others who might benefit from this,
I've ripped some code out of buddha and made it
Hi All,
I'm trying to write some code that catches unix signals and turns them
into GHC exceptions, GHC version 6.0, debian linux
Heres my code:
--
module Main where
import Control.Concurrent
import Control.Exception
import System.Posix
import IO
catchCtrlC :: IO H
declarative
debugger (buddha). I'm abusing the -prof option to get the string names of
constructors in the heap representation of values. I know it is a hack, but
for the moment it works well enough.
Cheers,
Bernie.
- End of forwarded message from Bernard James POPE -
_
Hi all,
With ghc 5.04.2 I'm having some trouble linking (debian linux).
Here's the error I get:
/home/bjpop/woo/lib/buddha-0.5/libbuddha_p.a(Partial.o):
In function `s1jZ_fast1':
Partial.o(.text+0xa44): undefined reference to `GHCziPrim_zdwZ2H_entry'
This is repeated about 4 times for
> Is there a "ghcfilt" equivalent of c++filt that will unmangle
> 'z'-escaped GHC symbols?
Encoding/decoding are done in the compiler in:
ghc/compiler/basicTypes/OccName.lhs
See functions encode and decode. Though I'd say this is only available
inside the compiler, not sure if it is exported
Hi all,
In C, I have an StgClosure pointer, pointing to a THUNK.
I would like to know whether this particular THUNK is a raise_closure,
(as built by raisezh_fast() in rts/Exception.hc).
Is there any identifying information I can use to tell definitely whether
this THUNK is a raise_closure? Perha
Hi all,
This might seem like a strange thing to do, but ...
Presume I have a HaskellObj in some C code. I know that it is a thunk.
I want to force it to _WHNF_ .
Should/can I use rts_eval()?
Any pointers on what this does (start new threads, cause garbage collection
...) would be appreciated.
Simon Marlow writes:
> I've been thinking about duplicating/replacing Handles for a while.
> Here's a possible interface:
>
> -- |Returns a duplicate of the original handle, with its own buffer
> -- and file pointer. The original handle's buffer is flushed,
> including
> -- discarding any
> You can call 'System.Posix.IO.dup stdin' and save this value.
> However, I think you then need to explicitely read from this fd as
> it is not possible to reset what GHC thinks stdin is currently to
> this new fd (I'll dig into this and maybe we'll get a
>setStdin :: Fd -> IO ()
> from this,
Hi all,
There's probably a really obvious answer to this, but I can't find it.
Is there any way in GHC to reopen stdin if it has been closed?
You may wonder why I'd want this. Well I'm writing a debugger
for Haskell 98 (*) and my debugger wants to do some interaction on the terminal
_after_ the
Hi again,
I know I'm becoming a pest with this, but another question about
-fno-implicit-prelude:
What happens with literal numeric patterns?
For this part of the prelude:
gcd :: (Integral a) => a -> a -> a
gcd 0 0 = error "Prelude.gcd: gcd 0 0 is undefined"
gcd
Dylan writes:
> On Tue, Jul 16, 2002 at 04:02:44PM +1000, Bernard James POPE wrote:
> > I would like to use do-notation in the transformed program, but have it
> > refer to Prelude.Monad and not MyPrelude.Monad which is also in scope.
>
> Why do you have a MyPrelude.
Malcolm writes:
> Bernie writes:
> > I did wonder how Hat tackled this.
> > Out of curiosity what is the solution that Hat uses?
>
> Hat doesn't have a solution. When the lack of correct defaulting
> causes Hat to generate type-incorrect code, the underlying compiler
> will complain vociferousl
Hi again,
Malcolm writes:
> We came across the same problem in the Hat tracer (which is also a
> source-to-source transformation, and can also be used for debugging).
>
> The problem is that the transformation introduces new classes, so
> Prelude.Ord -> HatPrelude.Ord
> Prelude.Eq -> Ha
Hi All,
Thanks to everyone for their comments.
I can see that this is quite a difficult design problem, and it is
unlikely that one solution will please everyone, which makes me think
that the current solution will probably stand.
Simon Peyton-Jones writes:
> Bernie writes:
> | anymore. What
> Dear GHC,
>
> Do you provide in your interactive system a denotation for
> the last result?
> (`:?' command does not show it). For example,
>
> Prelude> 1
> 1
> Prelude> % + 1
> 2
> ...
It is called "it"
Prelude> 1
1
Prelude> it + 1
2
Prelude> it + 1
3
This follows from other e
Hi all,
Ever had that deep desire to see what was in that pesky
Stable Pointer/Name table?
Probably not, but I did, and I wrote some code to
print it out in all its glory from the safe confines
of a Haskell program. I thought I'd share it with you
just in case one day you too want to see what is
Hi all,
Announcing the GHC internals library, version 0.1.
Essentially this provides a means for polymorphically
deconstructing values that reside on the GHC heap, all
from the comfort of your Haskell program.
For those who are familiar with the HugsInternals
library that comes with Hugs, it o
> I know -ddump-types will get me the types of top level functions, but is
> there a way to get ghc (or really any compiler) to dump the types of
> everything (or at least more than that, maybe just locally bound
> definitions)?
Hi Hal,
I once tried to do this with an older version of GHC. From
Hi Simon,
(posted to [EMAIL PROTECTED] in case anyone else is
reading this).
> I just tried your example and it seems to run in constant space here
> with 5.02.2. The code looks fine - this isn't something we really
> envisaged people doing with the RTS API, but there's no real problem
> with i
Hi All,
I've been playing with the FFI in GHC 5.02.2
I'm not sure if I'm using it correctly because I get a space leak
in my program.
Okay, very simply I want to construct a Haskell value from
within a C function and pass it back to Haskell. In the
following program I have an algebraic type cal
> > If it's a global symbol, you should be able to access it form the ffi.
> >
> > If you want to traverse data structures the way you can using the
> > HugsInternals library, you might want to tweak the code a little to
> > provide a similar semantics/ API. Basically, all you have to do is
> >
Hi all,
I'm looking at extending my debugger for Haskell to GHC (currently only
works for Hugs, which is a pity).
I have a couple of questions about printing data structures from the
GHC heap.
Is there a way to compile the RTS so that the names of data constructors
are retained?
It looks lik
Hi all,
Hack alert!
I took Julian's advice and looked over the assembly output from
ghc.
In all the cases I tried, the info pointer in the closure header
pointed to the end of the info table. Although a comment in
ghc/includes/ClosureMacros.h worries me:
"info pointer"The first word
Hi all,
More mind boggling questions on prim ops :)
I am happy with isWHNF that is implemented with:
#define isHNFzh(r,a) r=(! closure_THUNK((StgClosure *)a))
I will re-write for the IO Monad later.
I want to mimic this behaviour in the native code
generator.
Sigbjorn gave me this suggest
Hi all,
Apologies for my large number of postings to this list of late.
> the normal definition of WHNF applies only
> to types containing _|_, i.e. pointed types. Unpointed types are never
> represented by thunks, so I would be inclined to include them in WHNF.
Yes, I agree here. It is useful
> | > I would like to add a primitive to GHC 5.00.2 of the form:
> | >
> | >isWHNF :: a -> Bool
>
> One might be inclined to ask what for? Such a primitive is
> probably difficult to implement, given the variety of GHC's
> closures,
>From reading the documentation that comes with GHC and g
Hi GHC people,
I would like to add a primitive to GHC 5.00.2 of the form:
isWHNF :: a -> Bool
I was able to do (something like) this a while ago in 4.06, but have got
stuck trying to do the same with 5.00.2.
Here's what I have tried:
After reading ghc/compiler/prelude/primops.txt:
-
Hi again,
For my previous example:
main = putStr $ show (fred 1 3)
where
fred a b = let myid x = x in myid (plus a b)
plus x y = x + y
I can now get the following output:
Bernie: All Binder TypeSigs
main :: IO ()
p
Hi again,
Simon Peyton-Jones writes:
> Don't try to get the type environment out. Instead, look at the
> syntax tree produced by the type checker. Each binder is an Id.
> There's a function
> idType :: Id -> Type
> that tells you the type of each binder. Quite how you present it
> to
Hi all,
In GHC 4.09 the flag "-ddump-types" causes the type signatures of
top-level bound identifiers to be printed.
I would really like to make use of the type-checker in GHC, however, I would
also like to obtain the types of locally bound identifiers
(things in let expressions and where claus
On the topic of exceptions in GHC,
Section 3.7 of the Haskell Libraries document (on the ghc website) says:
"Note: GHC currently doesn't generate the arithmetic or the async
exceptions."
This still seems to be the case in 4.09
Does it implement the "NonTermination" exception? Or perhap
49 matches
Mail list logo