Re: [Factor-talk] maybe{

2017-01-29 Thread Björn Lindqvist
2016-12-24 12:21 GMT+01:00 Alexander Ilin :
>   You see those `maybe{` words? What are they, I wondered, and looked up 
> their help. It was empty.

They are classoids! Don't try looking up the documentation for that,
it isn't there. :)

>   Yet it works exactly the way I wanted: it allows you to assign either the 
> specified type(s) or `f` to a slot.
>
>   That's a very useful feature, and it seems to be there for five years! But 
> why is it not described or even mentioned?

Maybe (hahah) because it is part of the class algebra system and it is
a complicated part of Factor. So no one has spent the time to
understand it fully and write documentation for it. It contains some
really cool features:

integer rational class<=
t
rational real class<=
t
integer real class<=
t

"The set of all integers is small than the set of all rationals which
in turn is smaller than the set of all real numbers." I agree it would
be useful with more documentation in this area.


-- 
mvh/best regards Björn Lindqvist

--
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] Startup time

2017-01-29 Thread petern
On 2017-01-29 16:20, John Benediktsson wrote:
> It would be nice to improve startup time. I imagine some low hanging
> fruits if we looked deeply into it. I'll make a note to get that on my
> list, unless someone looks into it sooner.
> 
> 
> 
>> On Jan 28, 2017, at 2:25 PM, pet...@riseup.net wrote:
>> 
>> I spend a lot of time writing small scripts, often in bash. That is
>> becoming a more and more painful task as bash is a nice-enough 
>> language
>> on the first look but in the end it seems to go out of it's way to 
>> trip
>> you up with every character you type. I don't mean to rant, I know 
>> it's
>> an old language that has to keep a lot of backward compatibility and 
>> it
>> actually still serves very well for what it was designed for, as long 
>> as
>> your script stays <100 lines. Still, there's a lot to be desired.
>> 
>> Factor is a cool language, it's very expressive, mature, has a lot of
>> libraries and has all sorts of tricks up its sleaves to bend it to 
>> your
>> will (much like lisp in that regard). It would be a fun experiment to
>> write a library or EDSL (embedded DSL) for bash-like scripting. 
>> However
>> there's a bone to be picked:
>> 
>> $ time bash -c ''
>> bash -c ''  0.00s user 0.00s system 94% cpu 0.004 total
>> 
>> $ time factor-vm -e=''
>> factor-vm -e=''  0.12s user 0.05s system 99% cpu 0.178 total
>> 
>> I know one can create a custom image and maybe cut down on the startup 
>> a
>> bit, but my question is - would it be possible to cut it down to 
>> bash's
>> startup time *and* still have all the necessary vocabularies in it? I
>> don't want to know the startup time with a small image that has like
>> nothing in it, I can quickly test that myself. I'd need help to answer 
>> -
>> if you imagine the use case I'm talking about, include all the vocabs
>> that use case would need and make all other possible optimizations (if
>> there are) without sacrificing too much, can the startup reach similar
>> times?
>> 
>> --
>> 
>>   Peter Nagy
>> 
>> 
>> --
>> 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

Hi John,

you think you can reach similar startup times? That would be really 
cool. I guess your todo list is rather long though.

As a side note, are there other concatenative languages you know I could 
look at?

-- 

   Peter Nagy


--
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] Startup time

2017-01-29 Thread John Benediktsson
It would be nice to improve startup time. I imagine some low hanging fruits if 
we looked deeply into it. I'll make a note to get that on my list, unless 
someone looks into it sooner. 



> On Jan 28, 2017, at 2:25 PM, pet...@riseup.net wrote:
> 
> I spend a lot of time writing small scripts, often in bash. That is 
> becoming a more and more painful task as bash is a nice-enough language 
> on the first look but in the end it seems to go out of it's way to trip 
> you up with every character you type. I don't mean to rant, I know it's 
> an old language that has to keep a lot of backward compatibility and it 
> actually still serves very well for what it was designed for, as long as 
> your script stays <100 lines. Still, there's a lot to be desired.
> 
> Factor is a cool language, it's very expressive, mature, has a lot of 
> libraries and has all sorts of tricks up its sleaves to bend it to your 
> will (much like lisp in that regard). It would be a fun experiment to 
> write a library or EDSL (embedded DSL) for bash-like scripting. However 
> there's a bone to be picked:
> 
> $ time bash -c ''
> bash -c ''  0.00s user 0.00s system 94% cpu 0.004 total
> 
> $ time factor-vm -e=''
> factor-vm -e=''  0.12s user 0.05s system 99% cpu 0.178 total
> 
> I know one can create a custom image and maybe cut down on the startup a 
> bit, but my question is - would it be possible to cut it down to bash's 
> startup time *and* still have all the necessary vocabularies in it? I 
> don't want to know the startup time with a small image that has like 
> nothing in it, I can quickly test that myself. I'd need help to answer - 
> if you imagine the use case I'm talking about, include all the vocabs 
> that use case would need and make all other possible optimizations (if 
> there are) without sacrificing too much, can the startup reach similar 
> times?
> 
> -- 
> 
>   Peter Nagy
> 
> 
> --
> 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] Updating factor

2017-01-29 Thread Jon Harper
Regarding unit tests, I think there was some cleanup recently and
everything is now done in the factor temp directory.

Le 29 janv. 2017 10:56, "Alexander Ilin"  a écrit :

> Hello, Tim!
>
> 29.01.2017, 12:35, "Timothy Hobbs" :
> > I tried to follow
> > http://docs.factorcode.org/content/article-first-program-start.html and
> >
> > "palindrome" scaffold-work
> >
> > Tries to write to the "factor-install-dir/work" directory. This failed,
> > because that directory was read only. Is work the only directory that
> > factor tries to write to? Can I change the path to the work directory?
>
>   First of all, there are other scaffold-* words, which will write to
> other respective directories. It is entirely up to you whether to use those
> words, or not. By calling those words you are explicitly asking Factor to
> create new files in its subfolders.
>
>   Second, I'm sure there are some unit-tests that would create temporary
> files. You don't have to run those, unless you make changes to the Factor
> itself (if you do, you need full write access anyway).
>
>   To have write permissions to the work folder, you could make it a
> symbolic link to a location that you prefer, like something in your home
> directory.
>
>   You could avoid using all of the above and create your own folder
> wherever you want, add it to the global .factor-roots file, and put your
> new vocabs in there instead of the work directory.
>
>   http://docs.factorcode.org/content/article-vocabs.roots.html
>   http://docs.factorcode.org/content/article-.factor-roots.html
>
>   Question: why was the work directory read-only? What OS are you on?
>
> ---=---
>  Александр
>
> 
> --
> 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] Updating factor

2017-01-29 Thread Timothy Hobbs
Hi,

I tried to package the factor IDE using Docker on linux. That's why the 
directory was read only. In order for me to be able to package the IDE 
successfully, I need to be able to get factor to work properly when its 
directory is read only.

Regards,

Tim


On 01/29/2017 10:55 AM, Alexander Ilin wrote:
> Hello, Tim!
>
> 29.01.2017, 12:35, "Timothy Hobbs" :
>> I tried to follow
>> http://docs.factorcode.org/content/article-first-program-start.html and
>>
>> "palindrome" scaffold-work
>>
>> Tries to write to the "factor-install-dir/work" directory. This failed,
>> because that directory was read only. Is work the only directory that
>> factor tries to write to? Can I change the path to the work directory?
>First of all, there are other scaffold-* words, which will write to other 
> respective directories. It is entirely up to you whether to use those words, 
> or not. By calling those words you are explicitly asking Factor to create new 
> files in its subfolders.
>
>Second, I'm sure there are some unit-tests that would create temporary 
> files. You don't have to run those, unless you make changes to the Factor 
> itself (if you do, you need full write access anyway).
>
>To have write permissions to the work folder, you could make it a symbolic 
> link to a location that you prefer, like something in your home directory.
>
>You could avoid using all of the above and create your own folder wherever 
> you want, add it to the global .factor-roots file, and put your new vocabs in 
> there instead of the work directory.
>
>http://docs.factorcode.org/content/article-vocabs.roots.html
>http://docs.factorcode.org/content/article-.factor-roots.html
>
>Question: why was the work directory read-only? What OS are you on?
>
> ---=---
>   Александр
>
> --
> 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] Updating factor

2017-01-29 Thread Alexander Ilin
Hello, Tim!

29.01.2017, 12:35, "Timothy Hobbs" :
> I tried to follow
> http://docs.factorcode.org/content/article-first-program-start.html and
>
> "palindrome" scaffold-work
>
> Tries to write to the "factor-install-dir/work" directory. This failed,
> because that directory was read only. Is work the only directory that
> factor tries to write to? Can I change the path to the work directory?

  First of all, there are other scaffold-* words, which will write to other 
respective directories. It is entirely up to you whether to use those words, or 
not. By calling those words you are explicitly asking Factor to create new 
files in its subfolders.

  Second, I'm sure there are some unit-tests that would create temporary files. 
You don't have to run those, unless you make changes to the Factor itself (if 
you do, you need full write access anyway).

  To have write permissions to the work folder, you could make it a symbolic 
link to a location that you prefer, like something in your home directory.

  You could avoid using all of the above and create your own folder wherever 
you want, add it to the global .factor-roots file, and put your new vocabs in 
there instead of the work directory.

  http://docs.factorcode.org/content/article-vocabs.roots.html
  http://docs.factorcode.org/content/article-.factor-roots.html

  Question: why was the work directory read-only? What OS are you on?

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

--
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