TODO 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. A GRAB-BAG OF IDEAS AND THINGS TO DO, SOME QUITE OLD
  2. Consider using Unsafe.defineAnonymousClass
  3. Optimize splicing of methods calls.
  4. Remove createVarargsArrayIfNeeded logic from PrimProcedure.
  5. SRFI-46
  6. KawaScriptEngine should implement javax.script.Invocable
  7. Use Parboiled as parser library? https://github.com/sirthias/parboiled/wiki
  8. Before Kawa 1.12:
  9. - Jemacs type ctrl-C --> TooLongAction
  10. - Evaluate reported JEmacs bugs.
  11. - Go through remaining "news" entries and update manual.
  12. - go through Evaluating-Scheme-expressions-from-Java.
  13. - gnu/bytecode:
  14. -- Document emitIf../emitThen else, at overview level.
  15. - Verify that Path is consistent with new javax.nio (JDR 203)
  16. http://openjdk.java.net/projects/nio
  17. - internals: Update about procedures, inlining, tail-calls.
  18. HTTP/SERVLETS
  19. * Fix formatting: Language format -> HttpPrinter
  20. #t should print correctly
  21. BRL should by default not HTML-quote strings
  22. * Think about REST.
  23. * Support explicit and implicit require (BRL's sitedefs.scm).
  24. * Module should not be static - vars should be session variables.
  25. * Dynamic Environment should be per-session.
  26. * Get repl.xml working reliably.
  27. * Annotations ...
  28. - In ReplDocument don't use SwingContent.
  29. OPTIMIZATIONS
  30. * optimize fluid-let and fluid references:
  31. - in fluid-let call getLocation before calling setWithSave so we don't
  32. have to call it again in setRestore.
  33. - In local references inside a fluid-let use the location from above.
  34. * Optimize (make T) where T is a known non-simple class.
  35. This should not need to use reflection.
  36. * optimize zero? etc
  37. * other support for other single-element struct types, including unsigned int
  38. * warning about String conversions
  39. (See email from helmut Eller 2009/09/26)
  40. * warning about non-tail-calls
  41. (See email from helmut Eller 2009/09/26)
  42. HIGH PRIORITY:
  43. * Allow co-variant return types.
  44. * compile-file doesn't display warnings
  45. * When deferring imports (require) the 'run' actions shouldn't be deferred. FIXME
  46. * Optimize and/or in the case of ConditionalTarget or <boolean> target.
  47. * properties of symbols
  48. * Compilation: not implemented mustConvert restarg
  49. * XQuery distinguish qexo: kawa: fn: default function namespaces.
  50. * XQuery: Implement/document external functions.
  51. * Name mangling, document library modules.
  52. * Output formatting of empty arrays? (make-array (shape 0 0 0 3))
  53. * Format filter chain API?
  54. Localization support: gettext - see doc-resource.patch
  55. Remove pretty-print implementation in slib.
  56. Optimize NumberCompare further.
  57. BRL/KRL:
  58. * sitedefs.scm should be loaded
  59. * brl function should write to output, not be identity.
  60. The default output-pourt shold be re-directed.
  61. It should be the same as the ctx.consumer.
  62. * Resolve whether #!/FILENAME can be followed by embedded options (meta-arg).
  63. * CL reader interface
  64. * More define-class functionality?
  65. * Finish modules: define-module? constructor arguments?
  66. * Handle defmacro definition and use in same source file.
  67. * load.loadSource if (true) should be if (false).
  68. * Implement Scheme API for serialization.
  69. * Document in internals.html how ModuleMethod/ModuleBody works.
  70. Optimize to avoid creating frame classes:
  71. If a local variable is captured, and all functions intermediate between
  72. the capture site and the definition are call-only functions, and the
  73. local variable is never written (except before all calls to these
  74. intermediate functions), then add the variable as an extra implicit
  75. parameter to thse intermediate functions, instead of storing the
  76. variable in a frame.
  77. Should inline when accessing a final static field (using static-field),
  78. for int (or shorter) types - but only for "compile-time constants".
  79. (Needs checking .class file that field is given ConstantValue.)
  80. Starting (emacs) has wrong keybindings unless --elisp is specified.
  81. Move kawa.lang.Lambda to gnu.kawa.lispexpr.Lambda. Merge with Elisp version.
  82. Remove Scheme.getTypeValue.
  83. (define plus +) ... (plus ...) should not inline call to +.
  84. Implement IntRange class.
  85. Use it to replace Char's hashtable.
  86. Modules:
  87. * Infer parameter and return types when defaulted and otherwise match
  88. method in explicit module-extends or module-interface.
  89. compile-file should generate .jar, not .zip.
  90. Should perhaps take multiple file names.
  91. Update manual to removing .zip references.
  92. Binding for imported unknown names (idN$NAME) should not be static!
  93. (this) needs to be more general/robust.
  94. Start by forcing it to make the generated method non-static.
  95. What about 'super' ?
  96. Re-store code to check argument count when applyN is involved.
  97. (in Compilation and maybe ApplyExp).
  98. BindingInitializer.emit: global Environment should be cached
  99. TO BE DONE FOR 2.0:
  100. 'object': being able to pass constructor arguments. eg., to simulate:
  101. new javax.swing.JDialog(myFrame) { public void foo() {} };
  102. Perhaps: (object ((<javax.swing.JDialog> myFrame)) ...)
  103. Generate better code for `(and test1 test2 test3)'.
  104. [See maybe-report-section in testing.scm]
  105. Module compilation:
  106. * Allocated selector indexes "densely" within each applyX method
  107. of a ModuleBody, so tableswitch gets used, rather than lookupswitch.
  108. define-syntax and friends are not properly hygienic when checking
  109. literals: symbols listed among the literals lists are matched as
  110. raw symbols, rather that checking that the symbol has the same
  111. binding, if any, as at the defining site.
  112. Complain if syntax or macro is used in other than function-call position.
  113. Let LineBufferedReader pos, limit, buffer be private,
  114. but provide methods to get/set them.
  115. exact->inexact only implemented for RealNums, not other Complex.
  116. Fix scheme-window so #!eof closes window.
  117. Combine primitive field with record facility and define-class.
  118. Provide getopt-long (Guile, check scsh).
  119. Implement full call-cc by re-writing.
  120. This would be slower, so should be optional, probably not the default.
  121. Implement a pretty-printing AWT container.
  122. Complete R4RS procedures.
  123. trig functions for complex numbers
  124. Complete R5RS number syntax.
  125. Implement system open-input-pipe open-output-pipe close-pipe.
  126. Add a way to specify a load-path (or maybe just use CLASSPATH?).
  127. First seach for loaded files in directory where current file was found.
  128. OTHER:
  129. Provide a way to compile a Scheme program into an Applet class (with
  130. init/start/stor/pain/etc methods). Also provide a stripped down
  131. "kawa-run.zip", without eval, load, or compiler.
  132. Update to match kawa-tour:
  133. Vector -> FVector
  134. SyntaxRule.match should use Pattern.
  135. Should SyntaxRule inherit from Pattern?
  136. Move readSchemeObject readSchemeNumber etc from InPort
  137. to new class(es) Parser:
  138. class Parser;
  139. class SchemeReader extends Parser; // Provides read
  140. class SchemeParser extends SchemeReader; // Provides read+rewrite
  141. Move Interpreter.syntaxError to Parser.
  142. Treat ReadError as SyntaxError.
  143. Support warning, error, fatal.
  144. Parser accumulates list of syntax errors.
  145. When done, if errors or warnings, throw SyntaxErrors.
  146. Printing SyntaxError prints error log.
  147. Make closure representation consistent with inner classes wrt
  148. use of Attributes (for possible improved debugging).
  149. Optionally issue a warning if a symbol is rebound.
  150. Inline calls to simple methods, especially builtins.
  151. Ties in with module specifications (to determine which bindings are builtin).
  152. Quantities:
  153. Arithmetic involving Units should return Units.
  154. Printing a Unit should return something readable, maybe:
  155. (quantity->unit 1cm) -> "1cm". while 1cm -> "1.0cm".
  156. EVENT CALLBACKS - Proposed design
  157. Syntax: (listener (EXTRA-INTERFACE ...)
  158. ((METHOD-NAME+ [EVENT-TYPE])+ ARG ACTIONS ...) ...)
  159. Example: (invoke component 'addMouseListener
  160. (listener ((mousePressed mouseReleases) evt
  161. (display (list "mouse pressed or released:" evt))))
  162. This creates a new "listener" instance. The instance has one
  163. method for each METHOD-NAME; the method takes a single argument
  164. of the specified EVENT-TYPE. The EVENT-TYPE can be left out
  165. in the case of standard java METHOD-NAMES; for example
  166. if the METHOD-NAME is mousePressed, the implied EVENT-TYPE
  167. is <java.awt.event.MouseEvent>. When the method is executed,
  168. the actual Event is bound to ARG, and the ACTIONS executed.
  169. (The type is ARG is the least common super-type of all
  170. the explicit or implicit EVENT-TYPES for corresponding METHOD-NAMES.)
  171. The allocated listener instance implements all the interfaces
  172. listed in the EXTRA-INTERFACE list; if addition, if an EVENT-TYPE
  173. was implied, the corresponding Listener interface is also implied.
  174. (For example a METHOD-NAME of mousePressed implies an EVENT-TYPE
  175. of <java.awt.event.MouseEvent>, and hence an interface of
  176. <java.awt.event.MouseListener>.)
  177. New syntax:
  178. (listener [(EXTRA-INTERFACE ...)]
  179. ((METHOD-NAME ... EVENT-ARG-NAME [:: EVENT-TYPE]) ...))
  180. Listeners on JComponent etc:
  181. (javax.swing.JButton text: "Click Me" item-state-changed: (lambda (e) ...))
  182. It KEYWORD does not match a setter:
  183. Make list of all 1-argument methods that match addXxxListener.
  184. Look at parameter type - assume an interface type Yyy or abstract class.
  185. See if there is a method named KEYWORD (after mangling) in type Yyy.
  186. If so add to "handler list".
  187. If "handler list" is non-empty, create an anonymous "handler" class.
  188. (If any Yyy is an abstract class, create separate handler classes for each.)
  189. Handler class implements all the Yyy interfaces.
  190. Add methods for each argument. Add any other void non-implemented methods.
  191. For example:
  192. (object (ItemListener)
  193. ((itemStateChange $e::ItemEvent) ((lambda (e) ...) $e)))
  194. Then: call addItemListener.
  195. Issue: (set! foo:item-state-changed (lambda (e) ...new handler...))
  196. In that case we want to remove old handler before adding new one.
  197. Can use getItemListeners followed by removedItemListener.
  198. Problem is that this may remove other unrelated handlers,
  199. unless we have one handler only for each method.
  200. Or have the handler have a set of settable slots.
  201. SYMBOLS
  202. If we have pre-process environments, (define exit ...) should only re-define
  203. exit in the current environment, not all.
  204. JEMACS
  205. clean up function-binding hacks
  206. vertical-motion
  207. Make it so that JEmacs does not require Swing. There is a start in
  208. that gnu.jemacs.buffer mostly contains toolkit-independentcode, and
  209. gnu.jemacs.swing contains Swing-specific implementations. This
  210. separation shoudl be finished, and we should add one or more
  211. implementation on other toolskits:
  212. - using Gnome2 (http://developer.gnome.org/doc/API/2.0/gtk/textwidget.html)
  213. text widgets with Pango (http://developer.gnome.org/doc/API/2.0/pango/);
  214. - one that uses the SWT toolkit (http://www.eclipse.org/articles/)
  215. that is part of the Eclipse project (http://www.eclipse.org);
  216. - one that uses plain AWT;
  217. - and one that works on plain terminals, perhaps using charva
  218. (http://www.pitman.co.za/projects/charva/).
  219. It is important that JEmacs be able to run well using Free Software only,
  220. and it cannot do hat as long it depends on Swing, until there is a
  221. free re-implementation of a suitable Swing subset.
  222. Note that the Buffer class should be a pure "model" which is toolkit
  223. independent: we want to be able to display the same buffer in both
  224. a Swing Window and a telnet window at the same time.
  225. The JEmacs widgets should be integrated into the gnu/kawa/slib/gui.scm
  226. design.
  227. Should implement Common Lisp-style "type specifiers" and declarations.
  228. This would make it practical to write-lower level code that calls Java
  229. methods directly in ELisp (and Common Lisp), without having to use Scheme.
  230. BENCHMARKS
  231. http://www.ccs.neu.edu/home/will/Twobit/kvwbenchmarks.html