Skip to content

Instantly share code, notes, and snippets.

2012年の環境で超漢字クロスコンパイラは作れるか?

超漢字の開発環境は,マイクロスクリプトの他に C言語が使えます. マイクロスクリプトでできることには制限がありますし,実行の速度などの問題もあります. 超漢字の持つ機能を完全に使いたければ,C言語での開発が必要になります.

C言語の環境は,セルフとクロスの2種類があります. セルフ環境は,導入が容易で,超漢字のみがあれば開発を行えるというメリットはあります. しかし,プログラマの多くはお気に入りのコーディング環境があります. 超漢字の上でそれらの環境は揃わない可能性が高く,なるべく多くの開発者が高い開発効率を得られるようにすることを考えると,クロス環境を整えるべきと言えます.

#!/usr/bin/env ruby
require 'rubygems'
gem 'ruby-serialport','>=0.7.0'
require 'serialport'
$sp = SerialPort.new('/dev/tty.usbmodem2411', 115200, 8, 1, 0)
$sp.binmode
@monaka
monaka / prof.log
Created March 19, 2013 05:43
Result of fib 39 mruby (git commit dec4ec694b5496939ee93a706a6bba95ddbf2b9e) Linux ubuntu 2.6.32-41-generic #90-Ubuntu SMP Tue May 22 11:31:25 UTC 2012 i686 GNU/Linux gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
72.02 31.53 31.53 4 7.88 10.82 mrb_run
6.28 34.28 2.75 204668368 0.00 0.00 stack_clear
5.66 36.76 2.48 204668367 0.00 0.00 mrb_method_search_vm
4.82 38.87 2.11 204668412 0.00 0.00 kh_get_mt
4.68 40.92 2.05 204668391 0.00 0.00 cipush
@monaka
monaka / gist:5328960
Last active December 15, 2015 21:50
ROMed target support for mruby.
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 60e9b44..7af8686 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -63,6 +63,7 @@
/* -DENABLE_XXXX to enable following features */
//#define ENABLE_DEBUG /* hooks for debugger */
+//#define MRB_ENABLE_ROMED /* ROMed targets support */
@monaka
monaka / coveralls.sh
Last active August 29, 2015 14:00
coveralls.sh
#!/bin/bash
# Based on https://github.com/azu/NSDate-Escort/blob/master/script/coveralls.sh
# Licensed under MITL.
declare -r gcov_dir="."
daclare -r file=""
## ======
generateGcov()
{
@monaka
monaka / sample.c
Created June 11, 2014 23:12
Difference between _Bool and integers.
#include <stdio.h>
#include <stdint.h>
void
hoge(uint8_t b)
{
/* b == 0 */
if (b) printf("hoge");
}
vars = DOCUMENT_ROOT GATEWAY_INTERFACE HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING
vars += HTTP_ACCEPT_LANGUAGE HTTP_CONNECTION HTTP_HOST HTTP_REFERER HTTP_USER_AGENT
vars += PATH QUERY_STRING REMOTE_ADDR REMOTE_HOST REMOTE_PORT REMOTE_USER REQUEST_METHOD
vars += REQUEST_URI SCRIPT_FILENAME SCRIPT_NAME SERVER_ADMIN SERVER_NAME SERVER_PORT
vars += SERVER_PROTOCOL SERVER_SOFTWARE
all: table_end
header:
[Unit]
Description=Copy CIFS mount
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=0
ExecStartPre = -/usr/bin/mkdir -p /opt/sbin
ExecStart=/bin/sh -c "rm -fr /opt/sbin && rsync -a /usr/sbin/ /opt/sbin/ && /usr/bin/docker run --rm -v /opt/sbin:/target so0k/mount.cifs_copy /target && mount --bind /opt/sbin/ /usr/sbin/"
apiVersion: 1.0.0
metadata:
name: jsp_corearmv4-integrator
projects:
- name: jsp_core
source:
type: git
location: 'https://github.com/PizzaFactory/jsp_core.git'
components:
- type: dockerimage
metadata:
name: CodeServer
components:
- id: cdr/code-server/latest
type: cheEditor
apiVersion: 1.0.0