11. my own interpreter
• 三重苦
• 文字列認識(対話)型 or 中間コード生成方式
• エラー発生
• 単なるコードエラー?
• 仕様の想定を超えていた?
• 仕様から作り直しだよksg
• 独自インタプリタの使い方を教える必要
• もうだめぽ
13年9月17日火曜日
12. my own interpreter
• すでにあるVM規格のある言語仕様を活用
Language for embedded requirements
Python P14P(ex.PyMite) Flash:55kB~,RAM:8kB~
Lua eLua Flash:256kB~,RAM:64kB~
Ruby mruby Flash:512kB,RAM:1MB?
Java Java ME and so on... Flash:130kB,RAM:8kB
13年9月17日火曜日
15. Variants Java VM
• Java for embedded
JVM System requirements
Oracle Java ME
Embedded for
STM32F
Flash :130kB~
RAM: ?
Binary only
uJ
Flash :64kB~
RAM:192bytes~
thread,runnable,GC,
original String type
nanoVM
Flash :8kB~
RAM: 1kB~
for AVR
Single thread
RaVem
Flash :5kB~
RAM: 256bytes~
thread,runnable,
Integer only
13年9月17日火曜日
37. RaVem JVM
RaVemRaVem
Rapid VM embbededRapid VM embbeded
• Flash 5kbytes~
• RAM 128bytes
• int type only
• all code written in C (about 700 sloc)
• github (for LPC812)
• https://github.com/lynxeyed-atsu/RaVem
• port on mbed
• http://mbed.org/users/lynxeyed_atsu/code/FRDM_RaVem_JVM
13年9月17日火曜日
46. byte code
• バイトコードの中身
• 命令(Code Attribute)
• main method
• run method in thread
• RaVem JVMでは以下を管理
• vm_object
• start address
• end address
• num. of stack
• local registor
• thread number
CA FE BA BE........
...........................
...........................
...........................
...........................
...........................
...........................
...........................
...........................
13年9月17日火曜日
47. rights of Java VM
• Copyright law does not confer ownership over any and
all ways to implement a function or specification, no
matter how creative the copyrighted implementation or
specification may be.
• The Act confers ownership only over the specific way in
which the author wrote out his version. Others are free to
write their own implementation to accomplish the identical
function, for, importantly, ideas, concepts and functions
cannot be monopolized by copyright.
-- William Alsup, the judge Google v. Oracle.
13年9月17日火曜日