[Factor-talk] Hooks for dynamic refreshing?

2009-10-18 Thread Ed Swartz
Hi, I think one of the neatest features of Factor is being able to dynamically reload vocabularies and have the changes immediately show up in running code. Now, it seems this behavior is not really magic but relies on some explicit coding. (I vaguely remember seeing some git commits related

Re: [Factor-talk] Hooks for dynamic refreshing?

2009-10-18 Thread Joe Groff
On Oct 18, 2009, at 9:46 AM, Ed Swartz wrote: For my specific needs, I'm slowly learning GLSL and using the very convenient gpu.shaders vocabulary with GLSL-SHADER to make shaders embedded in Factor source. I have some tuples which reference shader programs and apply them when drawing a

Re: [Factor-talk] gpu.shader reloading [was: Hooks for dynamic refreshing?]

2009-10-18 Thread Ed Swartz
Hi, There's a word add-definition-observer in compiler.units that lets you register an object to have its definitions-changed method called whenever definitions are added or changed. You can look at tools.deprecation for a simple example of how it works. Thanks, this works great.

Re: [Factor-talk] gpu.shader reloading [was: Hooks for dynamic refreshing?]

2009-10-18 Thread Joe Groff
On Oct 18, 2009, at 12:54 PM, Ed Swartz wrote: I was trying to code a definition observer for this case, but it doesn't work as expected. refresh-program says that program-instance, et al., keep track of existing instances of a program, but when I have shaders defined in Factor

Re: [Factor-talk] gpu.shader reloading [was: Hooks for dynamic refreshing?]

2009-10-18 Thread Joe Groff
On Oct 18, 2009, at 12:54 PM, Ed Swartz wrote: Is there something I'm missing here? Does/could gpu.shaders store some database of shaders by symbol so I could look them up dynamically, for instance? Your code looks fine. The problem was just that GLSL-SHADER: and GLSL- PROGRAM: didn't

Re: [Factor-talk] gpu.shader reloading [was: Hooks for dynamic refreshing?]

2009-10-18 Thread Ed Swartz
Your code looks fine. The problem was just that GLSL-SHADER: and GLSL- PROGRAM: didn't carry over the shader/program instance information from the old definitions when they redefined a shader or program objects. I pushed a fix that should make refresh-program work as advertised even

Re: [Factor-talk] gpu.shader reloading [was: Hooks for dynamic refreshing?]

2009-10-18 Thread Joe Groff
On Oct 18, 2009, at 2:55 PM, Ed Swartz wrote: Works great, thanks for the quick response! BTW, before I delve too deeply, is the uniform variable functionality in gpu.render usable outside render-sets yet (or at all)? I notice the extras demos just directly use glUniform. It's designed

[Factor-talk] LC53 encryption cracking

2009-10-18 Thread Hugh Aguilar
I wrote a program to crack a linear-congruential (LC) encryption system. The system is called LC53 (my invention), and it uses these constants: unity = 2^32-5 mult = 2^32-3 LC encryption is fairly easy to crack, so nobody uses it in practice, but it makes for a good test of a language

Re: [Factor-talk] LC53 encryption cracking

2009-10-18 Thread Slava Pestov
Hi Hugh, Your program looks for a file named C:\\Users\\hugh\\Desktop\\Factor\\factor\\work\\LC53\\test.txt Can you send me such a test file? Slava On Sun, Oct 18, 2009 at 7:35 PM, Hugh Aguilar hugoagui...@rosycrew.com wrote: I wrote a program to crack a linear-congruential (LC) encryption

Re: [Factor-talk] gpu.shader reloading [was: Hooks for dynamic refreshing?]

2009-10-18 Thread Joe Groff
On Oct 18, 2009, at 2:55 PM, Ed Swartz wrote: BTW, before I delve too deeply, is the uniform variable functionality in gpu.render usable outside render-sets yet (or at all)? I notice the extras demos just directly use glUniform. I changed gpu.render around a bit so that there is a public

Re: [Factor-talk] LC53 encryption cracking

2009-10-18 Thread Jon Harper
Hi, Regarding style, there's a time word in tools.time that takes a quotation and runs it. It performs gc before calling the quotation and prints out the time and various stats about gc. You can also press CTRL+T in the ui listener to call it. It should remove the need to write words like

Re: [Factor-talk] LC53 encryption cracking

2009-10-18 Thread Slava Pestov
On Sun, Oct 18, 2009 at 10:01 PM, Jon Harper jon.harpe...@gmail.com wrote: Regarding performance, I just tried changing / to /f and /i but it doesn't help. If you don't need fractions you should not be using / with integers anyway. The word that calls / isn't actually invoked as part of the

Re: [Factor-talk] textures [was: gpu.shader reloading]

2009-10-18 Thread Ed Swartz
I changed gpu.render around a bit so that there is a public bind- uniforms word you can call to bind a uniform tuple to a program instance. You can use is as «my-program-instance my-uniform-tuple bind- uniforms» . Thanks! BTW, does that supplant the other form that also binds textures?

Re: [Factor-talk] textures [was: gpu.shader reloading]

2009-10-18 Thread Joe Groff
On Oct 18, 2009, at 10:37 PM, Ed Swartz wrote: Thanks! BTW, does that supplant the other form that also binds textures? Yeah. I renamed the old private words. Anyway, I'll need to look at this later -- I got most of the way toward using the earlier form (bind-uniform-textures +

[Factor-talk] Documentation for the peg.ebnf vocabulary

2009-10-18 Thread Chris Double
I've finally written some documentation for the peg.ebnf vocabulary. This documents the various ways of using it (EBNF:, [EBNF ... ENBF] and EBNF ... EBNF) as well as the syntax for the EBNF language. Let me know (or provide patches!) if I left anything out or if anything is badly written. You