Re: [Factor-talk] : (

2017-05-31 Thread fede s
I've seen those glitches in the Factor UI, Factor 64 bits build, Win7 64.Sorry 
I never reported, I was hoping to find a way to reproduce it.They seem to 
happen after having some errors in the code I'm working on. I suspect of memory 
leaks, I'm not sure.If you suspect of something, I think I could do some 
testing this weekend maybe, or some time soon. 

El Miércoles, 31 de mayo, 2017 22:54:24, John Benediktsson 
 escribió:
 

 I'm sorry to hear that. I don't see any of those issues on any of the three 
platforms. But I mostly use 64-bit. It is possible to have an issue with the 
32-bit version, possibly a library issue maybe where we define a struct wrong 
for 32-bit? I doubt we have major issues with the GC. 

> On May 31, 2017, at 5:55 PM, Alexander Ilin  wrote:
> 
> Hello!
> 
>  Factor crashed twice today. Both times when I was doing this code (with 
>different strings in the middle):
> 
> ! Delete a path (subtree) from the DB.
> "C:/Path/To/table.db" [
>    resource-path new select-tuples
>    [ path>> "/Some/Path/Prefix/" head? ] filter
>    [ [ delete-tuples ] each ] with-transaction
> ] with-sqlite-db
> 
>  It was a hard crash, too, with a Windows "close or debug" dialog, not with a 
>Factor interruption console.
> 
>  Each time after the restart the same identical code (copied and pasted into 
>the listener) ran perfectly.
> 
>  At the time of the second crash I looked at the memory consumption by the 
>Factor.exe (I'm on Win7x64) was slightly above 500Mb.
> 
>  The build is a fairly recent one: Factor 0.98 x86.32 (1826, 
>heads/master-c1d6477c22, Fri May 12 08:27:43 2017)
> 
>  And I have seen those visual glitches again a few times. You know, those I 
>showed you via youtube some time ago, where some pieces of text seem to get 
>mixed around, so that the listener's toolbar displays the wrong labels, as 
>well as the listener's main window. It seemed like the oldest strings were the 
>most prone to corruption (or substitution), e.g. the "--- Data stack:" string 
>or the "}" string in the prettyprinter.
> 
>  I seriously suspect we have issues with our garbage collector, or memory 
>management in general.
>  At least on Windows.
> 
> https://www.youtube.com/watch?v=wtpF0my_YfE
> 
> ---=--- 
> Александр
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


   --
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] How to introduce factor to java programmers?

2017-05-31 Thread John Benediktsson
Well, technically neither ``dip`` nor ``keep`` need those stack effects,
they are inlined which means the non-inline word that includes them will
have it's stack effect checked by the compiler for correctness.

There are few reasons why we want to have the ".." variadic stack effects,
and those are useful in the stack-checker and visually for documentation,
but if you removed them and tried to compile a word that was incorrect, it
would give you a worse error message but still give you an error.



On Wed, May 31, 2017 at 7:03 PM, Sankaranarayanan Viswanathan <
rationalrev...@gmail.com> wrote:

> Thanks for the ideas John!
>
> I have been looking at the collection of talks, and they've been quite
> helpful. Your thoughts about discussing "Java like" things makes a lot of
> sense and I think contrasting Factor's object system with Java's should be
> a nice topic.
>
> That said, I did run into a question preparing the slides related to
> stack-effects. I noticed that some combinators do not specify stack effects
> for quotation inputs.
>
> e.g.
> dip  ( x quot -- x )
> keep ( ..a x quot: ( ..a x -- ..b ) -- ..b x )
>
> Why does `dip` not need to specify the quotations stack effect, but `keep`
> did? I suspect they also have something to do with the inline word, but I'm
> not really sure. Could you explain?
>
> Thanks,
> Sankar
>
>
>
> On 5/30/17 11:47 PM, John Benediktsson wrote:
>
>> We have a few "talks" that were given a number of years ago (not all
>> code in them is up to date, but it's mostly good -- if you have problems
>> updating the code let me know and I can help):
>>
>> https://github.com/factor/factor/tree/master/extra/talks
>>
>> https://github.com/slavapestov/boston-lisp-talk
>>
>> https://github.com/slavapestov/emerging-langs-talk
>>
>> You might find it interesting to discuss "Java-like" things, for
>> example, interfaces vs protocols:
>>
>> public interface Foo {
>> String a();
>> int b();
>> }
>>
>>public class FooImpl {
>> public String a() { return "hello" } ;
>> public int b() { return 42 } ;
>> }
>>
>> vs a protocol (two generic methods) and a concrete class that implements
>> it...
>>
>> GENERIC: a ( obj -- a )
>> GENERIC: b ( obj -- a )
>>
>> TUPLE: foo ;
>> M: foo a "hello" ;
>> M: foo b 42 ;
>>
>> Could also talk about ``SINGLETON:``, so instead of (plus or minus
>> thread safety):
>>
>> public class Foo {
>> private static _instance = null;
>> public static Foo getInstance() {
>> if ( _instance == null ) { _instance = new Foo() };
>> return _instance;
>> }
>> }
>>
>> vs.
>>
>> SINGLETON: foo
>>
>> So, touching on code generation and higher level concepts.
>>
>> Maybe macros might be interesting?
>>
>> Some other ideas from my blog, not sure of your audience's interest:
>>
>> https://re-factor.blogspot.com/2009/08/calculating-with-ebnf.html
>>
>> https://re-factor.blogspot.com/2010/11/estimating-cpu-speed.html
>>
>> https://re-factor.blogspot.com/2011/02/simple-rpg.html
>>
>> https://re-factor.blogspot.com/2011/04/powers-of-2.html
>>
>> https://re-factor.blogspot.com/2011/04/mail-with-gui.html
>>
>> https://re-factor.blogspot.com/2011/07/concatenative-thinking.html
>>
>> https://re-factor.blogspot.com/2011/07/one-liners.html
>>
>> https://re-factor.blogspot.com/2011/08/printf.html
>>
>> https://re-factor.blogspot.com/2012/02/readability.html
>>
>> https://re-factor.blogspot.com/2012/08/literate-programming.html
>>
>> https://re-factor.blogspot.com/2013/10/rock-paper-scissors.html
>>
>> https://re-factor.blogspot.com/2015/06/send-more-money.html
>>
>> https://re-factor.blogspot.com/2017/02/711.html
>>
>> Best,
>> John.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Tue, May 30, 2017 at 8:14 PM, Sankaranarayanan Viswanathan
>> > > wrote:
>>
>> Hi Guys,
>>
>> We have a developer community at where I work, and we do monthly
>> tech talks that usually last between 30 and 40 minutes. I presume
>> very few in that group have looked at stack based languages before,
>> and I've been wanting to do a small talk about Factor there.
>>
>> After spending a week preparing slides, I'm having a bit of trouble
>> understanding what would be a meaningful scope for my talk. I really
>> want to touch upon a couple of aspects:
>>  - show what stack based code looks like (i.e. avoid naming
>> variables most of the time)
>>  - show that all syntax is just words, and that syntax is extensible
>>  - show a little of the help system
>>  - show a bit of the interactive development workflow (change,
>> refresh, test)
>>
>> But, I'm suspecting before I even get here I might need to spend a
>> lot of time talking about stack-effects, combinators, and other
>> basics before they might get a feel for what 

Re: [Factor-talk] How to introduce factor to java programmers?

2017-05-31 Thread Sankaranarayanan Viswanathan

Thanks for the ideas John!

I have been looking at the collection of talks, and they've been quite 
helpful. Your thoughts about discussing "Java like" things makes a lot 
of sense and I think contrasting Factor's object system with Java's 
should be a nice topic.


That said, I did run into a question preparing the slides related to 
stack-effects. I noticed that some combinators do not specify stack 
effects for quotation inputs.


e.g.
dip  ( x quot -- x )
keep ( ..a x quot: ( ..a x -- ..b ) -- ..b x )

Why does `dip` not need to specify the quotations stack effect, but 
`keep` did? I suspect they also have something to do with the inline 
word, but I'm not really sure. Could you explain?


Thanks,
Sankar


On 5/30/17 11:47 PM, John Benediktsson wrote:

We have a few "talks" that were given a number of years ago (not all
code in them is up to date, but it's mostly good -- if you have problems
updating the code let me know and I can help):

https://github.com/factor/factor/tree/master/extra/talks

https://github.com/slavapestov/boston-lisp-talk

https://github.com/slavapestov/emerging-langs-talk

You might find it interesting to discuss "Java-like" things, for
example, interfaces vs protocols:

public interface Foo {
String a();
int b();
}

   public class FooImpl {
public String a() { return "hello" } ;
public int b() { return 42 } ;
}

vs a protocol (two generic methods) and a concrete class that implements
it...

GENERIC: a ( obj -- a )
GENERIC: b ( obj -- a )

TUPLE: foo ;
M: foo a "hello" ;
M: foo b 42 ;

Could also talk about ``SINGLETON:``, so instead of (plus or minus
thread safety):

public class Foo {
private static _instance = null;
public static Foo getInstance() {
if ( _instance == null ) { _instance = new Foo() };
return _instance;
}
}

vs.

SINGLETON: foo

So, touching on code generation and higher level concepts.

Maybe macros might be interesting?

Some other ideas from my blog, not sure of your audience's interest:

https://re-factor.blogspot.com/2009/08/calculating-with-ebnf.html

https://re-factor.blogspot.com/2010/11/estimating-cpu-speed.html

https://re-factor.blogspot.com/2011/02/simple-rpg.html

https://re-factor.blogspot.com/2011/04/powers-of-2.html

https://re-factor.blogspot.com/2011/04/mail-with-gui.html

https://re-factor.blogspot.com/2011/07/concatenative-thinking.html

https://re-factor.blogspot.com/2011/07/one-liners.html

https://re-factor.blogspot.com/2011/08/printf.html

https://re-factor.blogspot.com/2012/02/readability.html

https://re-factor.blogspot.com/2012/08/literate-programming.html

https://re-factor.blogspot.com/2013/10/rock-paper-scissors.html

https://re-factor.blogspot.com/2015/06/send-more-money.html

https://re-factor.blogspot.com/2017/02/711.html

Best,
John.











On Tue, May 30, 2017 at 8:14 PM, Sankaranarayanan Viswanathan
> wrote:

Hi Guys,

We have a developer community at where I work, and we do monthly
tech talks that usually last between 30 and 40 minutes. I presume
very few in that group have looked at stack based languages before,
and I've been wanting to do a small talk about Factor there.

After spending a week preparing slides, I'm having a bit of trouble
understanding what would be a meaningful scope for my talk. I really
want to touch upon a couple of aspects:
 - show what stack based code looks like (i.e. avoid naming
variables most of the time)
 - show that all syntax is just words, and that syntax is extensible
 - show a little of the help system
 - show a bit of the interactive development workflow (change,
refresh, test)

But, I'm suspecting before I even get here I might need to spend a
lot of time talking about stack-effects, combinators, and other
basics before they might get a feel for what factor code feels like.
And this I'm afraid might be a little too much to digest in a short
time. Words like dip, bi@ and sequence combinators like map seem
fundamental to work with factor, and I'm afraid a short presentation
might not be the best place to introduce these topics. But, without
them code examples are going to be hard to understand.

Any ideas?

Thanks,
Sankar



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/factor-talk






Re: [Factor-talk] : (

2017-05-31 Thread John Benediktsson
I'm sorry to hear that. I don't see any of those issues on any of the three 
platforms. But I mostly use 64-bit. It is possible to have an issue with the 
32-bit version, possibly a library issue maybe where we define a struct wrong 
for 32-bit? I doubt we have major issues with the GC. 

> On May 31, 2017, at 5:55 PM, Alexander Ilin  wrote:
> 
> Hello!
> 
>  Factor crashed twice today. Both times when I was doing this code (with 
> different strings in the middle):
> 
> ! Delete a path (subtree) from the DB.
> "C:/Path/To/table.db" [
>resource-path new select-tuples
>[ path>> "/Some/Path/Prefix/" head? ] filter
>[ [ delete-tuples ] each ] with-transaction
> ] with-sqlite-db
> 
>  It was a hard crash, too, with a Windows "close or debug" dialog, not with a 
> Factor interruption console.
> 
>  Each time after the restart the same identical code (copied and pasted into 
> the listener) ran perfectly.
> 
>  At the time of the second crash I looked at the memory consumption by the 
> Factor.exe (I'm on Win7x64) was slightly above 500Mb.
> 
>  The build is a fairly recent one: Factor 0.98 x86.32 (1826, 
> heads/master-c1d6477c22, Fri May 12 08:27:43 2017)
> 
>  And I have seen those visual glitches again a few times. You know, those I 
> showed you via youtube some time ago, where some pieces of text seem to get 
> mixed around, so that the listener's toolbar displays the wrong labels, as 
> well as the listener's main window. It seemed like the oldest strings were 
> the most prone to corruption (or substitution), e.g. the "--- Data stack:" 
> string or the "}" string in the prettyprinter.
> 
>  I seriously suspect we have issues with our garbage collector, or memory 
> management in general.
>  At least on Windows.
> 
> https://www.youtube.com/watch?v=wtpF0my_YfE
> 
> ---=--- 
> Александр
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] : (

2017-05-31 Thread Alexander Ilin
Hello!

  Factor crashed twice today. Both times when I was doing this code (with 
different strings in the middle):

! Delete a path (subtree) from the DB.
"C:/Path/To/table.db" [
resource-path new select-tuples
[ path>> "/Some/Path/Prefix/" head? ] filter
[ [ delete-tuples ] each ] with-transaction
] with-sqlite-db

  It was a hard crash, too, with a Windows "close or debug" dialog, not with a 
Factor interruption console.

  Each time after the restart the same identical code (copied and pasted into 
the listener) ran perfectly.

  At the time of the second crash I looked at the memory consumption by the 
Factor.exe (I'm on Win7x64) was slightly above 500Mb.

  The build is a fairly recent one: Factor 0.98 x86.32 (1826, 
heads/master-c1d6477c22, Fri May 12 08:27:43 2017)

  And I have seen those visual glitches again a few times. You know, those I 
showed you via youtube some time ago, where some pieces of text seem to get 
mixed around, so that the listener's toolbar displays the wrong labels, as well 
as the listener's main window. It seemed like the oldest strings were the most 
prone to corruption (or substitution), e.g. the "--- Data stack:" string or the 
"}" string in the prettyprinter.

  I seriously suspect we have issues with our garbage collector, or memory 
management in general.
  At least on Windows.

https://www.youtube.com/watch?v=wtpF0my_YfE

---=--- 
 Александр

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk