Bug 481

Summary: Export Scheme interpreter interface as uim API
Product: UIM Reporter: YamaKen <yamaken>
Component: libuimAssignee: YamaKen <yamaken>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: uim-bugs, yusuke
Version: unspecified   
Hardware: All   
OS: All   
URL: http://lists.sourceforge.jp/mailman/archives/anthy-dev/2004-April/000762.html
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 482, 486, 7164    

Description YamaKen 2004-04-17 06:41:17 UTC
Some uim companion tools are requiring direct Scheme code evaluation, but uim is
currently not exporting required functions. A patch [Anthy-dev 763] by Kouhei
Sutou-san resolved this, but I think that these functions should be
distinguished from ordinary uim API because the functions are requied by few uim
companion tools only.

Following consideration is needed.

1. add appropriate prefix to the functions (such as "uim_scm")
   ex) uim_scm_repl_c_string()
2. aggregate these functions into independent header file
   ex) uim-scm.h

"uim_scm" is not the best choice because the API will contain non Scheme-related
definitions later. The prefix should be meaning "friend" in C++. Any ideas?

The new API will be used by following uim companion tools.

- uim-shell (may be renamed to uim-sh)
  uim interactive shell for debugging, batch processing and serving as generic
inferior process

- Sumika (http://sourceforge.jp/projects/sumika/)
  A GUI tool for dictionary maintenance and uim configuration
Comment 1 Yusuke TABATA 2004-04-18 01:14:52 UTC
We also need this to implement plugin feature.

Shall we make a big structure that contains all of exported scheme functions?
Say,
struct uim_scheme {
  LISP (*car)(LISP );
  LISP (*cdr)(LISP );
  .. other functions here ..
};
Comment 2 YamaKen 2004-04-19 12:13:07 UTC
I'm no sure about the Tabata-san's idea. Although we have a similar structure
uim_code_converter to handle a set of functions, I think that it's existing to
handle polymorphism. I suppose that uim is always using one Scheme
implementation only, so runtime polymorphism is not required. Simple abstraction
through uim_scm_foo() is sufficient.

Or other reason (efficiency)?
Comment 3 YamaKen 2004-04-20 04:05:36 UTC
I've Added uim-scm.h to svn repository by r727. This isn't the final API.
Discussions are welcome.
Comment 4 Yusuke TABATA 2004-09-30 08:35:52 UTC
Exporting scheme object to C is somehow dangerous.
Garbage Collector can't recognize reference to the objects outside libuim.


current sumika has possibilities of following scenario
(1) uim_lisp v = uim_scm_???() -> allocate cells and return them.
(2) uim_scm_???() -> invoke GC inside. contents of v will be collected.
(3) use v -> operation to garbage. good luck!
Comment 5 YamaKen 2005-01-18 01:27:39 UTC
uim-scm API reorganization has recently done. More elaboration is required.
Comment 6 YamaKen 2005-01-26 09:42:23 UTC
Current uim-scm implementation is enough to unblock bug #538.
Comment 7 YamaKen 2006-06-09 00:50:52 UTC
The uim-scm API will be revised and simplified at uim 1.3.0.
Comment 8 YamaKen 2006-08-01 18:29:06 UTC
Current uim-scm implementation is enough to close this bug. Simplification and
reorganization should be separated as another bug.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.