Re: [Factor-talk] Managing many vocabularies

2012-11-27 Thread Alexander J. Vondrak
Finding circularities: maybe something like https://gist.github.com/4158963?
Though it's not the smartest thing around (just because there's a vocab
circularity doesn't mean there will necessarily be an issue with a word
definition).

Avoiding circularities is really an engineering thing...

Fixing circularities is trickier, and it'll generally vary case-by-case.  Check
out http://docs.factorcode.org/content/article-deferred.html, perhaps?

Good luck,
--Alex Vondrak


From: Leon Konings [fac...@koningssoftware.com]
Sent: Saturday, November 24, 2012 8:29 AM
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Managing many vocabularies

Hi Alexander,

Thank you for your very long answer.

You where guessing right about the circular dependencies. Because
there are so many vocabularies, problems like that happen rather often.

I am really looking for better and faster ways to find these, and a
way of working that make it less likely that they happen.

Best regards,
Leon


Quoting "Alexander J. Vondrak" :

> I'm not really sure if there was a question in there...
>
>> Loading all the vocabularies, which all load many other vocabularies,
>> is not easy to do.
>
> If you're just sitting down at your editor, typing vocab names into the
> `USING:` line, then yeah, it's going to be difficult to know exactly which
> vocabs you're supposed to specify.  That's why you use the listener.
>
> Say I'm working on a file, factor/work/blah/blah.factor.  While I'm jotting
> down some code, I either don't know what I need in the `USING:` or forget to
> put something in there.
>
>   USING: ; ! ???
>
>   "Blah" print
>
>> From the listener, I type `USE: blah`, and I get a helpful error message.
>
>   IN: scratchpad USE: blah
>   Loading resource:work/blah/blah.factor
>   1: USE: blah
>   ^
>   resource:work/blah/blah.factor
>
>   1: "Blah" print
>  ^
>   No word named “print” found in current vocabulary search path
>
>   The following restarts are available:
>
>   :1  Use the io vocabulary
>   :2  Defer word in current vocabulary
>   :3  Load resource:work/blah/blah.factor again
>
>   Type :help for debugging help.
>
> It gives me several options to recover from this error, including a
> suggestion
> for which vocab to load to find the word `print` (note that this
> doesn't always
> work, if Factor can't find a particular word name in the current
> search path).
> In this case, I can type `:1` to use the `io` vocab.
>
>   IN: scratchpad :1
>   resource:work/blah/blah.factor:1: Note:
>   Added "io" vocabulary to search path
>
>   Restarts were invoked adding vocabularies to the search path.
>   To avoid doing this in the future, add the following forms
>   at the top of the source file:
>
>   USING: io ;
>
> Also, take a look at
> http://docs.factorcode.org/content/article-images.html and
> http://docs.factorcode.org/content/word-auto-use__que__%2Cparser.html
>
>> I often have to solve problems with interdependencies. It is not
>> easy to find
>> the cause of these problems.
>
> What sort of problems?  And what sort of interdependencies?  Like vocabs
> depending on vocabs?  I struggle to think of a problem with that, because the
> chain of dependencies shouldn't be an issue, unless there's a cycle.  E.g.,
>
>   ! In a.factor
>   USING: b ;
>   IN: a
>   : a-word ( -- ) b-word ;
>
>   ! In b.factor
>   USING: io ;
>   IN: b
>   : b-word ( -- ) "Called b-word" print ;
>
>   ! At the listener
>   IN: scratchpad USE: a
>   Loading resource:work/a/a.factor
>   Loading resource:work/b/b.factor
>   IN: scratchpad a-word
>   Called b-word
>
> Notice that a.factor doesn't need to have `USING: io`, even though b.factor
> does.  So you don't need to think about anything beyond a file's immediate
> dependencies.  I guess there would be an issue if you had a cyclic
> dependency,
> which needs to be resolved manually (or, more practically speaking, removed):
>
>   ! In a.factor
>   USING: b io ;
>   IN: a
>
>   : a-word1 ( -- ) b-word ;
>
>   : a-word2 ( -- ) "Called a-word2" print ;
>
>   ! In b.factor
>   USING: a ;
>
>   : b-word ( -- ) a-word2 ;
>
>   ! At the listener
>   IN: scratchpad USE: a
>   Loading resource:work/a/a.factor
>   Loading resource:work/b/b.factor
>   1: USE: a
>^
>   resource:work/a/a.factor
>
>   1: USING: b io ;
>  ^
>   resource:work/b/b.factor
>
>   4: : b-word ( -- ) a-wo

Re: [Factor-talk] Managing many vocabularies

2012-11-23 Thread Alexander J. Vondrak
I'm not really sure if there was a question in there...

> Loading all the vocabularies, which all load many other vocabularies, 
> is not easy to do. 

If you're just sitting down at your editor, typing vocab names into the
`USING:` line, then yeah, it's going to be difficult to know exactly which
vocabs you're supposed to specify.  That's why you use the listener.

Say I'm working on a file, factor/work/blah/blah.factor.  While I'm jotting
down some code, I either don't know what I need in the `USING:` or forget to
put something in there.

  USING: ; ! ???

  "Blah" print

>From the listener, I type `USE: blah`, and I get a helpful error message.

  IN: scratchpad USE: blah
  Loading resource:work/blah/blah.factor
  1: USE: blah
  ^
  resource:work/blah/blah.factor

  1: "Blah" print
 ^
  No word named “print” found in current vocabulary search path

  The following restarts are available:

  :1  Use the io vocabulary
  :2  Defer word in current vocabulary
  :3  Load resource:work/blah/blah.factor again

  Type :help for debugging help.

It gives me several options to recover from this error, including a suggestion
for which vocab to load to find the word `print` (note that this doesn't always
work, if Factor can't find a particular word name in the current search path).
In this case, I can type `:1` to use the `io` vocab.

  IN: scratchpad :1
  resource:work/blah/blah.factor:1: Note:
  Added "io" vocabulary to search path

  Restarts were invoked adding vocabularies to the search path.
  To avoid doing this in the future, add the following forms
  at the top of the source file:

  USING: io ;

Also, take a look at http://docs.factorcode.org/content/article-images.html and
http://docs.factorcode.org/content/word-auto-use__que__%2Cparser.html

> I often have to solve problems with interdependencies. It is not easy to find
> the cause of these problems.

What sort of problems?  And what sort of interdependencies?  Like vocabs
depending on vocabs?  I struggle to think of a problem with that, because the
chain of dependencies shouldn't be an issue, unless there's a cycle.  E.g.,

  ! In a.factor
  USING: b ;
  IN: a
  : a-word ( -- ) b-word ;

  ! In b.factor
  USING: io ;
  IN: b
  : b-word ( -- ) "Called b-word" print ;

  ! At the listener
  IN: scratchpad USE: a
  Loading resource:work/a/a.factor
  Loading resource:work/b/b.factor
  IN: scratchpad a-word
  Called b-word

Notice that a.factor doesn't need to have `USING: io`, even though b.factor
does.  So you don't need to think about anything beyond a file's immediate
dependencies.  I guess there would be an issue if you had a cyclic dependency,
which needs to be resolved manually (or, more practically speaking, removed):

  ! In a.factor
  USING: b io ;
  IN: a

  : a-word1 ( -- ) b-word ;

  : a-word2 ( -- ) "Called a-word2" print ;

  ! In b.factor
  USING: a ;

  : b-word ( -- ) a-word2 ;

  ! At the listener
  IN: scratchpad USE: a
  Loading resource:work/a/a.factor
  Loading resource:work/b/b.factor
  1: USE: a
   ^
  resource:work/a/a.factor

  1: USING: b io ;
 ^
  resource:work/b/b.factor

  4: : b-word ( -- ) a-word2 ;
^
  No word named “a-word2” found in current vocabulary search path

  The following restarts are available:

  :1  Defer word in current vocabulary
  :2  Load resource:work/b/b.factor again
  :3  Load resource:work/a/a.factor again

  Type :help for debugging help.
  IN: scratchpad :3
  Loading resource:work/a/a.factor
  Loading resource:work/b/b.factor
  Loading resource:work/a/a.factor
  IN: scratchpad a-word1
  Called a-word2

Maybe by "interdependencies" you mean that vocabs can step on each others'
toes?  If two vocabs define different words with the same name, there will be
an ambiguity.  To resolve, see
http://docs.factorcode.org/content/word-FROM__colon__,syntax.html

> In the developer tools I saw some interesting words for working with 
> vocabularies. There might be a solution to my problem, if I use these 
> tools, but I do not know where to start.

Which interesting words?  Sorry, I'm running out of psychic abilities.  :)

If you aren't sure what certain words do, it's helpful to browse through their
documentation.  Even if a word isn't quite what you want, there are usually
related things you can click on, looking for related words until you stumble
onto something useful.

Hope any of that helps,
--Alex Vondrak
--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/l

Re: [Factor-talk] A few questions about the UI vocabulary

2012-11-17 Thread Alexander J. Vondrak
I've never used the ui vocabs, so grain of salt, but

1. If you have a particular width in mind,

  IN: scratchpad USE: wrap.strings
  IN: scratchpad "a long line" 5 wrap-string print
  a
  long
  line

Thus, use `wrap-string`, and build a `` with the result.  E.g.,

  "a long line" 5 wrap-string  gadget.

I'm not sure if there's a way to do it dynamically, though.

2. There's the images.viewer vocabulary, but it doesn't appear to scale images
with the window size...worth a look, anyway: 
http://docs.factorcode.org/content/vocab-images.viewer.html

3.  `\ gradient help` explains that the `colors` slot is a sequence of `color`
instances.  E.g., try the following at the listener:

  USING: ui.gadgets ui.gadgets.panes colors.constants ui.pens.gradient ;
  
  {
  COLOR: white
  COLOR: black
  }  >>interior
  { 100 100 } >>dim
  horizontal >>orientation
  gadget.

Hope that helps,
--Alex Vondrak

From: Samuel Proulx [proulxsam...@gmail.com]
Sent: Saturday, November 17, 2012 8:20 AM
To: factor-talk@lists.sourceforge.net
Subject: [Factor-talk] A few questions about the UI vocabulary

Hi,

It's my first time here, so I hope I'm doing it right.

I'm learning Factor and I'm currently playing with the UI vocabulary. Although, 
there are a few things I can't figure out with it. I've already looked in the 
Browser, but I can't find what I'm looking for.

My questions are the following :
1. How can I display a full text with automatic line breaks ? The only thing I 
found to be able to display text is labels, but I'm not sure it is the way to 
go...
2. How can I display an image and how do I make it resize and keep its 
proportions ? I tried to use icons in tracks, but, again, I don't think it's 
the way to go.
3. I do I make a gradient? I've managed to fill a gadget with a solid color, 
but I can't find out how to make a gradient.  in ui.pens.gradient 
takes "colors" as parameter but how do I do I give it the colors ? An array of 
solid colors ?

Thanks in advance,
Samuel

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Out of memory error

2012-09-10 Thread Alexander J. Vondrak
Latest working* code was at https://github.com/ajvondrak/factor/tree/gvn

*I haven't pushed any of the stuff I was experimenting on when I started having
problems with `load-all test-all`.  But before those issues, I gave up on
figuring out why math.vectors.simd tests (specifically around the
check-vector-ops tests) were causing memory protection faults with GVN enabled
(they don't with it disabled), hoping that getting gvn-tests.factor up to date
would resolve issues.  But, I got gvn-tests.factor working without needing any
changes to the GVN pass itself, so I reckon the math.vectors.simd tests will
still fail.  Hopefully one of you knows more about how to go around debugging
those tests than I do?  (If you can reproduce, anyway.)

As for the code itself, I started by copying over
basis/compiler/cfg/value-numbering/ to extra/compiler/cfg/gvn/ and changing it
there.  It was easier during development to not touch an existing compiler
pass, lest the whole listener break.

The diff between the gvn & value-numbering stuff is actually pretty small.  But
since they're different files, it might be a bit of a pain to figure some stuff
out (to make sure you like it or whatever).  I've found myself doing a lot of
`git diff --no-index` and `git merge-file basis/stuff /dev/null/ extra/stuff`
to resolve discrepancies.  Pretty sure I took care of the few changes made to
the value-numbering vocab while I was working on gvn:
https://github.com/ajvondrak/factor/commit/beff2088132d992c983ddebe5860183f01bc8b5e

Otherwise, it should be a drop-in replacement of value-numbering: just change
references to compiler.cfg.value-numbering into compiler.cfg.gvn in
math.simd.vectors.intrinsics and compiler.cfg.optimizer.

Extra things I can think of:
  - I needed to make a minor change to compiler.cfg.copy-prop due to the GVN
changes, so that'll be in there.
  - The reason I wrote the graphviz vocab was to facilitate the fun stuff in
https://github.com/ajvondrak/factor/blob/gvn/extra/compiler/cfg/graphviz
and 
https://github.com/ajvondrak/factor/tree/gvn/extra/compiler/cfg/gvn/testing
so I could include CFG diagrams in my thesis.
  - Just last night, I tried out a fresh 0.95 download's `load-all test-all`
(in ./factor -run=listener) on my x86_64, up-to-date Arch install (same
hardware as before).  Still crashed, but instead of getting "out of memory"
I got a memory protection fault from the gc.  I hope to be improving the
GVN pass some once I can get these errors figured out.  :-/  I notice
there's been an issue opened about load-all test-all running out of memory
(https://github.com/slavapestov/factor/issues/633); don't know if that's in
response to what I brought up or not.

So, I guess I kind of just went "text dump" mode there, but let me know if you
have any questions or if there's anything I can do to help.

Regards,
--Alex Vondrak


From: John Benediktsson [mrj...@gmail.com]
Sent: Sunday, September 09, 2012 6:58 PM
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Out of memory error

I'd love to help you work on merging your GVN patches, where did we leave it?

Best,
John.

On Sat, Aug 25, 2012 at 7:05 PM, Alexander J. Vondrak 
mailto:ajvond...@csupomona.edu>> wrote:
Good idea, but still no dice.

--Alex Vondrak

From: Doug Coleman [doug.cole...@gmail.com<mailto:doug.cole...@gmail.com>]
Sent: Saturday, August 25, 2012 4:28 PM
To: factor-talk@lists.sourceforge.net<mailto:factor-talk@lists.sourceforge.net>
Subject: Re: [Factor-talk] Out of memory error

Are you running it in the shell listener? It might save memory.

./factor -run=listener

load-all test-all

Doug

On Sat, Aug 25, 2012 at 1:36 PM, Alexander J. Vondrak
mailto:ajvond...@csupomona.edu>> wrote:
> Just did a load-all test-all with 0.94, and that crashes, too.  I know that
> I've run those tests before without running out of memory, so I suspect it's
> either an OS update issue (who knows?) or how my setup is interacting with my
> new hardware (inherited some 64-bit hardware, still using my old 32-bit Debian
> install because I've been lazy about ditching it/upgrading/what-have-you).
> Don't know if that would make sense, per se, but hell, it's not the first
> problem I've had with my current OS setup.  If no one can reproduce, it's
> probably some combination of things on my end...
>
> I'll be trying the unit tests out again once I get Arch configured on another
> hard drive on this machine.
>
> Thanks for the feedback everyone,
> --Alex Vondrak
>
> 
> From: John Benediktsson [mrj...@gmail.com<mailto:mrj...@gmail.com>]
> Sent: Saturday, August 25, 2012 11:11 AM
> To: 
> factor-talk@

Re: [Factor-talk] Literate Programming

2012-08-29 Thread Alexander J. Vondrak
Tangential thought, but I always loved that Factor's documentation is separate
from the actual source code (i.e., that foo.factor's docs live in
foo-docs.factor).  In really any other language I can think of, you have to
clutter what might otherwise be easy-to-read code with gobs of explanations,
examples, warnings, doctests, markup, etc.  I always wondered why using inline
comments for documentation generation is the default for various programming
languages, when it seems so ugly.

Not that other modes of documentation aren't useful.  I just sometimes feel
like I'm alone in appreciating this particular point.  :P

Carry on,
--Alex Vondrak


From: Jon Harper [jon.harpe...@gmail.com]
Sent: Wednesday, August 29, 2012 11:03 AM
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Literate Programming

Short answer: no.
The factor documentation system is described here: 
http://docs.factorcode.org/content/article-writing-help.html
Interestingly, the documentation system is written in factor and documented 
using itself, so this html page is a good example of the output it produces.
Jon


On Wed, Aug 29, 2012 at 1:41 AM, graham telfer 
mailto:gakouse...@hotmail.com>> wrote:
Does Factor have any tools to develop programs using a literate programming 
method? Something like Bird notation used with Haskell or a document generator 
like DocGen with VFXForth.

The usual thing in code is to mark the comments and leave the code, but in a 
literate programming approach (where there is going to be more comment than 
code) marking the code explicitly would be better.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Out of memory error

2012-08-25 Thread Alexander J. Vondrak
Good idea, but still no dice.

--Alex Vondrak

From: Doug Coleman [doug.cole...@gmail.com]
Sent: Saturday, August 25, 2012 4:28 PM
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Out of memory error

Are you running it in the shell listener? It might save memory.

./factor -run=listener

load-all test-all

Doug

On Sat, Aug 25, 2012 at 1:36 PM, Alexander J. Vondrak
 wrote:
> Just did a load-all test-all with 0.94, and that crashes, too.  I know that
> I've run those tests before without running out of memory, so I suspect it's
> either an OS update issue (who knows?) or how my setup is interacting with my
> new hardware (inherited some 64-bit hardware, still using my old 32-bit Debian
> install because I've been lazy about ditching it/upgrading/what-have-you).
> Don't know if that would make sense, per se, but hell, it's not the first
> problem I've had with my current OS setup.  If no one can reproduce, it's
> probably some combination of things on my end...
>
> I'll be trying the unit tests out again once I get Arch configured on another
> hard drive on this machine.
>
> Thanks for the feedback everyone,
> --Alex Vondrak
>
> 
> From: John Benediktsson [mrj...@gmail.com]
> Sent: Saturday, August 25, 2012 11:11 AM
> To: factor-talk@lists.sourceforge.net
> Cc: factor-talk@lists.sourceforge.net
> Subject: Re: [Factor-talk] Out of memory error
>
> If this is happening of 0.95 release than I wonder if we have a slow leak 
> rather than corruption - all of our builders produce consistent clean builds 
> (load-all test-all) and have for awhile.
>
> Perhaps we don't notice due to 16+ GB of RAM...?
>
>
> On Aug 25, 2012, at 11:06 AM, Joe Groff  wrote:
>
>> On Sat, Aug 25, 2012 at 1:36 PM, Jim Mack  wrote:
>>> In a way, too many possible culprits mask each other.
>>>
>>> I remember a problem like this that I solved by reducing the amount of
>>> memory so the problem would show quickly, then testing small things in
>>> isolation and volume.  Pick a subset of tests and run them multiple times at
>>> low memory until it fails or becomes clear it won't.   Rinse and repeat.
>>
>> An out of memory error could also be caused by things other than a
>> lack of memory. If the heap is getting corrupted or there is a
>> compiler bug, the system could end up passing a garbage size to malloc
>> or mmap that is too big to be fulfilled.
>>
>> -Joe
>>
>> --
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> --
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> --
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122

Re: [Factor-talk] Out of memory error

2012-08-25 Thread Alexander J. Vondrak
Just did a load-all test-all with 0.94, and that crashes, too.  I know that
I've run those tests before without running out of memory, so I suspect it's
either an OS update issue (who knows?) or how my setup is interacting with my
new hardware (inherited some 64-bit hardware, still using my old 32-bit Debian
install because I've been lazy about ditching it/upgrading/what-have-you).
Don't know if that would make sense, per se, but hell, it's not the first
problem I've had with my current OS setup.  If no one can reproduce, it's
probably some combination of things on my end...

I'll be trying the unit tests out again once I get Arch configured on another
hard drive on this machine.

Thanks for the feedback everyone,
--Alex Vondrak


From: John Benediktsson [mrj...@gmail.com]
Sent: Saturday, August 25, 2012 11:11 AM
To: factor-talk@lists.sourceforge.net
Cc: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Out of memory error

If this is happening of 0.95 release than I wonder if we have a slow leak 
rather than corruption - all of our builders produce consistent clean builds 
(load-all test-all) and have for awhile.

Perhaps we don't notice due to 16+ GB of RAM...?


On Aug 25, 2012, at 11:06 AM, Joe Groff  wrote:

> On Sat, Aug 25, 2012 at 1:36 PM, Jim Mack  wrote:
>> In a way, too many possible culprits mask each other.
>>
>> I remember a problem like this that I solved by reducing the amount of
>> memory so the problem would show quickly, then testing small things in
>> isolation and volume.  Pick a subset of tests and run them multiple times at
>> low memory until it fails or becomes clear it won't.   Rinse and repeat.
>
> An out of memory error could also be caused by things other than a
> lack of memory. If the heap is getting corrupted or there is a
> compiler bug, the system could end up passing a garbage size to malloc
> or mmap that is too big to be fulfilled.
>
> -Joe
>
> --
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Out of memory error

2012-08-25 Thread Alexander J. Vondrak
Okay, so still no luck:

  - Tried skipping tools.deploy tests (just yanked deploy-tests.factor out of
the 0.95 source tree before `load-all test-all`), still crashed.

  - Tried skipping extra/ with `"resouce:core" load-root "resource:basis"
load-root test-all`, still crashed.

  - Tried doubling the sizes of the GC generations (./factor -young=2 -aging=4
-tenured=1600) to no avail.

  - No particular vocabulary seems to be tripping it off, as verified by doing
the above with 
```
\ run-test-file [
  [ dup "~/Desktop/tests" utf8 [ print ] with-file-appender ] prepend
] annotate
```
and having them crash at different vocabs.  The few times I managed to
catch a glimpse of the factor process running in top, the memory usage just
seemed to creep up to its ceiling as more and more tests were run until it
finally aborted.

It didn't use to do this (even very recently), which is what made me think it
was something to do with my machine just being b0rked.  I've had weird bugs
crop up from time to time using Debian, so it's not unprecedented.  I've been
procrastinating setting up an Arch install on this machine, so maybe this is as
good a reason as any to get around to that...

Any other experiments I should try?

Thanks for the help,
--Alex Vondrak


From: John Benediktsson [mrj...@gmail.com]
Sent: Friday, August 24, 2012 6:54 PM
To: factor-talk@lists.sourceforge.net
Cc: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Out of memory error

It might be worth only loading and testing vocabularies in core and basis, to 
see if GVN works?

On Aug 24, 2012, at 6:50 PM, "Alexander J. Vondrak"  
wrote:

> It seems to fail soon after the tools.deploy tests.  I tried at one point 
> disabling those, but I think it still crashed.  I should check again...
>
> 
> From: Doug Coleman [doug.cole...@gmail.com]
> Sent: Friday, August 24, 2012 6:44 PM
> To: factor-talk@lists.sourceforge.net
> Subject: Re: [Factor-talk] Out of memory error
>
> 8gb outta be enough for anybody. But It's not, I guess. Try with more RAM or 
> patch the part that grows to only grow to as much as you have.
>
> Maybe something is using way too much
>
> On Aug 24, 2012 6:01 PM, "Alexander J. Vondrak" 
> mailto:ajvond...@csupomona.edu>> wrote:
> Hey all,
>
> Mini-update: got the unit tests for the global value numbering pass more
> up-to-snuff awhile ago (it's like test-driven development in reverse!).  Still
> seems like I should be doing more to test the new capabilities, but I'm not
> sure if I could do much more than what's there.
>
> My efforts as of late have been focused on some GVN improvements.  But for the
> past way-too-long, I thought I had broken something catastrophic because
> `load-all test-all` would invariably crash the listener with an "out of 
> memory"
> error:
>
>  Out of memory
>
>  Nursery: Start=831c, size=10, end=832c
>  Aging: Start=82fc, size=20, end=831c
>  Tenured: Start=50c8, size=3214, end=82dc
>  Cards:base=b44d0008, size=326800
>  Aborted
>
> After a lot of very slow debugging (them's the breaks when running all the 
> unit
> tests, I guess) that was ultimately fruitless, I finally tried out Factor 0.95
> straight from the build farm---none of my changes, no .git, just a clean
> download of the linux-x86-32 tarchive.  And, what do you know, `load-all
> test-all` still crashes with the same error.
>
> It hadn't done that before, so I think the issue may be an intervening OS
> update I did.  I'm running a fully up-to-date Debian testing, kernel
> 3.2.0-3-686-pae.
>
> 1) Can anyone reproduce this error?  Or is my machine just that jacked up?  
> I'd
> be happy to provide other diagnostic info, if it'd help.
>
> 2) Any coping mechanisms?  I considered just throwing a bunch of memory at it
> with command line switches (-young=, -aging=, -tenured=, etc.), but wasn't
> really sure how much would do the trick, since it just started crashing like
> this out of the blue anyway.
>
> Thanks,
> --Alex Vondrak
> --
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourcefo

Re: [Factor-talk] Out of memory error

2012-08-24 Thread Alexander J. Vondrak
It seems to fail soon after the tools.deploy tests.  I tried at one point 
disabling those, but I think it still crashed.  I should check again...


From: Doug Coleman [doug.cole...@gmail.com]
Sent: Friday, August 24, 2012 6:44 PM
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Out of memory error

8gb outta be enough for anybody. But It's not, I guess. Try with more RAM or 
patch the part that grows to only grow to as much as you have.

Maybe something is using way too much

On Aug 24, 2012 6:01 PM, "Alexander J. Vondrak" 
mailto:ajvond...@csupomona.edu>> wrote:
Hey all,

Mini-update: got the unit tests for the global value numbering pass more
up-to-snuff awhile ago (it's like test-driven development in reverse!).  Still
seems like I should be doing more to test the new capabilities, but I'm not
sure if I could do much more than what's there.

My efforts as of late have been focused on some GVN improvements.  But for the
past way-too-long, I thought I had broken something catastrophic because
`load-all test-all` would invariably crash the listener with an "out of memory"
error:

  Out of memory

  Nursery: Start=831c, size=10, end=832c
  Aging: Start=82fc, size=20, end=831c
  Tenured: Start=50c8, size=3214, end=82dc
  Cards:base=b44d0008, size=326800
  Aborted

After a lot of very slow debugging (them's the breaks when running all the unit
tests, I guess) that was ultimately fruitless, I finally tried out Factor 0.95
straight from the build farm---none of my changes, no .git, just a clean
download of the linux-x86-32 tarchive.  And, what do you know, `load-all
test-all` still crashes with the same error.

It hadn't done that before, so I think the issue may be an intervening OS
update I did.  I'm running a fully up-to-date Debian testing, kernel
3.2.0-3-686-pae.

1) Can anyone reproduce this error?  Or is my machine just that jacked up?  I'd
be happy to provide other diagnostic info, if it'd help.

2) Any coping mechanisms?  I considered just throwing a bunch of memory at it
with command line switches (-young=, -aging=, -tenured=, etc.), but wasn't
really sure how much would do the trick, since it just started crashing like
this out of the blue anyway.

Thanks,
--Alex Vondrak
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net<mailto:Factor-talk@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/factor-talk

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Out of memory error

2012-08-24 Thread Alexander J. Vondrak
8 GB.

From: Doug Coleman [doug.cole...@gmail.com]
Sent: Friday, August 24, 2012 6:06 PM
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Out of memory error

How much ram?

On Aug 24, 2012 6:01 PM, "Alexander J. Vondrak" 
mailto:ajvond...@csupomona.edu>> wrote:
Hey all,

Mini-update: got the unit tests for the global value numbering pass more
up-to-snuff awhile ago (it's like test-driven development in reverse!).  Still
seems like I should be doing more to test the new capabilities, but I'm not
sure if I could do much more than what's there.

My efforts as of late have been focused on some GVN improvements.  But for the
past way-too-long, I thought I had broken something catastrophic because
`load-all test-all` would invariably crash the listener with an "out of memory"
error:

  Out of memory

  Nursery: Start=831c, size=10, end=832c
  Aging: Start=82fc, size=20, end=831c
  Tenured: Start=50c8, size=3214, end=82dc
  Cards:base=b44d0008, size=326800
  Aborted

After a lot of very slow debugging (them's the breaks when running all the unit
tests, I guess) that was ultimately fruitless, I finally tried out Factor 0.95
straight from the build farm---none of my changes, no .git, just a clean
download of the linux-x86-32 tarchive.  And, what do you know, `load-all
test-all` still crashes with the same error.

It hadn't done that before, so I think the issue may be an intervening OS
update I did.  I'm running a fully up-to-date Debian testing, kernel
3.2.0-3-686-pae.

1) Can anyone reproduce this error?  Or is my machine just that jacked up?  I'd
be happy to provide other diagnostic info, if it'd help.

2) Any coping mechanisms?  I considered just throwing a bunch of memory at it
with command line switches (-young=, -aging=, -tenured=, etc.), but wasn't
really sure how much would do the trick, since it just started crashing like
this out of the blue anyway.

Thanks,
--Alex Vondrak
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net<mailto:Factor-talk@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/factor-talk

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Out of memory error

2012-08-24 Thread Alexander J. Vondrak
Hey all,

Mini-update: got the unit tests for the global value numbering pass more
up-to-snuff awhile ago (it's like test-driven development in reverse!).  Still
seems like I should be doing more to test the new capabilities, but I'm not
sure if I could do much more than what's there.

My efforts as of late have been focused on some GVN improvements.  But for the
past way-too-long, I thought I had broken something catastrophic because
`load-all test-all` would invariably crash the listener with an "out of memory"
error:

  Out of memory

  Nursery: Start=831c, size=10, end=832c
  Aging: Start=82fc, size=20, end=831c
  Tenured: Start=50c8, size=3214, end=82dc
  Cards:base=b44d0008, size=326800
  Aborted

After a lot of very slow debugging (them's the breaks when running all the unit
tests, I guess) that was ultimately fruitless, I finally tried out Factor 0.95
straight from the build farm---none of my changes, no .git, just a clean
download of the linux-x86-32 tarchive.  And, what do you know, `load-all
test-all` still crashes with the same error.

It hadn't done that before, so I think the issue may be an intervening OS
update I did.  I'm running a fully up-to-date Debian testing, kernel
3.2.0-3-686-pae.

1) Can anyone reproduce this error?  Or is my machine just that jacked up?  I'd
be happy to provide other diagnostic info, if it'd help.

2) Any coping mechanisms?  I considered just throwing a bunch of memory at it
with command line switches (-young=, -aging=, -tenured=, etc.), but wasn't
really sure how much would do the trick, since it just started crashing like
this out of the blue anyway.

Thanks,
--Alex Vondrak
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Time for some Tutorials

2012-08-20 Thread Alexander J. Vondrak
In case it helps, I'll also add that chapter 2 of my thesis is an overview of
Factor as a language:
https://github.com/ajvondrak/thesis/blob/master/thesis.pdf?raw=true

> In any case, I would recommend picking a project that you are familiar with
> or interested in and trying to implement it in Factor.  If you need help,
> feel free to reach out to the mailing list or #concatenative IRC channel.

I think this can't be stressed enough.  People often paralyze themselves
thinking they need more tutorials than they actually do.

Good luck,
--Alex Vondrak


From: John Benediktsson [mrj...@gmail.com]
Sent: Monday, August 20, 2012 6:47 PM
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Time for some Tutorials

Not bad ideas, we'd welcome any contributions you'd like to make in this area.  
Besides some future, currently unavailable, tutorials, I would suggest you look 
at:

* Reading "Factor Cookbook" 
(http://docs.factorcode.org/content/article-cookbook.html)
* Creating "Your First Program" 
(http://docs.factorcode.org/content/article-first-program.html)

I have quite a few blog posts on my blog that might interest you whether it be:

* simple RPG game (http://re-factor.blogspot.com/2011/02/simple-rpg.html)
* simple website (http://re-factor.blogspot.com/2010/08/hello-web.html)
* calculator w/ gui 
(http://re-factor.blogspot.com/2010/08/calculator-with-gui.html)
* using EBNF (http://re-factor.blogspot.com/2010/07/rolling-dice.html)
* Norvig's spelling 
(http://re-factor.blogspot.com/2010/03/how-to-write-spelling-corrector.html)

As well as some optimization tips through:

* powers of 2 (http://re-factor.blogspot.com/2011/04/powers-of-2.html)
* wc -l (http://re-factor.blogspot.com/2011/11/wc-l.html)
* "factor-like" 
(http://re-factor.blogspot.com/2010/05/evenly-partition-integer.html)

In any case, I would recommend picking a project that you are familiar with or 
interested in and trying to implement it in Factor.  If you need help, feel 
free to reach out to the mailing list or #concatenative IRC channel.

I would also note that the scary list of improvements shouldn't make you as a 
beginner more wary, since they don't make the language more complicated.  In 
fact, the changes are largely making the language more stable and the libraries 
more robust.

Best,
John.


On Mon, Aug 20, 2012 at 6:33 PM, graham telfer 
mailto:gakouse...@hotmail.com>> wrote:
I down loaded and installed the latest version of Factor. The list of 
improvements and new libraries is impressive but pretty scary to a casual user 
of Factor like myself. Isn't it time there were some tutorials available?

I would like to see 3 initially: a beginner's tutorial in the manner of 
Starting Forth, a tutorial that looks more to specification and design of 
programs in a functional style with Factor and a version of Real World Haskell 
for Factor.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Any way of making sense of what's in the boot image?

2012-08-17 Thread Alexander J. Vondrak
pic-tail-reg = polymorphic inline cache tail call register

ds-reg = data stack register

rs-reg = retain stack register

nv-reg: might help to see 
https://github.com/slavapestov/factor/blob/master/basis/cpu/x86/bootstrap.factor#L14

link-reg: only place it seems to be used is 
https://github.com/slavapestov/factor/blob/master/basis/cpu/x86/bootstrap.factor#L49

shift-arg, div-arg, mod-arg: seem to be used in x86 bootstrapping for holding 
arithmetic arguments; e.g., 
https://github.com/slavapestov/factor/blob/master/basis/cpu/x86/bootstrap.factor#L561

That's as much as I can gather from a glance,
--Alex Vondrak


From: Michael Clagett [mclag...@hotmail.com]
Sent: Friday, August 17, 2012 7:08 AM
To: Factor-Talk
Subject: Re: [Factor-talk] Any way of making sense of what's in the boot image?

A few more:

// ?
: shift-arg ( -- reg ) ECX ;

// ?
: div-arg ( -- reg ) EAX ;

// ?
: mod-arg ( -- reg ) EDX ;



From: mclag...@hotmail.com
To: factor-talk@lists.sourceforge.net
Date: Fri, 17 Aug 2012 14:03:30 +
Subject: Re: [Factor-talk] Any way of making sense of what's in the boot image?

// ?
: pic-tail-reg ( -- reg ) EDX ;

// stack pointer
: stack-reg ( -- reg ) ESP ;

// stack frame pointer
: frame-reg ( -- reg ) EBP ;

// virtual machine object base
: vm-reg ( -- reg ) EBX ;

: ctx-reg ( -- reg ) EBP ;

// non-volatile registers  -- these would be registers needing to be preserved 
(and that callers can count on being preserved)?
: nv-regs ( -- seq ) { ESI EDI EBX } ;

// volatile registers -- these would be registers one is free to use (and that 
callers cannot count on being preserved)?
: volatile-regs ( -- seq ) { EAX ECX EDX } ;

// ?
: nv-reg ( -- reg ) ESI ;

// ?
: ds-reg ( -- reg ) ESI ;

// ?
: rs-reg ( -- reg ) EDI ;

// ?
: link-reg ( -- reg ) EBX ;

Would anybody be able to validate assumptions articulated above and fill in 
missing pieces.  This is good foundational knowledge to operate in general with.


From: mclag...@hotmail.com
Date: Thu, 16 Aug 2012 13:15:48 -0400
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Any way of making sense of what's in the boot image?

Great, thanks.

Sent from my iPhone

On Aug 16, 2012, at 1:11 PM, "John Benediktsson" 
mailto:mrj...@gmail.com>> wrote:


So then, John, does that mean that in the [ 4 slot { array} declare ], that I'm 
getting the slot named "array" which is at offset 4 (and then declaring that to 
be an array, so as to disable some of the type safety checks)?

Yes, the hashtable code is written at a bit lower level and thus maybe a little 
harder to read than one might normally write in Factor since it is one of the 
building blocks that everything is built upon.  It is also possible that some 
of the compiler optimizations that have been written in the last couple of 
years make some of those declarations unnecessary, although I'd have to look 
into it more to know for sure.

Also, due to the bootstrapping mechanism, some of the higher level language 
constructs like locals and fry quotations are not available yet.  That is 
something we hope to fix at some future point.

Here it says slot takes two incoming values:  an obj and a non-negative fixnum, 
which is the nth slot.   In the hashtable slot-specs you list below there are 
only three slots listed, but it does say that the slot named "array" is at 
offset 4.   Is it this offset number that is being specified by the "m" 
parameter?  And thus is the array I am seeing in my original description the 
contents of the "array" slot of the hashtable that was originally on the stack? 
  That makes sense to me.   And the fact that the array is 128 slots long 
(allowing flattened representation of 64 key-value pairs) just means that the 
underlying array in the hashtable has 64 buckets.  Is this a correct 
interpretation.  If it is, it makes sense that the actual 26 values stored in 
the hash table would be dispersed throught the 64 buckets, because this is what 
a hashtable does.

Yes, exactly!  The "slot-spec" tuple provides a generic description of what is 
to be found in this case at offset 4.


Best,
John.
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

-- 
Live Security Virtual Conference Exclusive live event will cover all

Re: [Factor-talk] Any way of making sense of what's in the boot image?

2012-08-13 Thread Alexander J. Vondrak
Those look like VM constants.  A quick grep yields where an enum is defined in 
a header file that has comments about their purposes:

$ find -name \*.hpp | xargs grep -l "RT_DLSYM"
./vm/instruction_operands.hpp

Regards,
--Alex Vondrak

From: Michael Clagett [mclag...@hotmail.com]
Sent: Monday, August 13, 2012 8:52 AM
To: Factor-Talk
Subject: [MARKETING] Re: [Factor-talk] Any way of making sense of what's in the 
boot image?

Here's an obscure question that is of interest to me in my current quest, but 
probably not to anyone else.  So if there is a better forum for me to ask such 
things, I would love to be instructed; until I hear otherwise, however, I will 
continue to use this list.

Is there any place where I can penetrate the meaning of the following constants:

CONSTANT: rt-dlsym 0
CONSTANT: rt-entry-point 1
CONSTANT: rt-entry-point-pic 2
CONSTANT: rt-entry-point-pic-tail 3
CONSTANT: rt-here 4
CONSTANT: rt-this 5
CONSTANT: rt-literal 6
CONSTANT: rt-untagged 7
CONSTANT: rt-megamorphic-cache-hits 8
CONSTANT: rt-vm 9
CONSTANT: rt-cards-offset 10
CONSTANT: rt-decks-offset 11
CONSTANT: rt-exception-handler 12
CONSTANT: rt-dlsym-toc 13
CONSTANT: rt-inline-cache-miss 14
CONSTANT: rt-safepoint 15

So far I've only encountered rt-here and I've only seen it encoded into a 
relocation entry and not really used anywhere yet.  But this strikes me as the 
kind of thing it would be useful to know as I am slogging through this stuff.

Not a hugely pressing question, as I'm sure I'll muddle through it.  But if 
anyone has a moment to illuminate, it would be nice.

Thanks.

Mike


> Date: Thu, 9 Aug 2012 06:26:54 -0700
> From: arc...@gmail.com
> To: factor-talk@lists.sourceforge.net
> Subject: Re: [Factor-talk] Any way of making sense of what's in the boot 
> image?
>
> On Wed, Aug 8, 2012 at 9:56 PM, Michael Clagett  wrote:
> > Hi Joe --
> >
> > Thank you so much for your guidance. I'm assuming that it is the
> > basis\bootstrap\image\image.factor and the core\bootstrap\primitives.factor,
> > stage1.factor and syntax.factor that you are referring to?
> >
> > One question just to help me get oriented before I go into heavy
> > head-twisting mode. I notice that all these files have significant numbers
> > of pre-existing vocabularies that they use. If this is what is used to
> > generate the early stage1 bootstrapping stuff, then am I correct to assume
> > that this is done from some version of factor where all this stuff has built
> > already from scratch (that would be the implication, if all these files are
> > able to use those vocabularies)? Or is there some other mechanism at work
> > here that I should know about, and if so, is it written up anywhere that you
> > know about.
> >
> > I have just read Slava's January 2010 post on the bootstrapping mechanism,
> > so I understand the mechanism a bit better now, but am still thinking there
> > has to be some Factor system somewhere that was built without a bootstrap
> > image in order to have the vocabularies available that are used to generate
> > the bootstrapping. Is there anything anywhere documenting that aspect of
> > the picture. The reason I ask is that I would like to get a sense of how
> > extensive that core fundamental set of vocabularies is that is needed to
> > process the primitives and stage1 factor files.
> >
> > Here's the USING statement for primitives.factor:
> >
> > USING: alien alien.strings arrays byte-arrays generic hashtables
> > hashtables.private io io.encodings.ascii kernel math
> > math.private math.order namespaces make parser sequences strings
> > vectors words quotations assocs layouts classes classes.private
> > classes.builtin classes.singleton classes.tuple
> > classes.tuple.private kernel.private vocabs vocabs.loader
> > source-files definitions slots classes.union
> > classes.intersection classes.predicate compiler.units
> > bootstrap.image.private io.files accessors combinators ;
> > IN: bootstrap.primitives
> >
> > It's got a lot of stuff there. Is a lot of this built in the C++ code that
> > constitutes the VM? Or is some fundamental processing capability put into
> > place that allows the processing of factor files to build these
> > vocabularies? And if so, is the factor source used also included in the
> > downloaded platform? Or was this a special primordial code base that was
> > used once and never really needed again?
>
> Although core/bootstrap/primitives.factor is in core/, it's not
> actually loaded as-is into the boot image; it's really a script
> designed to run as part of `make-image` in the host image. All of
> those modules are loaded and run in the host image. While there of
> course had to have been a primordial Factor that could boot itself, I
> think it would be too different now to resemble current Factor.
> Factor's bootstrapping loop evolved somewhat organically.
>
> You can tell whether a word is a C++ primitive by `see`ing it in the
> listener. Primitive words sh

Re: [Factor-talk] Global Value Numbering

2012-08-07 Thread Alexander J. Vondrak
> This is an amazing piece of work, congratulations!

Thanks!  I appreciate it.

> The first part has a very nice introduction to the Factor language and
> compiler implementation too.

Glad you think so.

> I wonder if the performance regressions were due to increased register
> pressure? Factor's linear scan is pretty crappy compared to contemporary
> implementations in LLVM and LuaJIT.

The thought had crossed my mind, though I'm not sure if that would explain the
difference between my Pentium 4 and Core 2 results.  Suppose we'd have to
verify benchmarks on various machines.

There was something else I noticed after looking at some of the results on
larger CFGs.  I'm thinking there could be issues with expressions that have
canonical leaders that aren't available in later blocks.  Like in the
following, the canonical leader of the value 100 is defined in an unfoldable
branch, so vregs 5 and 6 aren't converted into copies in block 4---not even
just copies of the definitely-available vreg 4, though they all have the same
value number.  Have to eventually rewrite the redundancy elimination to search
for available registers that compute the same value number, instead of just
relying on the availability of the canonical leader.

```
V{ T{ ##branch } } 0 test-bb

V{
T{ ##inc-d { n -1 } }
T{ ##peek { dst 1 } { loc D -1 } }
T{ ##compare-imm-branch { src1 1 } { src2 f } { cc cc/= } }
} 1 test-bb

V{
T{ ##inc-d { n 1 } }
T{ ##load-integer { dst 2 } { val 100 } }
T{ ##branch }
} 2 test-bb

V{
T{ ##inc-d { n 1 } }
T{ ##load-integer { dst 3 } { val 200 } }
T{ ##branch }
} 3 test-bb

V{
T{ ##load-integer { dst 4 } { val 100 } }
T{ ##load-integer { dst 5 } { val 100 } }
T{ ##load-integer { dst 6 } { val 100 } }
} 4 test-bb

test-diamond
```

Regards,
--Alex Vondrak


From: Slava Pestov [sl...@factorcode.org]
Sent: Saturday, August 04, 2012 12:42 AM
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Global Value Numbering

This is an amazing piece of work, congratulations!

The first part has a very nice introduction to the Factor language and compiler 
implementation too.

I wonder if the performance regressions were due to increased register 
pressure? Factor's linear scan is pretty crappy compared to contemporary 
implementations in LLVM and LuaJIT.

Doug and John are the current maintainers, I think they should probably merge 
this in after the release they're planning. Or was that supposed to be a secret 
:-)

On Fri, Aug 3, 2012 at 6:52 PM, Alexander J. Vondrak 
mailto:ajvond...@csupomona.edu>> wrote:
http://weknowmemes.com/wp-content/uploads/2012/01/op-will-surely-deliver-lets-just-wait.jpg

Yes, I did actually work on the GVN pass---even got my master's degree.  After
finally defending my thesis (available at https://github.com/ajvondrak/thesis),
I started a teaching job at my university, which proved to be a lot of work.
Thus, I didn't find time to clean up the issues I wanted to fix before pushing
this to the public.  But it's been a long time, and I figured I should actually
put *something* out one way or another.

So, here it is: https://github.com/ajvondrak/factor/tree/gvn

Right now, the global value numbering pass lives in extra/compiler/cfg/gvn,
thus you can simply switch out the USING: in compiler.cfg.optimizer to give it
a whirl.  Now that it's summer, I hope to be able to work on the broken parts
some more.  To wit,
  * I never updated the old value-numbering unit tests, so gvn-tests will fail
(whether because the global optimization changes test outcomes or just
because of the tweaked interface).
  * The same tests that fail on my personal machine [1] from a load-all
test-all without GVN still fail using GVN.  The only previously-passing
tests that now fail unexpectedly were in math.vectors.simd (memory
protection faults), so there's something buggy going on with SIMD stuff.
(This failure isn't mentioned in the thesis because I hadn't done a
load-all back then.)

Otherwise, the work seems interesting, if nothing else:
  * My thesis lends some documentation to the project, I hope.
  * With GVN, Factor still bootstraps in about the same amount of time.
  * The GVN pass should, ideally, replace the compiler.cfg.copy-prop pass.
  * When I ran them for my thesis a year ago, the benchmarks showed some
impressive improvements across the board (summarized in the PDF).  These
were run on my old single-core 3.2 GHz Pentium 4 machine with 2 GB RAM,
running Debian (testing).  Nowadays, on my 2.83 GHz Intel Core 2 Quad with
8 GB RAM, I get more erratic / less dramatic results.  Not sure why, but
it'd probably be interesting to find out.

Factor code has been a pleasure to work with.  Hope these changes are worth
anything.

Thanks,
--Alex Vondrak


Re: [Factor-talk] Global Value Numbering

2012-08-07 Thread Alexander J. Vondrak
Thank you very much!

As a minor update: I ported the old units tests to work with the new gvn code.
There are a few possible regressions concerning SIMD instructions, which I hope
will explain the failing math.vectors.simd tests.  My next move is to fix those
regressions (or decide if they unit test itself needs to change), then add some
new unit tests to exercise the "global" part of the value numbering algorithm.

Regards,
--Alex Vondrak


From: Eduardo Cavazos [wayo.cava...@gmail.com]
Sent: Sunday, August 05, 2012 10:16 AM
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Global Value Numbering

Alex,

Very impressive thesis. Congratulations!

Ed

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Global Value Numbering

2012-08-03 Thread Alexander J. Vondrak
http://weknowmemes.com/wp-content/uploads/2012/01/op-will-surely-deliver-lets-just-wait.jpg

Yes, I did actually work on the GVN pass---even got my master's degree.  After
finally defending my thesis (available at https://github.com/ajvondrak/thesis),
I started a teaching job at my university, which proved to be a lot of work.
Thus, I didn't find time to clean up the issues I wanted to fix before pushing
this to the public.  But it's been a long time, and I figured I should actually
put *something* out one way or another.

So, here it is: https://github.com/ajvondrak/factor/tree/gvn

Right now, the global value numbering pass lives in extra/compiler/cfg/gvn,
thus you can simply switch out the USING: in compiler.cfg.optimizer to give it
a whirl.  Now that it's summer, I hope to be able to work on the broken parts
some more.  To wit,
  * I never updated the old value-numbering unit tests, so gvn-tests will fail
(whether because the global optimization changes test outcomes or just
because of the tweaked interface).
  * The same tests that fail on my personal machine [1] from a load-all
test-all without GVN still fail using GVN.  The only previously-passing
tests that now fail unexpectedly were in math.vectors.simd (memory
protection faults), so there's something buggy going on with SIMD stuff.
(This failure isn't mentioned in the thesis because I hadn't done a
load-all back then.)

Otherwise, the work seems interesting, if nothing else:
  * My thesis lends some documentation to the project, I hope.
  * With GVN, Factor still bootstraps in about the same amount of time.
  * The GVN pass should, ideally, replace the compiler.cfg.copy-prop pass.
  * When I ran them for my thesis a year ago, the benchmarks showed some
impressive improvements across the board (summarized in the PDF).  These
were run on my old single-core 3.2 GHz Pentium 4 machine with 2 GB RAM,
running Debian (testing).  Nowadays, on my 2.83 GHz Intel Core 2 Quad with
8 GB RAM, I get more erratic / less dramatic results.  Not sure why, but
it'd probably be interesting to find out.

Factor code has been a pleasure to work with.  Hope these changes are worth
anything.

Thanks,
--Alex Vondrak

[1] Most of the failures were from DLLs I didn't have installed (libpq.so,
libsqlite3.so, libudis86.so.0, libncursesw.so, and libblas.so for tests in db,
furnace, site-watcher, webapps.mason.backend, math.blas.matrices,
math.blas.vectors, tools.disassembler, and curses).  Other than that, some http
tests failed with 500 errors (expecting 404s), io.launcher.unix had a killed
process, and memcached tests fail with Connection refused (111).  Nothing that
seems like a big deal.
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] sequences and the stack

2011-08-21 Thread Alexander J. Vondrak
first2: http://docs.factorcode.org/content/word-first2,sequences.html

In general, firstn: 
http://docs.factorcode.org/content/word-firstn,sequences.generalizations.html

Regards,
--Alex Vondrak

From: Andrew Pennebaker [andrew.penneba...@gmail.com]
Sent: Sunday, August 21, 2011 11:20 AM
To: Factor
Subject: [Factor-talk] sequences and the stack

The stack contains a sequence of number pairs:

{ { x1 y1 } { x2 y2 } { x3 y3 } ... }

I want to map over the pairs, accessing xi and yi.

[
   ! stack = { xi yi }

   ! ...

   ! stack = xi yi
] map

What's the code that goes in !... ?

Other than using nth, how can I do this? Is there a word that pops the elements 
of a sequence onto the stack?

Cheers,

Andrew Pennebaker
www.yellosoft.us

--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] GVN progress

2011-05-22 Thread Alexander J. Vondrak
Ping,

I haven't checked in for a long time, but I've still been working on
globalizing compiler.cfg.value-numbering (when I get spare time in between
classes).  Kind of got side-tracked because I was finding CFGs difficult to
debug.  I didn't really like the flat text compiler.cfg.debugger prints, and
compiler.graphviz is pretty ad-hoc.  So, I resolved to make a sensible graphviz
vocab that I could then use to produce CFG representations (hence my previous
email).

As for GVN, after I was able to see some examples in action, I got some
preliminary results working (in a stupidly short burst of work after wrapping
up graphviz; ugh).  Right now it's kind of a simple iterate-till-fixpoint
method---the "RPO Algorithm" from Simpson's dissertation (it essentially works
like compiler.cfg.copy-prop does now; the GVN pass should subsume that in short
order).  Probably won't get much better than that for the purposes of my thesis
since I just need to get something out there, but I'd be interested in
improving it after I defend, which is currently planned for the summer.

I haven't pushed the changes to my github yet.  Is there any etiquette about
handling commits I should know while working on that?  For graphviz, I just
used a separate repo in work/ for my personal purposes, then copied the result
into extra/ to push to github, which seems pretty lame.  Is it cool to just
commit as much as I want in a branch, or does that clutter the git logs too
much when it's merged later?

Regards,
--Alex Vondrak
--
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Graphviz vocab

2011-05-22 Thread Alexander J. Vondrak
Hey,

I just pushed a graphviz vocab to https://github.com/ajvondrak/factor (the 
'graphviz' branch).  If it looks like a good addition, any code review / 
testing / proofreading the docs would be welcome.

Regards,
--Alex Vondrak
--
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Worthwhile Thesis Idea?

2010-09-18 Thread Alexander J. Vondrak
Okay, I've looked into the things discussed in the IRC session.

First off, my initial idea is ill-defined, not really useful, and Factor's 
current DFAs are okay, or at least as efficient as they'd be in the 
Lerner/Grove/Chambers framework.  Even though it's a little crufty, 
compiler.tree should be done away with someday anyhow.  But that rewrite would 
be a lot of work (according to Daniel) and I'm not too excited about it as a 
project.

On the other hand, Slava discussed writing a GVN pass, so I was looking over 
some GVN stuff -- mostly skimming the VanDrunen GVN-PRE thesis.  I found that 
really interesting; I think implementing some sort of GVN would make for a good 
project (thesis or otherwise, though I think my advisor will like it).  If 
you're okay with me working on it:

- We'd need the GC map refactoring first.  Would it be part of the project, or 
is it more of a "todo"?  Maybe I should do it to get more familiar with the 
code?

- On that note, is there a recommended reading list of compiler.cfg vocabs to 
get up to speed?  I mean, I'd read all I could, but maybe there's handful of 
important ones to make for a shorter adjustment period.

- Recommended non-code reading?  Papers, books, slides, whatever?

Thanks for the discussion,

-- Alex Vondrak
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Worthwhile Thesis Idea?

2010-09-16 Thread Alexander J. Vondrak
Hey,

I'm a CS Master's student at Cal Poly Pomona focusing on programming language 
theory & implementation -- particularly optimizations.  Particularly 
optimization "frameworks": ways of simplifying compilers' often repetitive, 
ad-hoc code into a single conceptual model.

This summer, I've been reading the source of Factor's compiler on again / off 
again.  I'm most of the way through compiler/tree (I've read up through 
escape-analysis in depth), though I've given all of the code many look-overs.  
I wouldn't dare call myself an expert in Factor, but reading it has become 
pretty natural and I'm not at that "I hear it's good for pushing stacks, but 
you can't do variables" phase. :)

This upcoming quarter (Fall 2010-11) I'm working on my thesis, and one paper 
keeps getting stuck in my mind: Composing Dataflow Analyses and Transformations 
by Lerner, Grove, and Chambers ( 
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.11.6534 ).  It presents 
a unified way of writing dataflow optimizations so they automatically compose 
together in mutually beneficial ways, even though they're defined separately 
with no special knowledge of each other.  It's the stuff behind the GHC guys' 
Hoopl framework, which is apparently being merged into their new backend: 
http://www.cs.tufts.edu/~nr/pubs/dfopt-abstract.html (a newer version is linked 
there, too).

With their powers combined, they form! ...an idea my thesis advisor seemed 
receptive to.  Would overhauling the dataflow analyses & optimizations of the 
Factor compiler be useful or interesting to you guys, even just to see the 
results?  Or am I way off base here?  If so, any better ideas?  I'm finding 
polyhedral optimization interesting, but if the guys at GCC and LLVM take such 
a long time coding their frameworks, I can only imagine how terribly I'd do.  :P

Thanks for your feedback,

-- Alex Vondrak
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk