Re: [Haskell-cafe] More Language.C work for Google's Summer of Code

2010-03-30 Thread Serguey Zefirov
I tried to devise a C preprocessor, but then I figured out that I could write something like that: --- #define A(arg) A_start (arg) A_end #define A_start "this is A_start definition." #define A_end "this is A_end definition." A ( #undef A_start #define A_start A_end )

Re: [Haskell-cafe] ANN: powerpc-0.0.1

2010-03-11 Thread Serguey Zefirov
rite to it). > On Thu, Mar 11, 2010 at 11:35 AM, Serguey Zefirov > wrote: >> >> 2010/3/11 John Van Enk : >> > Serguey, >> > I'm working on a similar project. What's the chance you have your source >> > code in the open? >> > /jve &g

Re: [Haskell-cafe] ANN: powerpc-0.0.1

2010-03-11 Thread Serguey Zefirov
2010/3/11 John Van Enk : > Serguey, > I'm working on a similar project. What's the chance you have your source > code in the open? > /jve I'll ask. But chances are pretty small. I'll think about reimplementing command description from scratch. > On Thu, Mar 1

Re: [Haskell-cafe] ANN: powerpc-0.0.1

2010-03-11 Thread Serguey Zefirov
2010/3/10 Tom Hawkins : > On Wed, Mar 10, 2010 at 8:07 AM, Warren Henning > wrote: >> Wow. Quite ambitious. >> >> Was this inspired by work at your current employer like with Atom and >> some of the other stuff you've released? > > Yes, we had an immediate need to debug some machine code.  I looke

Re: [Haskell-cafe] Computer Graphics and Haskell - Radiosity Methods

2010-03-01 Thread Serguey Zefirov
2010/3/1 Hector Guilarte : > Hello cafe, > While I was studying for my computer graphics test I have tomorrow I > realized that maybe some of the major problems I've read so far about > Radiosity Rendering Algorithms may be reduced significantly if it was > implemented in Haskell and taking advanta

Re: [Haskell-cafe] fast, strongly typed heterogeneous collections

2010-02-19 Thread Serguey Zefirov
2010/2/19 Khudyakov Alexey : >> And, actually, what looks like O(n) at the compile time is O(1) at >> runtime. This is so because it is really hard to create types at >> runtime. ;) > > What did you mean by "really hard"? One have to use black magic and ask demons > for help or possible but very di

Re: [Haskell-cafe] fast, strongly typed heterogeneous collections

2010-02-19 Thread Serguey Zefirov
2010/2/19 Alberto G. Corona : > What is the speed of hProjectByLabel/s in Data.HList.Record? . The > documentation in hackage does not mention it. Perhaps this is because Hlist > is designed for supposedly short records and this does not matter too much. > looking at the code I guess that everythin

Re: [Haskell-cafe] DLL on Windows

2010-02-16 Thread Serguey Zefirov
ver wxHaskell for GUI development as there > was always a version that worked on Windows with the latest GHC > release. I think I might have to switch back to recommending C# for > GUI development... > > Thanks, Neil > > On Tue, Feb 16, 2010 at 5:19 PM, Serguey Zefirov wrote: >

Re: [Haskell-cafe] DLL on Windows

2010-02-16 Thread Serguey Zefirov
> > Thanks, Neil > > On Tue, Feb 16, 2010 at 2:33 PM, Serguey Zefirov wrote: >> I tried the way described in >> http://www.haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html >> and i got this error message: >> >> ---

[Haskell-cafe] DLL on Windows

2010-02-16 Thread Serguey Zefirov
I tried the way described in http://www.haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html and i got this error message: ghc -shared -o test.dll --make test.hs [1 of 1] Compiling Test

Re: [Haskell-cafe] Re: How many "Haskell Engineer I/II/III"s are there?

2010-02-14 Thread Serguey Zefirov
2010/2/14 Florian Weimer : > Most of the time, the concern is about pause times and the lack of > upper bounds on them.  With traditional reference counting, this is > still a problem because if the last reference to a large data > structure goes away, you need to free the whole data structure at >

Re: [Haskell-cafe] Simulation of interconnect network

2010-02-06 Thread Serguey Zefirov
2010/2/5 Roger King : > I am building a simulator for an interconnect network for a multiprocessor > computer.  I would like to develop it in Haskell as an opportunity to learn > Haskell. > > The network will have a number of routers with input ports and output ports > and crossbars between them

Re: [Haskell-cafe] Re: Nested Types stack size ...

2010-02-04 Thread Serguey Zefirov
2010/2/4 Günther Schmidt : > Hello Serguey, > > great, that's the one! > > Can I set this in the source code itself too? No, as far as I know. Last time I tried it on 6.10.1, so it's pretty far from now. ;) ___ Haskell-Cafe mailing list Haskell-Cafe@has

Re: [Haskell-cafe] Re: Nested Types stack size ...

2010-02-04 Thread Serguey Zefirov
2010/2/4 Günther Schmidt : > Hello Ron, > > thank you, but it was not the run-time stack size I meant. It was the stack > size for nested types which defaults to 20 or so IIRC. My nested types > currently go to about 23 deep. -fcontext-stack=100 ___ Hask

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Jon Harrop : >> Or, you're asking about scalability and speed? > > I meant the scalability and speed. An imperative solution should be simpler, > more scalable and faster than any purely functional solution. So, please, provide any and we'll discuss difference between ours. Mine is here:

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Jon Harrop : > On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote: >> Actually, your solution with arrays is the most often occured solution >> an imperative programmer will come with. It is simple but not scalable >> and not particularly fast. > > Wh

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Lyndon Maydwell : > I'm avoiding hard-coding bools anywhere as I intend to allow > fuzzy-representations at some point. What is the meaning of fuzzy Game of Life? Where can I read about? Or you're planning to average field over some time interval? In the latter case you still will be fa

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Lyndon Maydwell : > I chose the array mainly for the fast lookup time compared to lists, > are you suggesting something like creating a "Map (X,Y) Health"? I'm > not currently updating any structures, rather creating the successor > from scratch. I can see how the map may work very well fo

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Lyndon Maydwell : > Hi Cafe. > > I've made a basic game of life implementation with Haskell and OpenGL: > https://github.com/sordina/Life/ > > I'm intending to improve the performance, and add more advanced > features, but I thought I'd get some feedback first. Can anyone see a > way to ma

Re: [Haskell-cafe] OT: Literature on translation of lambda calculus to combinators

2010-01-28 Thread Serguey Zefirov
Also see http://www.haskell.org/haskellwiki/Super_combinator Wiki page. Fixed set of combinators gives you complexity of translation that is more than linear of the length of lambda expression. The length of output string is O(3^length(lambdaExpression)) for SK combinator pair. 2010/1/28 Dušan K

Re: [Haskell-cafe] Continuable and serializable parsers.

2009-12-25 Thread Serguey Zefirov
>> AFAIK, one of HAppS modules does a similar transformation via >> Template Haskell.  The functions specify transactions, and each >> transaction is converted to a serializable data type.  Then it's >> possible to create a transaction log by serializing them before >> their execution. > > The happ

Re: [Haskell-cafe] Continuable and serializable parsers.

2009-12-25 Thread Serguey Zefirov
2009/12/25 Felipe Lessa : >> I am looking more for the way to serialize intermediate parser >> computations. The first problem is, actually, easy one. ;) > > Probably you'll have to create a data constructor for each step > of your parser. > > AFAIK, one of HAppS modules does a similar transformati

Re: [Haskell-cafe] Continuable and serializable parsers.

2009-12-25 Thread Serguey Zefirov
2009/12/25 Valery V. Vorotyntsev : >> 1) How to write a parser that could be restarted? Like, it will be >> represented by a function that returns something along the lines >> >> data ParseStepResult input result = >>    Success (Maybe (input -> ParseStepResult input result)) (Maybe result) >>  | F

[Haskell-cafe] Continuable and serializable parsers.

2009-12-25 Thread Serguey Zefirov
A pair of problems: 1) How to write a parser that could be restarted? Like, it will be represented by a function that returns something along the lines data ParseStepResult input result = Success (Maybe (input -> ParseStepResult input result)) (Maybe result) | Failure (ie, parsers using str

Re: [Haskell-cafe] Pattern matching, and bugs

2009-12-18 Thread Serguey Zefirov
> I would like to have a way for Haskell, not to crash, when my coders write > pattern matching without the above mentioned general case. > Like having the compiler auto-include those general cases for us, > but when those cases got hit, then instead of crashing, it should report > some error on st

Re: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Serguey Zefirov
2009/12/16 Matt Morrow : > What are peoples' thoughts on this? > http://hackage.haskell.org/trac/ghc/ticket/650#comment:16 I think it won't get any better. Either we have O(log(N)) updates because we have to update hierarchical structure to speed up GC scanning (to get it to O(Mlog(N)), where M i

Re: Re[6]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-15 Thread Serguey Zefirov
>>> now i see what you mean. no, i mean trivial transformation. #650 says >>> about slow GC. why it's slow? because once you made any update to the >>> array, the entire array is marked as updated and scanned on next minor GC >>> (which occurs after every 512 kbytes allocated, afaik). let's replace

Re: Re[6]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-15 Thread Serguey Zefirov
>> If the number of buckets was fixed, one could use an array of STRefs >> to lists.  I believe this would avoid the bug from Ticket #650? > now i see what you mean. no, i mean trivial transformation. #650 says > about slow GC. why it's slow? because once you made any update to the > array, the ent

Re: [Haskell-cafe] Partially applied functions

2009-11-28 Thread Serguey Zefirov
> The question is still open though, if somebody has some magic to extract the > prameter from an applied function... It isn't possible. Closest solution will be a list of pairs (function,arg) and a special apply function that takes those pairs and apply to function an argument and.them, apply so

Re: [Haskell-cafe] I miss OO

2009-11-25 Thread Serguey Zefirov
2009/11/25 Michael Mossey : > I'm fairly new to Haskell, and starting to write some big projects. > Previously I used OO exclusively, mostly Python. I really miss the > "namespace" capabilities... a class can have a lot of generic method names > which may be identical for several different classes

Re: [Haskell-cafe] ANN: mecha-0.0.2

2009-11-01 Thread Serguey Zefirov
http://iat.ubalt.edu/summers/math/platsol.htm and http://hyperfun.org/wiki/doku.php?id=frep:main CSG on implicitly specified surfaces (F(r)=0) and volumes (F(r)>=0). Min(F,G) is a union, max(F,G) is an intersection. 2009/11/1 Tom Hawkins : >> Neat!  What a cool idea. >>> data Solid = Solid (Vecto

Re: [Haskell-cafe] Exponential complexity of type checking (Was: Type-level naturals & multiplication)

2009-10-13 Thread Serguey Zefirov
2009/10/13 Lennart Augustsson : > Yes, there are simple H-M examples that are exponential. > x0 = undefined > x1 = (x1,x1) > x2 = (x2,x2) > x3 = (x3,x3) > ... > > xn will have a type with 2^n type variables so it has size 2^n. Reformulated: let dup x = (x,x) :t dup . dup . dup . dup ... type will

[Haskell-cafe] What does "mkUsageInfo: internal name?" mean? (ghc 6.10.1, Template Haskell)

2009-10-10 Thread Serguey Zefirov
I get a bunch of messages like "mkUsageInfo: internal name? WritebackCmd{tc a1eZY}" while transforming my program using Template Haskell. It displayed for every data type and for every constructor - I generate some instances for my data types. ___ Haskel

[Haskell-cafe] Strange problem with type classes (ghc 6.8.2 looks allright and ghc 6.10.1 doesn't).

2009-09-22 Thread Serguey Zefirov
(followup to my previous letter with the same subject) I found the way to break 6.8.2 type checker. It's as easy as to uncomment Div case alternative in valueIndex. Weird. I found a solution, though. Instead of (valueIndex (x_38,(x_36,x_37))) in that Div alternative I should create expression (

[Haskell-cafe] Strange problem with type classes (ghc 6.8.2 looks allright and ghc 6.10.1 doesn't).

2009-09-22 Thread Serguey Zefirov
I try to create yet another hardware description language embedded in Haskell and faced a (perceived) bug in ghc 6.10.1 type checker. In ghc 6.8.2 everything works fine. I need a type class that can express relationship between type and its' "size in wires" (the number of bits needed to represent

[Haskell-cafe] Data.Map traversal.

2008-06-07 Thread Serguey Zefirov
I found that I often need predecessor and successor of some key in Data.Map.Map. Just like that: predKey, succKey :: Ord k => Data.Map.Map k a -> k -> Maybe k predKeyElem, succKeyElem :: Ord k => Data.Map.Map k a -> k -> Maybe (k,a) Data.Map has operations like that on key indexes, but it is sl

Re: [Haskell-cafe] Re: Linear algebra library for game programming.

2004-11-07 Thread Serguey Zefirov
Elegant and fast enough toy for number crunching. ;) I hope I could use some of techniques from your papers (Generating power of lazy semantics, for example) in this toy, if I succeed. -- Yours truly, Serguey Zefirov, theszATmail.ru. ___ Haskell-

[Haskell-cafe] Lnear algebra library for game programming.

2004-11-07 Thread Serguey Zefirov
to utilize Vec2,3,4 and Mat(3,4)x(3,4) parametrized by Double and Float. So the question is: what other people do in situation like this and is there any paper(s) on linear algebra library design? -- Yours truly, Serguey Zefirov, theszATmail.ru

Question about Haskell lexer and parser.

2003-05-28 Thread Serguey Zefirov
Hello haskell-cafe, Question is really about layout rules. If the first lexeme of a module is not a "module" keyword, we insert {n}, where n is the indentation of first lexeme. Then we apply function L to the list of lexemes and stack of layouts: L ({n}:lexemes) [] One of first case definition

<    1   2