Re: [Factor-talk] Is anyone maintaining/using alien.inline, alien.marshall, alien.cxx?

2009-09-23 Thread Jeremy Hughes
Hi Joe, Joe Groff writes: > Hi everyone. Slava's itching to nuke the old C-STRUCT: and C-UNION: > features now that most of the code in the repository has been switched > to use struct classes. The only holdouts are Jeremy Hughes' > alien.inline, alien.marshall, and alien.cxx vocabularies. They

Re: [Factor-talk] returning a variable number of values

2009-09-23 Thread Adam
Also, > :: ( root target -- node new-root | 0 ) > ... ; > > : find-key ( key root -- node new-root | 0 ) The stack effect is being interpreted as `|' being an object on the stack according to the stack checker. ( ) do not denote comments as in forth. Try [ foo bar ] infer. in the listener to

[Factor-talk] Is anyone maintaining/using alien.inline, alien.marshall, alien.cxx?

2009-09-23 Thread Joe Groff
Hi everyone. Slava's itching to nuke the old C-STRUCT: and C-UNION: features now that most of the code in the repository has been switched to use struct classes. The only holdouts are Jeremy Hughes' alien.inline, alien.marshall, and alien.cxx vocabularies. They were a little too entwined wi

Re: [Factor-talk] Docs/Browser changes - review/pull-request

2009-09-23 Thread Slava Pestov
On Wed, Sep 23, 2009 at 8:05 AM, Keith Lazuka wrote: > - $subsection now displays the definition-icon next to the link rather > than a plain bullet symbol > > - If $subsection is used to display a link to a word's documentation, > the word's stack effect is now drawn in a dark green color, making

Re: [Factor-talk] vm cleanup

2009-09-23 Thread Slava Pestov
Some more blank lines magically appear: http://github.com/phildawes/factor/commit/7cf12177a3191e4de7ff52e85ed1f92b61518742 On Wed, Sep 23, 2009 at 2:50 PM, Phil Dawes wrote: > Hi Slava, > > I did the simpler cleanup stuff you asked for in a vm_cleanup branch: > > http://github.com/phildawes/fact

Re: [Factor-talk] stack padding/alignment question

2009-09-23 Thread Slava Pestov
On Wed, Sep 23, 2009 at 12:25 PM, Phil Dawes wrote: > Hi Slava, > > Why is STACK_PADDING=56 in cpu-x86.64.S? So that on entry to a procedure that calls other procedures, you can subtract STACK_PADDING from esp to get a 16-byte aligned stack pointer. On Windows x86-64, you have to reserve space i

Re: [Factor-talk] returning a variable number of values

2009-09-23 Thread Slava Pestov
On Wed, Sep 23, 2009 at 7:20 PM, Hugh Aguilar wrote: > In C the work-around is to return a pointer to a struct that contains the > two values (node and new-root), or to return a 0 (null pointer) in the event > that the key isn't found. This has to be done because C doesn't support > returning mult

[Factor-talk] returning a variable number of values

2009-09-23 Thread Hugh Aguilar
This problem is related to the problem I mentioned earlier in regard to upgrading list.factor. I am now upgrading symtab.factor (www.rosycrew.org/symtab.factor) and it won't compile. All of the functions involved in finding a key in the tree fail, and all for the same reason ("unbalanced branch

Re: [Factor-talk] Request for testing: math.vectors.simd

2009-09-23 Thread Slava Pestov
That's all the information I need, thanks! Turns out the PMULLD instruction is only available with SSE4.1 and above, and I thought it was in SSE2. Slava On Wed, Sep 23, 2009 at 7:48 PM, Jon Harper wrote: > Hi again, > 4 tests fail : > > Unit Test: { [ { } ] [ \ int-4 \ fixnum [ = ] check-vector-

Re: [Factor-talk] Request for testing: math.vectors.simd

2009-09-23 Thread Jon Harper
Hi again, 4 tests fail : Unit Test: { [ { } ] [ \ int-4 \ fixnum [ = ] check-vector-ops ] } --> test failed! Unit Test: { [ { } ] [ \ uint-4 \ fixnum [ = ] check-vector-ops ] } --> test failed! Unit Test: { [ { } ] [ \ int-8 \ fixnum [ = ] check-vector-ops ] } --> test failed! Unit Test: { [ { } ]

Re: [Factor-talk] Using STRUCT: instead of C-STRUCT: in vm.factor

2009-09-23 Thread Joe Groff
> I tried using STRUCT: instead of C-STRUCT: in vm.factor, but this > generates a bootstrap error on loading the vocab. The problem seems to > occur when using the 'zone' struct in the 'vm' struct. If I replace '{ > nursery zone }' with '{ nursery cell[4] } then it builds fine. > (file and error pa

Re: [Factor-talk] Bug in rpn

2009-09-23 Thread Slava Pestov
Thanks, fixed. On Wed, Sep 23, 2009 at 5:10 PM, Jason Merrill wrote: > The rpn demo is pretty neat, but the way it handles - and / is not consistent > with factor. For example > > ( scratchpad ) 3 5 - > > --- Data stack: > -2 > ( scratchpad ) "rpn" run > Loading resource:extra/rpn/rpn.factor > RP

[Factor-talk] Bug in rpn

2009-09-23 Thread Jason Merrill
The rpn demo is pretty neat, but the way it handles - and / is not consistent with factor. For example ( scratchpad ) 3 5 - --- Data stack: -2 ( scratchpad ) "rpn" run Loading resource:extra/rpn/rpn.factor RPN> 3 5 - 2 RPN> Regards, Jason Merrill --

Re: [Factor-talk] website homepage redesign

2009-09-23 Thread Jason Merrill
Keith Lazuka writes: > > I just noticed the new website layout. That was a good idea to put > some example code at the top of the screen, although the example code > that I was shown has a mistake: The code fragments are a nice touch. I think there may also be a mistake in the e-mail example (o

Re: [Factor-talk] Request for testing: math.vectors.simd

2009-09-23 Thread Slava Pestov
Hi Jon, I forgot to mention that you must "math.vectors.simd" require first. Please try again! Slava On Wed, Sep 23, 2009 at 9:16 AM, Jon Harper wrote: > Hi, hope this is what you wanted. This is from latest build. My > processor is a pentium M. This is with linux-x86.32 > > Checking for mul

Re: [Factor-talk] Multiline strings in core/

2009-09-23 Thread Slava Pestov
Good work Doug! Slava On Wed, Sep 23, 2009 at 12:15 PM, Doug Coleman wrote: > Hi, > > Factor's strings are now multiline and a new syntax -- """Triple > quoted strings""" -- is allowed.  The parsing word " checks if the > string is single or triple-quoted and behaves accordingly.  On a > triple-

[Factor-talk] Using STRUCT: instead of C-STRUCT: in vm.factor

2009-09-23 Thread Phil Dawes
Hi Slava, I tried using STRUCT: instead of C-STRUCT: in vm.factor, but this generates a bootstrap error on loading the vocab. The problem seems to occur when using the 'zone' struct in the 'vm' struct. If I replace '{ nursery zone }' with '{ nursery cell[4] } then it builds fine. (file and erro

[Factor-talk] vm cleanup

2009-09-23 Thread Phil Dawes
Hi Slava, I did the simpler cleanup stuff you asked for in a vm_cleanup branch: http://github.com/phildawes/factor/commits/vm_cleanup Cheers, Phil -- Come build with us! The BlackBerry® Developer Conference in SF, CA

[Factor-talk] stack padding/alignment question

2009-09-23 Thread Phil Dawes
Hi Slava, Why is STACK_PADDING=56 in cpu-x86.64.S? I originally assumed this was because the return address got pushed during the call instruction (which would then align rsp to 16bytes), but if that's the case what happens to the calls in cpu-x86.S that don't have this padding? Thanks, Phil

[Factor-talk] Multiline strings in core/

2009-09-23 Thread Doug Coleman
Hi, Factor's strings are now multiline and a new syntax -- """Triple quoted strings""" -- is allowed. The parsing word " checks if the string is single or triple-quoted and behaves accordingly. On a triple-quoted string, you don't have to escape the double-quotes inside the string, and i

Re: [Factor-talk] Request for testing: math.vectors.simd

2009-09-23 Thread Jon Harper
Hi, hope this is what you wanted. This is from latest build. My processor is a pentium M. This is with linux-x86.32 Checking for multimedia extensions: SSE2 detected ( scratchpad ) "math.vectors.simd" test Loading resource:basis/math/vectors/simd/intrinsics/intrinsics-tests.factor Unit Test: { [

[Factor-talk] images.gif bugfix

2009-09-23 Thread Keith Lazuka
I identified 2 bugs in the way that the "images.gif" vocab parses the GIF file format. 1) The Image Descriptor block label (0x2c) was being read twice from the stream: once to do the dispatch to parse the block and again to store it in the image-descriptor tuple's "separator" slot. The separator s

[Factor-talk] Docs/Browser changes - review/pull-request

2009-09-23 Thread Keith Lazuka
I have been working on improving the layout of help articles, specifically the way that the introductory text and groups of $subsection links are rendered and spaced apart from each other. I believe that the changes are ready to be merged (I bootstrapped, tested and ran help-lint-all), but if there

[Factor-talk] website homepage redesign

2009-09-23 Thread Keith Lazuka
I just noticed the new website layout. That was a good idea to put some example code at the top of the screen, although the example code that I was shown has a mistake: USING: sequences xml.syntax xml.writer ; { "three" "blind" "mice" } [ [XML <-> XML] ] map [XML <-> XML] pprint-xml I know that t

Re: [Factor-talk] Request for testing: math.vectors.simd

2009-09-23 Thread Slava Pestov
On Wed, Sep 23, 2009 at 5:16 AM, Paul Moore wrote: > 2009/9/23 Slava Pestov : >> In particular I'd be interested if someone with SSE1 and SSE2 would test. > > Is it in the Windows binary version yet? (I'm assuming not, as that is > from the 21st). Once there's a binary with it in I'll test (SSE2)

Re: [Factor-talk] Request for testing: math.vectors.simd

2009-09-23 Thread Paul Moore
2009/9/23 Slava Pestov : > In particular I'd be interested if someone with SSE1 and SSE2 would test. Is it in the Windows binary version yet? (I'm assuming not, as that is from the 21st). Once there's a binary with it in I'll test (SSE2) but I can't build my own at the moment, sorry. Paul. -

[Factor-talk] Binary packages one again only require SSE2

2009-09-23 Thread Slava Pestov
Hi all, Another change is that binary packages on x86-32 no longer require SSE3. Slava -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumps

[Factor-talk] Request for testing: math.vectors.simd

2009-09-23 Thread Slava Pestov
Hi all, The math.vectors.simd vocabulary now uses a range of SSE instructions from different SSE versions, all the way from SSE1 to SSE4.1. To make sure I'm not use any instructions I'm not supposed to on various SSE versions, I'd like to get feedback from people on the following: - What SSE vers

Re: [Factor-talk] More feedback on re-entrant VM code

2009-09-23 Thread Phil Dawes
Slava Pestov wrote: > On Wed, Sep 23, 2009 at 3:24 AM, Phil Dawes wrote: >> >> I'm not 100% sure the best way to remove them from the vm struct since >> the platform #includes need to go before the vm.hpp so there would be >> dependency issues with using inheritance. Will have a think about this.

Re: [Factor-talk] Re-entrant VM crash on Mac OS X 32-bit: stack alignment issue

2009-09-23 Thread Slava Pestov
On Wed, Sep 23, 2009 at 3:25 AM, Phil Dawes wrote: > Hope that makes sense. Once PPC is finished I'll move the vm arg to the > front of the function calls. Ok, looking forward to it. Once things settle down a bit, I'd like to get started on a few VM changes I've got planned, that's why I'm anxiou

Re: [Factor-talk] More feedback on re-entrant VM code

2009-09-23 Thread Slava Pestov
On Wed, Sep 23, 2009 at 3:24 AM, Phil Dawes wrote: > Clashes with the T that is factor's 'true' (gcc barfs). Ok. > Because you can't pass member functions as pointers. (Or maybe I'm > missing a trick here?) In a few places I started converting such 'higher order functions' to use templates inst

Re: [Factor-talk] Re-entrant VM: primitives

2009-09-23 Thread Slava Pestov
On Wed, Sep 23, 2009 at 3:25 AM, Phil Dawes wrote: > Hi Slava, > > Yep, these forwarding functions should probably just be a 1 line macro: > PRIMITIVE_FORWARD(exit); Something like that would work, yes. > (although if the vm struct gets split out into a tree of objects they > would end up being

Re: [Factor-talk] Re-entrant VM: primitives

2009-09-23 Thread Phil Dawes
Hi Slava, Yep, these forwarding functions should probably just be a 1 line macro: PRIMITIVE_FORWARD(exit); (although if the vm struct gets split out into a tree of objects they would end up being something like PRIMITIVE_FORWARD(dataheap,gc). Is that what you're after or do you have a better ide

Re: [Factor-talk] Re-entrant VM crash on Mac OS X 32-bit: stack alignment issue

2009-09-23 Thread Phil Dawes
Hi Slava, Ah ok, thanks for the tip, this is the first thing I should fix. Somebody at work has an x86 macosx box I might be able to use - it's 10.4 at the moment but they've got a snow-leopard upgrade they can do so I'm hoping they'll do this today and I'll get to look at this tonight. I defo ag

Re: [Factor-talk] More feedback on re-entrant VM code

2009-09-23 Thread Phil Dawes
Hi Slava, Thanks for the awesome code review! I would guess this'll take me about week or two to fix up - is that ok? N.B. I should probably reassure you that I don't consider this finished at all, but needed the merge because I was spending so much of my time rebasing. Some notes; > -template