åæ© VM ã C++ ã«ç§»æ¤éå§ããã®ã ãã©ã以å M ããããææã®ãã£ã C/C++ ãå¼ã³åºãã¤ã³ã¿ã¼ãã§ã¼ã¹ãããã¯ãã®éãã¤ã¾ãForeign Function Interface ã«ã¤ãã¦èãããªãä»ãããªãã®ã§èãããã å年代ã®ã¹ã¼ãã¼ããã°ã©ã M ããã«ãã©ããã£ã¦åå¼·ãããè¯ãã ãããï¼ãã¨åãããå³çã ã¾ãã¯ãCommonLispã®defun-c-callableã¨chunkãããã調ã¹ã¦ 次ã«Javaã®JNIã¨C#ã®P/Invokeå¨ãï¼ç¹ã«customã®marshalerã¨ãï¼ã調ã¹ã¦ å¾ã¯rubyã¨ãgaucheã®å ±æã©ã¤ãã©ãªããããã£ã¨ããããããããï¼ ã ããã§ãã ã²ããã¾ã ã¾ã å½¼ã«ã¯è¿½ãã¤ããæ°ãããªãã Common Lisp ã® defun-c-callable defun-c-callable 㯠obsolete 㧠defun-fore
FFI ã¨ã¯ä½ãï¼ ããè¨èªããä»ã®è¨èªã§ä½ãããã©ã¤ãã©ãªãå¼ã³åºãããã¿ã®äºã ããã§ã¯ Scheme ãã C ã®é¢æ°ãå¼ã³åºãæ¹æ³ãã¨ãä¸ãããä¾ãã° Scheme ãã libxml ã®é¢æ°ãå¼ã¶ãªã©ã ããã¿ ä¸ããé ã«å¦çãæµããã ã©ã¤ãã©ãªã®ãã¼ã å¼ã³åºããã¨ãã C é¢æ°ãå«ãå ±æã©ã¤ãã©ãªããã¼ãããããã¼ãã«å¿ è¦ãªæ å ±ã¯å ±æã©ã¤ãã©ãªã®ååã§ããããã®ååã¯ã¦ã¼ã¶ã¼ãæ示ããã dlopen, LoadLibrary ãªã©ã§ãã¼ããè¡ãããããã®ä½æ¥ã¯åæåæã«ä¸åè¡ãã ãã§ããã åæ å ±ã®æä¾ å¼ã³åºããã¨ãã¦ããé¢æ°ã®å¼æ°ãæ»ãå¤ã®åãå¦çç³»ï¼VMï¼ã«æä¾ãããä¾ãã°å¼æ°ã¯ int, char* ãæ»ãå¤ã¯ void ãªã©ã ãããã®æ å ±ã¯ã¦ã¼ã¶ã¼ãæå ¥åããããFFIã®ä»çµã¿ããããããã¼ã¹ãããï¼c-wrapperï¼ãããã¨ã§æä¾ãããã ã¾ãå¼æ°ã®åæ°ã
FFI (Foreign Function Interface) ã¨ã¯ å¦çç³»(ãã®å ´å㯠Gauche) ããä»ã®è¨èªã®é¢æ°ãå¼ã³åºã ã¾ãã¯ãä»ã®è¨èªããå¦çç³»(ãã®å ´å㯠Gauche) ã®é¢æ°ãå¼ã³åºã ä»çµã¿ã®ãã¨ãè¯ãæãã®ã¯é«ã¬ãã«è¨èªããä½ã¬ãã«ã¬ã¤ã¤ã®Cã©ã¤ãã©ãª çãå¼ã³åºããããªå ´åã ä¸æ¹ã®è¨èªããä»æ¹ã®è¨èªã¸å¼æ°ããå¼ã³åºãå½¢å¼ãããå¤æãã è¿ã£ã¦æ¥ãå¤ããã¨ã®è¨èªã¸ã¨å¤æãã¦ããä»çµã¿ãå¿ è¦ã ä¸è¬ã«stubã¨å¼ã°ãããã¾ããä»æ¹ã®è¨èªã®ãã¼ã¿æ§é ã«ã¢ã¯ã»ã¹ããããã® APIãFFIã«å«ã¾ããã ã¿ã¼ã²ããè¨èªã«ã©ãåããã¾ããããããã³ stubãã©ã®ãããåçã«æ§æãããã¨ããç¹ã§ããã¤ãå®è£ æ¦ç¥ãèããããã æãã½ãã£ã¹ãã£ã±ã¼ããããå½¢å¼ã¯ãã¿ã¼ã²ããè¨èªã«è¥å¹²ã®å®£è¨ã ä»å ããã ãã§ãã¿ã¼ã²ããè¨èªã®æç¶ãã¨åæ§ã«å¼ã³åºãããã¨ãããããªãã®ã ã¤
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}