Re: [Factor-talk] Fwd: how to error trapping 'link-info'

2015-10-01 Thread John Benediktsson
The equivalent would be: [ link-info dup symbolic-link? [ drop ] [ size>> + ] if ] [ drop ] recover On Thu, Oct 1, 2015 at 6:54 AM, HP wei wrote: > Just want to elaborate on what I meant by 'error trapping' link-info. > > [ link-info dup symbolic-link? [ drop ] [ size>> + ] > > In pytho

Re: [Factor-talk] remote listener over tcp

2015-10-01 Thread John Benediktsson
We have support for that in our FUEL package for emacs. Probably it could be factored (ahem) out, but this is how you can do it, starting on port 9000: IN: scratchpad USE: fuel.remote IN: scratchpad 9000 fuel-start-remote-listener Then somewhere else: $ telnet machine 9000 On Thu,

Re: [Factor-talk] A bug ?

2015-09-30 Thread John Benediktsson
I mentioned before that it's not too hard to make an iterative using dirent, especially if you just call it directly yourself. You can see how it works by doing: IN: scratchpad \ (directory-entries) see Nothing technical prevents it, only that right now the iteration is hidden behind that

Re: [Factor-talk] to get total file size for millions of files

2015-09-28 Thread John Benediktsson
Answers below: (1) the word: each-file ( path bfs? quot -- ) > Does it handle a file successively by quot without first gathering all > the file-paths in the path ? > It has a queue of paths to process, for each directory it pushes all the paths into the queue, and then for each one it

Re: [Factor-talk] Create a Collection of Tuples

2015-09-23 Thread John Benediktsson
rs }. > > I now see there is >tuple, which could be equally useful. > > Thank you, John! > > 23.09.2015, 18:29, "John Benediktsson" : > > You can use slots>tuple. > > > > TUPLE: em id name path ; > > C: em > > > > : make-em-all

Re: [Factor-talk] Create a Collection of Tuples

2015-09-23 Thread John Benediktsson
You can use slots>tuple. TUPLE: em id name path ; C: em : make-em-all ( -- seq ) { { 1 "x" "path" } { 2 "y" "math" } { 3 "z" "bath" } } [ em slots>tuple ] map ; IN: scratchpad make-em-all . { T{ em { id 1 } { name "x" } { path "path" } } T{ em { id 2 } { name "y" } { pa

Re: [Factor-talk] v0.98

2015-09-22 Thread John Benediktsson
stone. Soon we will have to decide if 1.0 or 0.100 is the next release, hah! Best, John. On Tue, Sep 22, 2015 at 8:52 AM, Alexander Ilin wrote: > Hi! > > 22.09.2015, 18:47, "John Benediktsson" : > > We were debating how much to include in 0.98. > > > > Everyt

Re: [Factor-talk] v0.98

2015-09-22 Thread John Benediktsson
We were debating how much to include in 0.98. Everything that's been committed since 0.97 (see the nightly builds) will be in 0.98 and our plan right now is to fix bugs and cleanup in preparation for a release in a week or two. If you have something to contribute, or bugs we should make sure

Re: [Factor-talk] SHA-256

2015-09-21 Thread John Benediktsson
I don't know what version of Factor you are using, but I made a couple improvements improvements to sha checksums over the last year or two. I can hash a 17 mb file in 4.5 seconds on my laptop: IN: scratchpad "~/testfile" file-info size>> . 17825792 IN: scratchpad gc [ "~/testfile" s

Re: [Factor-talk] stream-read

2015-09-21 Thread John Benediktsson
You can just use read (or stream-read) which returns less bytes if the file is smaller: http://docs.factorcode.org/content/word-read,io.html So this does what you want: "/path/to/file" utf8 [ 1024 read ] with-file-reader The stream-read-partial is used for some performance improvements

Re: [Factor-talk] Why is an empty paragraph not writable by gadget. ?

2015-09-20 Thread John Benediktsson
ldren. On Sun, Sep 20, 2015 at 9:42 AM, John Benediktsson wrote: > Looks like wrap-words doesn't work with an empty sequence. > > And if you "fix" that, paragraphs don't work because they can't calculate > their dimensions from an empty list of children. > >

Re: [Factor-talk] Why is an empty paragraph not writable by gadget. ?

2015-09-20 Thread John Benediktsson
Looks like wrap-words doesn't work with an empty sequence. And if you "fix" that, paragraphs don't work because they can't calculate their dimensions from an empty list of children. So, perhaps two bugs to fix. On Sun, Sep 20, 2015 at 4:08 AM, Georg Simon wrote: > IN: scratchpad 500 add

Re: [Factor-talk] string word wrapping in gadgets

2015-09-18 Thread John Benediktsson
string add-gadget ] interleave > > > Am Fri, 18 Sep 2015 09:54:25 -0700 > schrieb John Benediktsson : > > > Labels support printing multiple lines of text, but they don't > > relayout and word-wrap. > > > > Paragraphs are used by the ui.gadgets.panes for thi

Re: [Factor-talk] directory-files question

2015-09-18 Thread John Benediktsson
subdirectories are files of type directory. "regular files" are files of type regular file. you can filter for regular-files if you want. : directory-regular-files ( -- files ) directory-entries [ regular-file? ] filter [ name>> ] map ; Most languages do this, for example python in

Re: [Factor-talk] string word wrapping in gadgets

2015-09-18 Thread John Benediktsson
Labels support printing multiple lines of text, but they don't relayout and word-wrap. Paragraphs are used by the ui.gadgets.panes for this, and basically the way they work is you can add any gadget (but in this case a label-per-word) to them and "word break gadgets" to represent the whitespace, s

Re: [Factor-talk] Graphviz

2015-09-17 Thread John Benediktsson
Hi Alexander, Vocabularies can have a platforms.txt file that has a list of OS that it supports. If the platforms.txt file is not specified, we assume it runs everywhere. The "graphviz" vocabulary is probably the one you want and does work on Windows and does not specify a platforms.txt. It

Re: [Factor-talk] cartesian-glue Was: Is it possible to post screenshots?

2015-09-16 Thread John Benediktsson
worthy contribution? > > ! Outputs a new sequence with str inserted between all combinations of > ! elements from seq1 and seq2. > : cartesian-glue ( seq1 seq2 str -- seq ) > [ glue ] curry cartesian-map concat ; > > > 16.09.2015, 18:37, "John Benediktsson" : >

Re: [Factor-talk] Is it possible to post screenshots?

2015-09-16 Thread John Benediktsson
I'm not sure - give it a try and if it doesn't maybe use imgur.com or another image hosting website and just include a link to it? On Wed, Sep 16, 2015 at 8:33 AM, Alexander Ilin wrote: > Hello! > > Does this list accept screenshot attachments? > > ---=--- > Александр > > > --

Re: [Factor-talk] flat mapping

2015-09-16 Thread John Benediktsson
to learn. > > Thank you for this lesson, master. : ) > > Also, performance measurements show that "map concat" is about 10% > faster than "map-flat". > > 16.09.2015, 17:59, "John Benediktsson" : > > I think map concat is a simpler approa

Re: [Factor-talk] flat mapping

2015-09-16 Thread John Benediktsson
quot; "VT" "SS" } [ 64 > idx ] map-flat ; > > What I need is a list of strings containing > "LL[00]" > "LL[01]" > "LL[02]" > ... > "LL[63]" > "DL[00]" > "DL[01]" > ...

Re: [Factor-talk] file-readable?

2015-09-16 Thread John Benediktsson
ent: > > "C:\\boot.ini" file-readable? . > -> t > "C:\\boot.ini" sha-256 checksum-file hex-string . > -> Exception "Access is denied." > > Being a non-root user in Windows, I have no permission to read > C:\boot.ini, but file-read

Re: [Factor-talk] flat mapping

2015-09-16 Thread John Benediktsson
Hi Alexander, I'm not quite clear what functionality you are looking for, could you provide a quick example? Also, compiler.utilities isn't really a very public vocabulary so those things might change or move around depending on what the compiler needs are. Thanks, John. On Wed, Sep 16, 2015 a

Re: [Factor-talk] Recursive File Traversal

2015-09-15 Thread John Benediktsson
Not a lazy one, nor a virtual one, but we have a directory-iterator in io.directories.search vocabulary that supports breadth-first or depth-first recursive traversal. It is used to get all-files-by-depth or all-files-by-breadth as a sequence, act on each-file-breadth or each-file-depth, or filter

Re: [Factor-talk] Recursion

2015-09-15 Thread John Benediktsson
If you look at the disassembly, you can see it jumps back within the method, not using up stack: IN: scratchpad \ numbers-game-loop disassemble 00010fba0a10: 8905ea251aff mov [rip-0xe5da16], eax 00010fba0a16: 53push rbx 00010fba0a17: e90600jmp 0x10fba0a22 (numbers-

Re: [Factor-talk] Factor in .Net

2015-09-15 Thread John Benediktsson
No, but there are a number of concatenative languages that target the CLR. Aside from using .NET stuff, I'm not sure if any are as mature as Factor. On Tue, Sep 15, 2015 at 6:48 AM, Alexander Ilin wrote: > Hello! > > I've heard that .Net supports functional languages. > Is Factor available i

Re: [Factor-talk] PRIMITIVE:

2015-09-15 Thread John Benediktsson
paper on the Factor architecture you could > refer me to? > > 15.09.2015, 12:49, "John Benediktsson" : >> Hi Alexander, >> >> The "primitive registration system" is a little more involved than >> PRIMITIVE: but we defined that as syntax

Re: [Factor-talk] Saving the definitions in the scratchpad vocabulary

2015-09-15 Thread John Benediktsson
Hi Joan, That looks handy. The "scratchpad" vocabulary is persisted in the image, so if you ``save``, then exit and restart Factor, all the words you had defined will be available. Your technique looks fine, only thing I might add is a newline for spacing between definitions and maybe sort them

Re: [Factor-talk] PRIMITIVE:

2015-09-15 Thread John Benediktsson
Hi Alexander, The "primitive registration system" is a little more involved than PRIMITIVE: but we defined that as syntax so we could grep and keep track of our primitives better and as a placeholder for some future cleanup. When you make a new "primitive", it needs several things including this

Re: [Factor-talk] Why does editor pass some handled gestures?

2015-08-18 Thread John Benediktsson
If you look at the docs for handle-gesture, it says "Outputs f if the gesture was handled, and t if the gesture should be passed on to the gadget's parent.". http://docs.factorcode.org/content/word-handle-gesture,ui.gestures.html I would guess it's because your editor is wrapped by a main-gad

Re: [Factor-talk] gcc versions

2015-08-14 Thread John Benediktsson
Are we using too-bleeding-edge C++ features? Is the suggestion maybe we scale down to some subset compilers have had working for 3-4 years? > On Aug 14, 2015, at 10:51 AM, Jon Harper wrote: > > Well that's GCC 4.7.2 September 20, 2012 > Gcc did fix this in GCC 4.7.3 April 11, 2013 > > Also,

Re: [Factor-talk] Why does number>string append ".0" on my German system ?

2015-08-14 Thread John Benediktsson
pare-var-args ( -- ) RAX RAX XOR ; > > +M: x86.64 %prepare-var-args ( -- ) RAX 1 MOV ; > > I don't know how hard it would be to generate the correct value for > > RAX for variable arguments. > > Also, I'm not sure if it works better for other ABI/platforms. &g

Re: [Factor-talk] Why does number>string append ".0" on my German system ?

2015-08-13 Thread John Benediktsson
orks better for other ABI/platforms. > > Do you think that's something worth investigating ? > > > Jon > > On Wed, Aug 12, 2015 at 7:10 AM, Georg Simon wrote: > >> Am Tue, 11 Aug 2015 09:02:33 -0700 >> schrieb John Benediktsson : >> >> Thank you

Re: [Factor-talk] Why does number>string append ".0" on my German system ?

2015-08-11 Thread John Benediktsson
(I left a "B" breakpoint in the code below, so unless you like seeing the process arguments each time, you might want do remove the "B") > On Aug 11, 2015, at 9:02 AM, John Benediktsson wrote: > > Properly supporting locales, even in a small way, would be a good th

Re: [Factor-talk] Why does number>string append ".0" on my German system ?

2015-08-11 Thread John Benediktsson
Properly supporting locales, even in a small way, would be a good thing to add. Factor is currently locale-independent, partly because of a desire for homoiconicity, and partly because it prevents things like tests that break depending on the system locale[1]. We have discussed adding a locale vo

Re: [Factor-talk] Documentation for narray, nsequence, firstn, and set-firstn

2015-08-06 Thread John Benediktsson
Hi Georg, If you run it, you'll see it produces the result you would expect: IN: scratchpad 1 2 3 4 4 narray . { 1 2 3 4 } The reason it "produces a quot" is that it is implemented as a macro that generates a quotation to do the work (in this case with a stack effect consuming 4 item

Re: [Factor-talk] Timers & Deployed Apps

2015-07-26 Thread John Benediktsson
Your ``[ t ] loop`` is a busy loop that will suck 100% CPU. The problem you have is that a timer starts a new thread, and you want to wait forever just sleep the main thread? start-looping-timer 1 year sleep I'm not sure if we have a way to wait for an existing thread to exit, but if we did,

Re: [Factor-talk] Factor-talk Digest, Vol 109, Issue 8

2015-07-13 Thread John Benediktsson
These mean the same thing: : add-quot ( n -- quot ) '[ _ + ] ; : add-quot ( n -- quot ) [ + ] curry ; :: add-quot ( n -- quot ) [ n + ] ; They are basically different ways of currying the 'n' argument into the quotation that is produced by ``add-quot``. Best, John. On Sun, Jul 12, 2015 at 6:4

Re: [Factor-talk] Factor-talk Digest, Vol 109, Issue 6

2015-07-12 Thread John Benediktsson
ing, please edit your Subject line so it is more specific > than "Re: Contents of Factor-talk digest..." > > > Today's Topics: > > 1. What do we call a collection of vocabs? (Bj?rn Lindqvist) &g

Re: [Factor-talk] Syntax Highlight in Atom

2015-07-10 Thread John Benediktsson
There was a syntax error that I had to fix[1], but now you can use Factor's textmate bundle for syntax highlighting in Atom (requires my latest patch to be applied). $ mkdir ~/.atom/packages $ apm init --package ~/.atom/packages/language-factor --convert /path/to/factor/misc/Factor.tmbundle That

Re: [Factor-talk] What do we call a collection of vocabs?

2015-07-09 Thread John Benediktsson
The only names we have right now are "vocab-root" (vocabularies that share a common file directory they are loaded from) or "dictionary" (mapping of vocabulary names to vocabularies). I think "package" would be the best name probably, and we have had some ideas in the past on working on a module s

Re: [Factor-talk] FreeBSD 10 amd64 supported?

2015-07-09 Thread John Benediktsson
, bsd and others. So you would only have code for one api (libuv) > than for each os. > > 2015-07-09 16:49 GMT+02:00 John Benediktsson : > > We used to have BSD support but it wasn't easy to maintain for each of > > FreeBSD, OpenBSD, and NetBSD, and it seemed no one us

Re: [Factor-talk] FreeBSD 10 amd64 supported?

2015-07-09 Thread John Benediktsson
We used to have BSD support but it wasn't easy to maintain for each of FreeBSD, OpenBSD, and NetBSD, and it seemed no one used it, so it was removed awhile back: https://github.com/slavapestov/factor/commit/8cf18d1a82f08d1e9edf20f38b42eb1699ca0e67 Perhaps that commit can give you a rough idea o

Re: [Factor-talk] Compile error in tf-idf vocab after upgrade

2015-07-08 Thread John Benediktsson
Hi cw, Thanks for letting me know, I forgot to update it. Just now pushed a fix if you want to update to latest re-factor: https://github.com/mrjbq7/re-factor/commit/d3a33c1dde3574db700392701a273c9ab80b7273 Maybe tf-idf would be a good candidate vocab to move to factor/extra. Best, John. O

Re: [Factor-talk] Factor-talk Digest, Vol 109, Issue 1

2015-07-05 Thread John Benediktsson
I'm not sure what you mean, but I assume something like this: :: foo ( seq -- seq' ) 1 :> temp seq [ temp + ] map ; IN: scratchpad { 1 3 5 } foo . { 2 4 6 } Yes, that works. If thats not what you meant, can you clarify? On Fri, Jul 3, 2015 at 3:58 PM, Hugh Aguilar

Re: [Factor-talk] displaying Lisp like nested lists

2015-06-29 Thread John Benediktsson
I think you need one more "cons" at the end, but list>array should work fine recursively. On Mon, Jun 29, 2015 at 5:37 AM, Iain Gray wrote: > I make a list with > > 1 nil cons 2 nil cons nil cons nil cons > > but list>array displays only top level, can it descend recursively? > > > ---

Re: [Factor-talk] the FMITE processor

2015-06-23 Thread John Benediktsson
Hi Hugh, Looks interesting, skimmed your link a bit and bookmarked for when I have some more time. The more the merrier! Best, John. On Tue, Jun 23, 2015 at 1:37 PM, Hugh Aguilar wrote: > I designed the FMITE processor that could be built into an FPGA. It is > designed to have compact machine

Re: [Factor-talk] editting scaffold tests

2015-06-07 Thread John Benediktsson
Try: "my-trig" edit-tests Also, if you want to make documentation, we have: "my-trig" edit-docs Keep in mind that once you start writing words in your vocabulary, you can edit them directly (jumping the cursor to the line number where the definition starts). For example, if "foo" is a

Re: [Factor-talk] .factor-rc initialisatio

2015-06-05 Thread John Benediktsson
Are there any errors logged? Typically these would show up in the error window if using the UI, or be visible at the prompt in the command line. You may need to add this for set-global to be found: USE: namespaces > On Jun 5, 2015, at 10:05 AM, Iain Gray wrote: > > My .factor-rc contai

Re: [Factor-talk] osx emacs FUEL

2015-06-04 Thread John Benediktsson
Excellent! Glad it's working. Based on your feedback I made a patch that tries to find emacsclient in your path, so some installations will work out of the box. For Emacs.app, you will still have to set it manually. We love newcomers and it's great to get a fresh perspective. Sometimes things

Re: [Factor-talk] osx emacs FUEL

2015-06-02 Thread John Benediktsson
; "+1" > "/Applications/Languages/factor/core/io/io.factor" > } > } > { detached t } > { environment H{ } } > { environment-mode +append-environment+ } > { group +same-group+ } > { status 255 } > > and

Re: [Factor-talk] osx emacs FUEL

2015-06-02 Thread John Benediktsson
Factor. On Tue, Jun 2, 2015 at 7:46 AM, Iain Gray wrote: > that works if I do > > $ cd /Applications/Languages/factor > > I feel very close! > > On 2 Jun 2015, at 14:32, John Benediktsson wrote: > > I'm sorry its not working, are you sure you have an emacs s

Re: [Factor-talk] osx emacs FUEL

2015-06-02 Thread John Benediktsson
{ > "emacsclient" > "--no-wait" > "+1" > "/Applications/Languages/factor/core/io/io.factor" > } > } > { detached t } > { environment H{ } } > { environment-mode +append-envi

Re: [Factor-talk] osx emacs FUEL

2015-06-01 Thread John Benediktsson
/Emacs.app $ find . | grep emacsclient ./Contents/MacOS/bin-i386-10_5/emacsclient ./Contents/MacOS/bin-powerpc-10_4/emacsclient ./Contents/MacOS/bin-x86_64-10_5/emacsclient ./Contents/MacOS/bin-x86_64-10_7/emacsclient ./Contents/MacOS/bin-x86_64-10_9/emacsclient On Mon, Jun 1, 2015 at 8:0

Re: [Factor-talk] osx emacs FUEL

2015-06-01 Thread John Benediktsson
The .factor-boot-rc is used during bootstrap, but if you just download and use a release, you might want to put that code in .factor-rc which is run each time Factor starts. Also, I'm a bit confused -- your examples uses "emacspath" but the documentation for editors.emacs says to set the path to e

Re: [Factor-talk] Recent planet-factor articles on MIDI

2015-04-28 Thread John Benediktsson
Hi Harold, It would be nice to have some sound manipulation libraries in Factor, whether MIDI or Csound or something else. This just happened to be a little library I wrote while learning how MIDI file format worked. Given how easy MIDI files are to work with, you could easily build some sound c

Re: [Factor-talk] Rosetta Code

2015-04-09 Thread John Benediktsson
Random integer 1..5, can be done a few other ways (not sure if your floor creates bias). 5 random 1 + 5 [1,b] random Not sure you need ``>integer`` conversion in dice7, should already be integers. Your ``roll`` word can be replaced with ``replicate``, is simpler, for example: 10 [ d

Re: [Factor-talk] How to pass a VarArg to a C function?

2015-04-09 Thread John Benediktsson
Doug Coleman noticed a similar return value in some of his testing, I'm not sure where it is coming from - any chance it is some kind of bitmask of response values? Hah, I don't use Windows much, and found some sample code that still worked (yay for backwards compatibility!), but would love to upg

Re: [Factor-talk] Contributing to Factor

2015-04-09 Thread John Benediktsson
Hi Alexander, We love contributions, thanks! Pull requests on the GitHub repo (https://github.com/slavapestov/factor) are very welcome, or opening an issue with some sample code or changes that are important to you. Anything from documentation improvements, new test cases, vocabularies, etc. Th

Re: [Factor-talk] Factor version 0.97

2015-04-08 Thread John Benediktsson
Hi Fabian, Very sorry for the trouble you are having. This is a small bug with library paths and has been fixed in the latest nightly (which will become 0.98 soon). In the meantime, you can either try the nightly build (good and stable) or do this from a command line: $ ./factor -run=lis

Re: [Factor-talk] How to pass a VarArg to a C function?

2015-04-07 Thread John Benediktsson
I ran into this while working on the "file-picker" vocabulary for cross-platform open and save dialogs. You can see how we did this for GTK: https://github.com/slavapestov/factor/blob/master/extra/file-picker/linux/linux.factor Basically, defined an alien function with the args we intended it to

Re: [Factor-talk] Advice for talk

2015-03-12 Thread John Benediktsson
> > 2) I also remember a discussion about making the font in the listener >> bigger (I gave a talk at work, in order to prepare for the conference, >> and I ended up having to decrease the resolution in order for everyone >> to see, but then some contextual menus were partially hidden). >> > >

Re: [Factor-talk] Advice for talk

2015-03-11 Thread John Benediktsson
> > 1) I remember someone mentioned a tool that would show the speculative > status of the stack in realtime while entering words. > You might mean the "watch" word, although it writes to the input-stream so sometimes is a little difficult to use with the UI words: IN: scratchpad : foo ( x y

Re: [Factor-talk] printf - Stack effect declaration

2015-03-03 Thread John Benediktsson
Hi Georg, The ``printf`` word is a macro. You can see it starts with MACRO: definition. That means you can do this to see the code (``quot``) that is generated: [ "Test\n" printf ] expand-macros It also means that when you call it like you did, it will essentially generate and run that quo

Re: [Factor-talk] Glitch in string>xml example?

2015-03-03 Thread John Benediktsson
Well, this fails: "" string>xml But these both succeed: "" string>xml "" string>xml Looks like it's not proper XHTML? If it helps we have HTML5 parsers in html.parser, and words to work with it in html.parser.analyzer: "" parse-html "http://factorcode.org"; http-get nip

Re: [Factor-talk] Turning a string into a char-array for C

2015-03-02 Thread John Benediktsson
You could do something like this to get a byte array to pass to the function if passing a string doesn't work: IN: scratchpad "hello" utf8 encode . B{ 104 101 108 108 111 } Other encodings are available, like ascii or utf16, etc.. On Mon, Mar 2, 2015 at 10:15 AM, Mark Green wrote: > H

Re: [Factor-talk] Turning a string into a char-array for C

2015-03-01 Thread John Benediktsson
The c-string type handles encoding and decoding to a known encoding like UTF8 which is the default I think. See the "encode" and "decode" words for under the covers how it works. > On Mar 1, 2015, at 3:55 PM, Doug Coleman wrote: > > Hi Mark, > > You can try using the ``c-string`` type in a

Re: [Factor-talk] Desperate UI help

2015-02-21 Thread John Benediktsson
Hi Mark, The "UI" is a cross-platform interface built on OpenGL and we haven't implemented cross-platform popups or modal dialogs. The current popups are rendered into the window. However, we support on each platform calling any of the native UI's. So basically anything you can create on the n

Re: [Factor-talk] ActiveX DLL

2015-02-21 Thread John Benediktsson
The online docs are unfortunately not generated by our builders cross-platform right now. Something our new parser should hopefully fix. I recommend doing: IN: scratchpad "windows.com" about And looking through those docs on your local Windows install. Best, John. On Sat, Feb 21, 2015 at 1

Re: [Factor-talk] connection to listener dropping in fuel mode in emacs

2015-02-09 Thread John Benediktsson
This bug hasn't been reported as far as I know and we have lots of users of fuel mode... maybe if you can try and figure out what triggers it and file a bug report on github so we can help you debug? https://github.com/slavapestov/factor/issues On Sun, Feb 8, 2015 at 8:30 PM, Michael Maul wrote:

Re: [Factor-talk] Exporting a C API

2015-02-09 Thread John Benediktsson
Should be possible as the FFI supports calls and callbacks, but I'm not aware of anyone who has tried. Love the idea, though! On Sat, Feb 7, 2015 at 6:22 AM, Marmaduke Woodman wrote: > Hi > > I'm curious as to the feasability of exporting a C API for a library > written in Factor. > > From the

Re: [Factor-talk] read standard input line by line

2015-02-08 Thread John Benediktsson
Hi Vadim, That looks like a small bug in the UI listener with copy-paste, if you type ``readln readln`` and hit enter, and then type two lines (instead of pasting) it appears to work. Some workarounds, you generally will be writing I/O code that abstracts away from where you are reading, so you c

Re: [Factor-talk] State of OpenCL bindings

2015-02-07 Thread John Benediktsson
Looks like the tests are failing - will have to look into why. They were being ignored on the build machines. > On Feb 7, 2015, at 6:19 AM, Marmaduke Woodman wrote: > > Hi > > I'd like to use OpenCL, but the tests for Factor's bindings fail on two > machines (Win 7 & Mac OS X) both with pro

Re: [Factor-talk] State of OpenCL bindings

2015-02-07 Thread John Benediktsson
Hmm, the tests seem to pass on the build machines, but it fails locally for me. Let me talk to @erg and see what we can find. Best, John. On Sat, Feb 7, 2015 at 6:19 AM, Marmaduke Woodman wrote: > Hi > > I'd like to use OpenCL, but the tests for Factor's bindings fail on two > machines (Win 7

Re: [Factor-talk] Naive loop optimization

2015-02-06 Thread John Benediktsson
add [rax], al 00010fe79d39: add [rax], al 00010fe79d3b: add [rax], al 00010fe79d3d: add [rax], al 00010fe79d3f: 00 invalid > > On Fri, Feb 6, 2015 at 4:53 PM, John Benediktsson > wrote:

Re: [Factor-talk] Trouble to run Factor on Fedora on X11

2015-02-06 Thread John Benediktsson
On Thu, Feb 05, 2015 at 03:11:51PM -0800, John Benediktsson wrote: > > > Are you able to share what is on the error dialog? > > > > It is possible you don't have the right GTK dependencies (or that Factor > is > > not able to find them). > > I have foind a sol

Re: [Factor-talk] Naive loop optimization

2015-02-06 Thread John Benediktsson
Some thoughts for you: No, ``dup`` does not do anything but duplicate essentially a pointer to the object. Part of the reason it is slow is that you are operating on a kind of box by keeping your { x y } pairs in arrays (and in some cases unboxing ``first2`` and re-boxing ``2array``). Each of th

Re: [Factor-talk] Trouble to run Factor on Fedora on X11

2015-02-05 Thread John Benediktsson
Hi Jochen, Are you able to share what is on the error dialog? It is possible you don't have the right GTK dependencies (or that Factor is not able to find them). Have you tried a latest "development release" from factorcode.org? Thanks, John. On Thu, Feb 5, 2015 at 2:51 PM, Jochen Schmitt wro

Re: [Factor-talk] Talk about Factor

2015-02-01 Thread John Benediktsson
, Feb 1, 2015 at 8:33 AM, Andrea Ferretti wrote: > Wow, lots of ideas! Unfortunately, I cannot find anymore in your > repository the Google charts and TeX rendering stuff. Any chance there > is still something working? > > 2015-01-29 21:01 GMT+01:00 John Benediktsson : > >

Re: [Factor-talk] Talk about Factor

2015-01-29 Thread John Benediktsson
I think your tutorial will provide a good base for a presentation! There are a couple of talks available to look at: extra/chicago-talk extra/galois-talk extra/google-tech-talk extra/jvm-summit-talk extra/minneapolis-talk extra/otug-talk extra/tc-lisp-talk extra/vp

Re: [Factor-talk] ! Comments

2015-01-29 Thread John Benediktsson
Right now the comment character is not hard-coded in the lexer which causes us to discover poor errors like this one in some syntax words that aren't "comment-aware". There are a couple others we are planning on fixing also. Maybe you can add your test case to this issue: https://github.com

Re: [Factor-talk] Minimal exe

2015-01-28 Thread John Benediktsson
.factor On Wed, Jan 28, 2015 at 8:09 AM, Alexander Iljin wrote: > Hi, John! > > 28.01.2015, 18:56, "John Benediktsson" : > > That gives you a "hello-world" binary of about 1 MB. The "factor" > binary itself is about 480k, I think. So in general I agr

Re: [Factor-talk] ndrop

2015-01-28 Thread John Benediktsson
Feel free to ask more questions on the mailing list, or through a Github Issue if you'd like some help. On Wed, Jan 28, 2015 at 7:48 AM, Alexander Iljin wrote: > Hello, Jon! > > Thank you, you've explained a lot! > > It's funny that I stumbled into this on my second day of > experimentation.

Re: [Factor-talk] Minimal exe

2015-01-28 Thread John Benediktsson
Hi Alexander, I'm glad you're taking a look at Factor - the feedback is nice to get. Factor and Forth share similar-looking syntax, but Factor has a different set of internals and primitives that it builds with, for things like GC and arbitrary-sized integers (a bit like a "high level memory mana

Re: [Factor-talk] A performance challenge

2015-01-25 Thread John Benediktsson
If you want to avoid those dynamic type checks and not use TYPED, another alternative is "declare": { object array fixnum } declare > On Jan 25, 2015, at 9:12 AM, Björn Lindqvist wrote: > > 2015-01-18 2:44 GMT+00:00 John Benediktsson : >> Also,

Re: [Factor-talk] A performance challenge

2015-01-17 Thread John Benediktsson
Also, minor comment, instead of: length [ 0 ] { } replicate-as ; You can just do: length 0 And instead of the array-nth stuff, you can just do some type declarations and the compiler should make it the same as your array words: { fixnum array } declare nth-unsafe ; { array }

Re: [Factor-talk] A performance challenge

2015-01-17 Thread John Benediktsson
Factor is pretty fast already, but there are also some pretty low-hanging fruit like these: * Lift generic dispatch out of loops, for example this 30% win for iterating over slices: https://github.com/slavapestov/factor/issues/1213 https://github.com/slavapestov/factor/issues/839 * Fixn

Re: [Factor-talk] UI worlds and printing question

2015-01-16 Thread John Benediktsson
I'm not sure about your first question, our "popups" are just rendered in the window itself, I think we could easily support modal windows but I don't think support for this has been generalized to all windows. You can see an example of an application-modal window working like this (implemented as

Re: [Factor-talk] Google+ Factor community and first question

2015-01-16 Thread John Benediktsson
You almost got it right in your original question, and you found the answer, but I wanted to explain further what was broken: This will break the same way your first version did: IN: scratchpad { "factor" "is" "awesome" } 0 [ length + ] each The problem is if you look at the stack effect for

Re: [Factor-talk] Version of while that leaves pred's result on the stack?

2015-01-02 Thread John Benediktsson
Your version doesn't preserve any of the lines that are read: : readln-skipcomments ( -- ) [ { [ string? ] [ first CHAR: # = not ] [ ] } 1&& ] [ readln ] do while ; If you want the last line (the one where predicate is false and breaks out of the loop), you could put an object on the

Re: [Factor-talk] HTTP GET request

2014-12-30 Thread John Benediktsson
Right now support for SSL is optional, you need to do this: USE: urls.secure That defines the ``>secure-addr`` word. Best, John. On Tue, Dec 30, 2014 at 9:08 AM, Evan DiBona wrote: > > I've run into a problem with making a GET request, and I'm still not > sure if I've made an incorrect ass

Re: [Factor-talk] How to call up a terminal process to run script in OS X ?

2014-12-24 Thread John Benediktsson
for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) > > (See full trace by running task with --trace) > > > > You can try to ``set-current-directory`` and run that command and paste the > output? > > > "/home/tgkuo/testrake" set-current-directory >

Re: [Factor-talk] How to call up a terminal process to run script in OS X ?

2014-12-24 Thread John Benediktsson
st factor > Error, so, it's better to get the error messages from the terminal app. > > Is it possible to use "with-error>output" in io vocabulary or other relate > words to pipe the errors to factor > for debugging? > > Thanks > > Tsun > >&

Re: [Factor-talk] How to call up a terminal process to run script in OS X ?

2014-12-24 Thread John Benediktsson
ot;PATH" os-env . > or for readability > "PATH" os-env ":" split [ . ] each > > Lauching directly from the terminal shows different paths: > ./Factor.app/Contents/MacOS/factor > > > You can try to find rake after launching Factor both ways: > US

Re: [Factor-talk] deploy no longer working with new nightly build

2014-12-24 Thread John Benediktsson
Oh, I'm sorry that I forgot to mention. This needs new staging images for deploy so you need to delete the old ones which are not compatible with the new handling of the arguments: USE: tools.deploy.backend delete-staging-images Let me know if that works for you? Thanks, John. > On

Re: [Factor-talk] Variable command-line only contains arguments

2014-12-23 Thread John Benediktsson
at 1:59 AM, Georg Simon wrote: > > Am Mon, 22 Dec 2014 22:45:55 -0800 > schrieb John Benediktsson : > > Hi John, > > thank you. > > So I can wait for the next nightly build I assume. > > Georg > >> Hi Georg, >> >> I pushed a fix

Re: [Factor-talk] How to call up a terminal process to run script in OS X ?

2014-12-23 Thread John Benediktsson
The Factor launcher is for directly running processes. 1) You can run your rake command directly: { "rake" "RubyMotionSamples/ios/Timer" } try-process 2) Or if you want to "run it in your Terminal.app", then maybe a bit of applescript: USE: cocoa.apple-script "RubyMotionSamples/ios/

Re: [Factor-talk] Variable command-line only contains arguments

2014-12-22 Thread John Benediktsson
guments to the script. If you need the executable name, you can just call ``(command-line) first`` for right now. (Assuming you update to master) Best, John. On Mon, Dec 22, 2014 at 9:32 AM, John Benediktsson wrote: > > We try and make it consistent between deployed and non-deployed > app

Re: [Factor-talk] Variable command-line only contains arguments

2014-12-22 Thread John Benediktsson
build successfully uploads) > On Dec 22, 2014, at 9:24 AM, Georg Simon wrote: > > Am Mon, 22 Dec 2014 06:51:22 -0800 > schrieb John Benediktsson : > >> Hi Georg, >> >> I don't see a difference between deploy and when a script/vocabulary >> is run direct

Re: [Factor-talk] A stub of a package manager

2014-12-22 Thread John Benediktsson
Hi Andrea, I think it's a great idea! And I love that you built something we can start using and thinking about. My preference would be to keep it simple and iterate on it as often as you can. Start solving problems and when you come across some new problem that needs solving, well then solve t

Re: [Factor-talk] Variable command-line only contains arguments

2014-12-22 Thread John Benediktsson
Hi Georg, I don't see a difference between deploy and when a script/vocabulary is run directly. Is your question about deploy, or how to obtain the command/executable name? Thanks, John. On Mon, Dec 22, 2014 at 2:21 AM, Georg Simon wrote: > > http://docs.factorcode.org/content/word-command-li

<    1   2   3   4   5   6   7   >