Recently in factor Category

Running a Factor Script

| | Comments (0) | TrackBacks (0)
For those who are put off by the interactive UI part of Factor, you can run a script from the command-line like so

#! /Users/leto/git/factor/factor  -script

USING: gsl gsl.sf.result gsl.sf.bessel gsl.sf.log kernel tools.test ;

"gsl.sf" test

Note the space after the ! is necessary because every "word" in Factor must be separated by a space. The practice of running factor as a non-interactive script is not encouraged, but in certain  situations it wins the day. The above script could be factored to take an argument of a subsystem to test and then I would make a key-binding in vim (or emacs or whatever) so that when I am editing a file and I type ,t it shows me the results of that subsystems tests.

All of this stuff can be done in the interactive UI, but I think people will fiddle with Factor more  if they can easily bolt it onto their current workflow. People tend not to even try things that require totally changing their current tool chain. For me, I am editing the source of the GSL bindings in VIM, so having that script is invaluable. I hack on the source and whenever I change anything important I run the tests by hitting 2 keys. It is really important to make running and writing tests as easy as possible, or they won't get written at all. 

Today ...... is a good day to hack.

New Factor Git repo

| | Comments (0) | TrackBacks (0)
You can view my new factor repo's gitweb. Or you can clone my repo with

git clone

This should start getting pulled upstream into the main factor repo sometime soon.

The GSL bindings are now in "extra/gsl", which is the extra.gsl namespace in Factor. I have bindings to all of GSL's special functions, I am currently working on documenting the Bessel functions and writing tests for the functions which take/return gsl_sf_result structures. If you would like to see another subsystem, just ask and I will let you know if it is doable. There are almost 50 subsystems, so if you want to help: clone, hack, commit and push!

Bessel Functions in Factor

| | Comments (0) | TrackBacks (0)
View Screenshot

Click on the link above to see a screenshot of how to make plots of functions in Factor. I am showing off the Regular Bessel function J0(x) which is called gsl_sf_bessel_J0 in GSL. In the background I also have the source of the documentation.

About this Archive

This page is a archive of recent entries in the factor category.

crapware is the previous category.

git is the next category.

Find recent content on the main index or look in the archives to find all content.

Clicky Web Analytics Screw you, spammers! 42