Mitchell N Charity
Beginning Factor, long ago PostScript, toy Forth. Et al. tantum.
Currently (2010-08) attempting to use Factor as a compiler target for an experimental language.
- "extra" "foo" scaffold-vocab no longer works, now requiring "resource:extra". The docs need and example.
locals, improving documentation
I don't yet have warm fuzzies that the locals documentation well describes the issues one encounters. Especially when "going against the (language) grain", doing code generation. Notes:
- locals is "parse-time quotation CPS rewriting". It expands macros.
- Defining locals inside of fry tends not to work, throwing an error.
- I've been told defining words inside of locals is a bad idea. No top level lexical forms.
- A thorough list of "you can't do locals inside of X" and "you can't do X inside of locals" would be nice. Or "here's the right mental model" to understand what works and doesn't.
- Locals variables are really multi-word patterns. This is sometimes visible, as when handing a quotation containing one to unit-test. [let 3 :> x [ x ] ] is not [ 3 ] .
- The comment has gone by that quotations with locals are slower (even when compiled? run uncompiled in vm?) than quotations without. Details needed.
- There does not yet seem to be a word for creating lambdas after parse time. The locals equivalent of fry's fry . TODO. Need: enable the equivalent of a '(lambda (x) 33) list, where 33 can later be replaced with (+ x 42). Currently, one can? do parse time interpolation, but that's still parse time. Strawman: SYMBOL or DEFER to make the parser happy with the local variable words, create a variable list and quotation, and hand it to a new word which mirrors the current parse-time word internals. Needs to be in compilation unit or no?
Hashes, opportunities for improvement?
Two observations: (1) hashes uses a growth factor of 2x, in contrast to perl/ruby/python(?) which I fuzzily recall grow more slowly. (2) The occupancy can get a bit high (2/3). One babble: at one point, I thought I might have seen very poor lookup performance from a large hash, which went away when I doubled the size of the table. Todo: look again at hashes's collision handling, especially wrt non-simple (data structure) keys, and lookup's high-cost quartile's cache misses.
Whole-program speed profiling of large words
Tips for spinning up with Factor
(ed:Before it's all assimilated)
(ed:Sketch of language "grain")
- Missing "I wish there was a link from here to X" paths through docs.
- "Oh, I see now. The intro paragraph would better say Y".
- Creating a test infrastructure with a more "story telling" rubyish high-coverage feel. But, is it really needed for idiomatic Factor?
- Listener/browser tricks
- Encourage Slava screencast video? Exists?
- Open bugs. Pending patches.
- Variable arity multiple dispatch.
- nano-count non-monotonicity errors, avoidance of
- err, bit overdue for a "what is the purpose of this page" vision/mission statement
- (missing ref variant(s))
- (ed:what else?)
Words of unclear general interest:
- A DEFER: variant whose error mentions the word deferred. For nicer errors when run from commandline.
- A kludged perl dprofpp performance profile dumper.
(ed:Would a long laundry list here really be useful? Inline code? github mncharity-misc-factor?)
- On naming your new programming language or software project - a word, or name phrase, which is unique, allows users to search for it plus "any description of what they are wondering about", and get a good search. With results from mailing lists, blogs, tweets or whatever. Using words from languages with low web presence (eg, Ubuntu), or mutant spelling (eg, Clojure and Clozure), or, riskier, unusual phrases (eg, Pure Data), are some approaches. In contrast, a name which is a real word depends upon the rest of the search phrase to establish an "I mean the software" context. Search quality is lower, and requires users craft contextualizing queries. A word which is already related to software prevents even this contextualization, and should be avoided.
This revision created on Sat, 4 Sep 2010 01:26:52 by mncharity