言語実装 Advent Calendar 2015の22日目として書かれました。 ErlangでBEAMで動くコンパイラする作成を説明します。
ulangというサンプルプログラムを作ったのでこれを元に説明します。 https://github.com/oskimura/ulang.git
主な流れとしては字句解析器、構文解析器を行って中間表現に変換しcompileモジュールを使ってBEAMで実行可能なバイナリを作成するという流れです。 今回はulang.xrlで字句解析を行い、ulang_yecc.yrlで構文解析及び中間表現の出力、compiler.erlでバイナリ出力するようにつくりました。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
原文:[http://www.paulgraham.com/lwba.html Lisp for Web-Based Applications] | |
;; updated by nfunato on 2015-11-27 | |
---- | |
[http://practical-scheme.net/trans/beating-the-averages-j.html 普通のやつらの上を行け]へのリンクがslashdotにアップされた後に、何人かの読者は、私たちがViawebでLispを使ったことで得られた固有の技術的なアドバンテージについて、さらに詳しく聞きたがった。 | |
興味を持つ人のために、私が2001年4月にマサチューセッツ州ケンブリッジのBBN研究所で行った講演の要約を以下に示す。 | |
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ARM Architecture Reference Manual | |
; https://www.scss.tcd.ie/~waldroj/3d1/arm_arm.pdf | |
; UM10398 LPC111x/LPC11Cxx User manual | |
; http://www.nxp.com/documents/user_manual/UM10398.pdf | |
start: | |
; Initial SP value | |
dd 0x10000FF0 | |
; reset | |
dd reset - start + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
カーネル、私の読み方 | |
坂本一樹 sakamoto@netbsd.org | |
始まりは「仕事」、でも... | |
なぜカーネルのソースコードを読んだり書いたりすることになったのかと | |
問われれば、それは「仕事」だったから、と言える。そもC言語による | |
プログラミングをはじめたのも、FreeBSDやNetBSDを使いはじめたのも、 | |
「仕事」で使うからという理由である。しかしMIPS R3000を使った | |
UNIXマシンのOS保守やデバイスドライバの作成などの業務に携わっているうちに |
FirmataはPC - マイコン間でやり取りするためのプロトコルです。汎用入出力の値の取得・書き込みその他の操作をPC側からArduinoのようなマイコンに対して行う為に使用されます。
ArduinoでFirmataプロトコルを使用してホストコンピュータとやり取りする場合は、ArduinoIDEを立ち上げて、ファイル
-> スケッチの例
-> Firmata
-> Standard Firmata
を選択、開きそのままArduinoに書き込めば良いです。
##プロトコルフォーマット
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; PORTABLE PROLOG INTERPRETER by H. Nakashima | |
;;; ( Version 2 ) 1983.04.09 | |
;;; Common Lisp Version 1988.11.21 | |
(defvar cue nil "Goals to be executed") | |
(defvar clause nil "Body of a goal") | |
(defvar epilog nil "Switch to exit") | |
(defvar fetched-subst nil "The environment of the value of a variable") | |
(defvar goal nil "top-level goal") | |
(defvar new-subst nil "environment of the callee") |