ときどきの雑記帖'

最新ページへのリンク
目次ページへのリンク

一つ前へ 2013年8月(下旬)
一つ後へ 2013年9月(中旬)

ホームへ

2013年09月10日

■_

To my daughter's high school programming teacher : programming お、コメント数が1000超えてる

この本面白そう。

■_

「中間言語」ってこういうものでしたっけ?

モダンな言語でHTML5を開発しよう! 俯瞰して理解するaltJSの比較 (前篇 – TypeScript, CoffeeScript, Haxe) | HTML5Experts.jp

ここ数年のHTML5やCSS3の劇的な進化に比べて、JavaScriptの言語としての進化は緩やかだったのではないでしょうか。
HTML5の登場により、リッチなウェブサイト・コンテンツ・アプリケーションが求められる時代になったのに、それを制
御する言語が未だにレガシーなものであり、ニーズに追いついていないのが現状です。

2010年前後からこれらを解決する手段として、JavaScriptを生成する中間言語が登場してきました。これらはJavaScript
の代替ということで「altJS」と呼ばれています。altJSの言語の多くはクラス機構のサポートなどJavaScriptの抱える問
題の多くを解決しており、スマートにコードを書くための仕組みが用意されており、開発効率を大幅に向上させることが
できます。本記事では前後編の2回でaltJSの5種類の言語を比較します。

↓こういうのを指していうものだと思うんですが

中間言語 - Wikipedia

中間言語は、プログラミング言語処理系において、高水準言語のソースコードと機械語のコードの中間にあたる中間表現
の言語である。

人間が読むことのできる状態から、コンピュータ内部のデータ形式に一旦置き換えたもので、機械語ではないからそのまま
CPUが解釈して実行することはできない。BASICなどのインタプリタで実行速度の高速化のためによく利用される。また、
コンパイラでは高度な最適化を施すためには中間表現が欠かせない。

仮想機械の機械語でバイト指向の中間言語をバイトコードという。目的機械のコード生成の前段階として、アーキテク
チャ独立の一種の機械語と言える3番地コードを使うコンパイラがある。.NET Frameworkでは共通中間言語を定義した。
Pコードを使うPascalの実装がある。

■_

■_

miyagawaさんの podcast でも同様のことを言ってたし、 卑近な例で言うと、InfoQ あたりの記事を紹介しても反応なくて、 その記事が翻訳されると盛り上がったりするとか。 いやまあ元の影響度が違うだろって話はありますけどお

■_

誰>「まつもとひろゆき」

スレ立てるまでもない質問はここで 128匹目

525 デフォルトの名無しさん [sage] 2013/09/10(火) 11:08:54.90 ID: Be:
    有名なプログラマーって年収どのくらいもらってるんでしょうか?
    今から未経験でプログラミングを覚えて松本さんみたいな日本で一番すごい人だと3000万とかいくんでしょうか 

528 デフォルトの名無しさん [sage] 2013/09/10(火) 12:49:58.11 ID: Be:
    社員のプログラマであるかぎり能力があろうとも金持ちにはなれない 

532 デフォルトの名無しさん [sage] 2013/09/10(火) 13:49:13.56 ID: Be:
    そもそもゲイツだってプログラマ出身ですし 

533 デフォルトの名無しさん [sage] 2013/09/10(火) 16:23:33.34 ID: Be:
    やっぱり技術本はオライリーだけかっとけば問題ないですか? 

534 デフォルトの名無しさん [sage] 2013/09/10(火) 16:55:26.23 ID: Be:
    >>525
    現場プログラマとか派遣で間に合うし
    大規模プロジェクトをまとめられるような人のほうが重宝するわけ
    もうちょっと上流に目を向けるべきだ

    まあいくつも掛け持ちしてるスーパー現場プログラマってのも昔はいたんだよな 

535 デフォルトの名無しさん [] 2013/09/10(火) 17:48:45.87 ID: Be:
    松本さんてだれ? 

536 デフォルトの名無しさん [sage] 2013/09/10(火) 17:55:30.95 ID: Be:
    横浜の? 

537 デフォルトの名無しさん [sage] 2013/09/10(火) 17:59:19.48 ID: Be:
    広島のほうじゃね

    それはともかく、リーダー経験者ってだけでそれなりに金とれるぞ 

538 デフォルトの名無しさん [sage] 2013/09/10(火) 18:00:02.88 ID: Be:
    横須賀だわ
    http://youtu.be/v0cIUnH0CcQ 

539 デフォルトの名無しさん [sage] 2013/09/10(火) 20:43:45.43 ID: Be:
    まつもとのTwitterでこんなリンクをみつけた
    http://resocia.jp/skillup/ruby0927/
    >国内のRuby市場では、求人数は増加し、年収900万円を超えるエンジニアが10%近くになり、大手企業の参入、官公庁での採用など、Rubyが市場でブレイクする条件が着々とそろいつつあります。

    PHPのほうが仕事があるので年収1000万いくかと思ってたのに
    Rubyは本当に10%の人が900万超えるの?じゃあRubyを今から覚えたほうがいいのかな?
    ちなみにPythonの人の年収も知りたい 

542 デフォルトの名無しさん [sage] 2013/09/10(火) 23:14:26.38 ID: Be:
    >>525
    >今から未経験でプログラミングを覚えて松本さんみたいな......

    松本さんというのが まつもとひろゆき という人物を指すのなら、
    Wikipediaによれば、彼は 筑波大学第三学群情報学類卒 らしい。
    彼と同レベルな年収を希望しているなら、彼と同レベルな学歴、
    つまり旧帝大かそれに準ずる国立大の情報系学部へ進学するのが、
    手っ取り早い最初の一歩だと思われ 


■_

論文読んでる余裕が○| ̄|_

2013年09月09日

■_

そういや、昨日初めて「雁川」のある場所を(偶然)知ったのだった。

日経LINUX買った。

ついった経由で知った。こういうのが始まってたのね。 Secure Coding Standards Newsletter - Secure Coding - CERT Secure Coding Standards

■_

あとで書く(書けると良いなあ) シンボリックに気を付けて[sed] | ツチノコブログ What is "Open Recursion"? : programming Why there is no Hitchhiker’s Guide to Mathematics for Programmers | Hacker News A MoarVM Progress Update | 6guts Rambling On [PHP] Internals | Hacker News ircmaxell's blog: Rambling On Internals

■_

Why I don't use a parser generator : programming Why I don’t use a Parser Generator | Musing Mortoray LL and LR in Context: Why Parsing Tools Are Hard : programming Josh Haberman: LL and LR in Context: Why Parsing Tools Are Hard

Josh Haberman: LL and LR in Context: Why Parsing Tools Are Hard

Language specifications are often defined in terms of a formalism like BNF, but it's almost never the case
that real parsers can be generated directly from this formalism. GCC moved away from their Bison-based parser
to a handwritten recursive descent parser. The Ruby interpreter MRI may be one of the few remaining
mainstream language implementations that does still use Bison (an LR-based tool) for parsing.

なんでここで Ruby が引き合いにw

■_

■_

2013年09月08日

■_

登録してないと読めないところで申し訳ないんですが (たまにマイナビに転載されてたりします) 50年で4巻のプログラム法典?天才の人生/キーマンズネット プログラムを嗜む人にとって、「The Art of Computer Programming(アートとしてのプログラミング)」はあまりにも有名な書籍かもしれない。 いやいやいやその訳はないでしょー>「アートとしてのプログラミング」 The Art of ほげほげなタイトルはたくさんあるけど中でもこの本とかどうなっちゃうの。 「アート」が即「芸術」とも限らないけど。 The Art of War - Wikipedia, the free encyclopedia art of war から逆方向に翻訳するとこういう言葉もあるらしい 戦争術 - Wikipedia

■_

来年発売予定の本のお知らせが流れてきた。 Head First Pyhtonの予定延びた? Amazon.co.jp: Head First Python: Paul Barry: 洋書 Amazon.co.jp: Introducing Python: Modern Computing in Simple Packages: Bill Lubanovic: 洋書 Introducing~ はオライリーの本ならどっかで見たことないかなあと思ったら 最近は基本電書しかチェックしてなかったので 今のところpbookのpre order のみのこの本は見落としていたらしい。 Introducing Python - O'Reilly Media

■_

まつもとさんのツイートから。

array language ってことは…と予想してリンクを辿ってみたら Coding Is Like Cooking » Blog Archive » An introduction to Array Languages

Coding Is Like Cooking » Blog Archive » An introduction to Array Languages

Last week I was in Oxford at “Iverson College”, which is a conference on the topic of Array Language
Programming. There were about 25 programmers there, most of whom are expert in one or more of APL, J, K, or
Q. It’s not my usual comfort zone, put it that way! I’m fairly competent with a number of programming
languages, notably Python and Java, but nothing I know is really much like these array languages. It’s been
a huge culture shock, but in a good way, I think.

My main discoveries are that Array Programming is different again from Object Oriented Programming and
Functional Programming, (although it has a lot in common with functional programming), and that this
community contains some exceptional programmers. The total number of array language programmers is however
extremely small and their work seems to be pretty much unknown to the wider programming community.

Array Programming Languages

I mentioned before four languages, APL, J, K and Q. They are similar to each other, kind of like Ruby and
Python are similar to each other. I’ve gone through an introductory training in each language this week,
largely given by the language designers themselves. I’d like to relate a little of what I’ve discovered
about them.

以下略

気になる>Iverson College

■_

「Pythonコードは欠陥が少ない」という調査結果 | スラッシュドット・ジャパン デベロッパー の話の続き。 Open-Source Python Code Shows Lowest Defect Density - Slashdot Coverity finds Python sets new level of quality for open source software - CIOL

Coverity finds Python sets new level of quality for open source software - CIOL

"Python's decision to join the Coverity Scan service and leverage our industry-leading development
testing platform has raised the bar for open source software. This Scan Spotlight - and Python's impressive
level of software quality - should be a call to action for any C/C++ or Java open source project not yet
reaping the benefits of the Coverity Scan service."
Open-Source Python Code Sets New Standard for Quality: Study

Unfortunately, the math in the article is wrong. It is NOT .005 defects per thousand lines of code, it is .5
defects per thousand lines of code. The article states that "Coverity's scanning technology has analyzed
more than 396,000 lines of code in the latest builds of Python 3.3.2. That analysis has led to 181 new
defects being identified." Simple division leads to a little over 1 defect per 2000 lines of code which
is roughly .5. This is closer to the open source average of .69 per thousand stated earlier in the article.
Python is better, but only 40% so, not 4000%! 

Open-Source Python Code Shows Lowest Defect Density - Slashdot にこういうコメントが 0.005 defects per thousand lines times 400,000 lines gives a total defect count of 2. So where did the other 994 defects come from?

■_

Go でイテレーターがどうとか最近見たような Iterators in Go

■_ shallow/deep type inference

「この本」とはこれのこと。 メタプログラミング.NET
メタプログラミング.NET で、その原著。わたしが持ってるのはこっちの電書版(例によって値引きセールのときに購入)。 Metaprogramming in .NET
Metaprogramming in .NET

翻訳本の電書もあります。

メタプログラミング.NET
Kevin Hazzard, Jason Bock, 長尾高弘(翻訳)
アスキー・メディアワークス
発行日: 2013-08-30
対応フォーマット: PDF

「深い型推論」→ 「Deep type inference」らしいのはすぐ分かったのですが 索引にもないし、特に説明されている気配もなく。 んでぐぐるさんで探してもはっきりと分かるようなものはなかったのですが Trends in Functional Programming 第1巻 というものになんとなくわかりそうな記述が

次のような勘数群があったとして (Standard ML)、

fun add1a x =
  !x + 1;
fun add1b x =
  (x := !x + 1;
   !x);
fun add1c x =
  let val y = ref(!x)
  in y := !y + 1; !y
  end;

Standard ML assigns to all three of these functions the same shallow type. namely int ref -> int. The supplementary deep typing information which we can derive from the compiled bytecode representation of these function makes clear that the function add1b could not be used as a direct replacement for either of the others.

The deep type for that function will include a record that field x of the first object parameter to the compiled representation of the function will be updated at type INT. By using deep type inference to detect potantial updates of local state by code which has been downloaded from an untrusted source an aplication program can protect its correct functioning from potentially malicious updates to accessible sotre.

わかったようなわからないような…

■_

2013年09月07日

■_

無灯火信号無視の自転車を(ry

■_ 正規表現

例によってHNかreddit経由で知ったもの。 Ken Tompson が1968年に書いたものらしい。 Programming Techniques: Regular expression search algorithm http://www.fing.edu.uy/inco/cursos/intropln/material/p419-thompson.pdf

Programming Techniques: Regular expression search algorithm

A method for locating specific character strings embedded in character text is described and an implementation
of this method in the form of a compiler is discussed. The compiler accepts a regular expression as source
language and produces an IBM 7094 program as object language. The object program then accepts the text to be
searched as input and produces a signal every time an embedded string in the text matches the given regular
expression. Examples, problems, and solutions are also presented.

Algol-60 で書かれていて、IBM 7094の機械語を吐いたとかなんとか。

begin
  integer procedure get character; code;
  integer procedure instruction(op, address, lag, decrement); code;
  integer procedure value(symbol); code;
  integer procedure index(character); code;
  integer char, lc, pc;
  integer array stack[0:lO], code[O:300];
  switch switch := alpha, juxta, closure, or, eof;
  lc := pc := 0;
advance:
  char := get character;
  go to switch[index(char)];
alpha:
  code[pc] := instruction('tra', value('code')+pc+1, 0, 0);
  code[pc+l] := instruction('txl', valuc('fail'), 1, -char-l);
  code[pc+2] := instruetion('lxh', value('fail'), 1, -char);
  code[pc+3] := instruction('tsx', value('nnode'), 4, 0);
  stack[lc] := pc;
  pc := pc+4;
  lc := lc+l;
  go to advance;
juxta:
  lc := lc-1;
  go to advance;
closure:
  code[pc] := instruction('tsx', value('cnode'), 4, 0);
  code[pc+l] := code[stack[lc--1]];
  code[stack[lc-1]] := instruction('tra', value('code')+pc, 0, 0);
  pc := pc+2;
  go to advance;
or:
  code[pc] := instruction('tra', value('code')+pc+4, 0, 0);
  code[pc+l] := instruction('tsx', value('cnode'), 4, 0);
  code[pc+2] := code[stack[lc-1]];
  code[pc+3] := code[stack[le-2]];
  code[stack[le--2]] := instruction('tra', value('code')+pc+l, 0, 0);
  code[stack[lc--1]] := instruction('tra', value('code')+pc+4, 0, 0);
  pc := pc+4;
  lc := lc-1;
  go to advance;
eof:
  code[pc] := instruction('tra', value('found'), 0, 0);
  pc := pc+l
end

go to switch[index(char)]; みたいな書き方できたんすね。

で出力。

When the compiler receives the example regular expression, the following 7094 code is produced:
CODE    TRA    CODE+1               0   a
        TXL    FAIL,1,-'a'-1        1
        TXH    FAIL,1,-'a'          2
        TSX    NNODE,4              3
        TRA    CODE+16              4   b
        TXL    FAIL,1, -'b'-1       5
        TXH    FAIL,1, -'b'         6
        TSX    NNODE,4              7
        TRA    CODE+16              8   c
        TXL    FAIL,1,-'c'-1        9
        TXH    FAIL,1, -'c'        10
        TSX    NNODE,4             11
        TRA    CODE+16             12   |
        TSX    CNODE,4             13
        TRA    CODE+9              14
        TRA    CODE+5              15
        TSX    CNODE,4             16   *
        TRA    CODE+13             17
        TRA    CODE+19             18   .d
        TXL    FAIL,1,-'d'-1       19
        TXH    FAIL,1,-'d'         20
        TSX    NNODE,4             21
        TRA    FOUND               22   • eof

IBM 360 なら多少はわかるんですが…w なんとなーく、古いタイプのGNU regex の出力する擬似コードを連想するなあ などと思ったり。

REFERENCES
1. BRZOZOWSKI, JA Derivatives of regular expressions. J. ACM 11, 4 (Oct. 1964), 481-494.
2. KLEENE, SC Representation of events in nerve nets and finite automata. In Automata Studies, Ann. Math. Stud. No. 34. Princeton U. Press, Princeton, NJ, 1956, pp. 3-41.
3. IBM Corp. IBM 7094 principles of operation. File No. 7094-01, Form A22-6703-1.
4. KUNO, S., AND OETTINGER, AG Multiple-path syntactic analyzer. Proc. IFIP Congress, Munich, 1962, North-Holland Pub. Co., Amsterdam.

1 の ACM の記事が気になる…

■_ あれ?

javascript 値渡し?参照? | JavaScriptのQ&A【OKWave】 の回答のリンク先を見ると

関数と関数スコープ - JavaScript | MDN

オブジェクトではないパラメータ、例えば文字列、数値、真偽値などは、関数に 値によって 渡されます。値が関数に
渡されると、そこで新しい変数に格納されます。関数が変数の値を変更しても、その変更はグローバルスコープもしく
は呼び出し元の関数内に反映されません。オブジェクトであるパラメータ、例えばオブジェクト、配列、正規表現など
は、関数に 参照によって 渡されます。関数にオブジェクトをパラメータとして渡して、その関数がオブジェクトのプ
ロパティを変更すると、次の例にあるように、その変更を関数の外部から見る事が出来ます。

おいおいこれは…ということが書いてあったりするのだけど、 英文記事に当たると

Functions and function scope - JavaScript | MDN

The parameters of a function call are the function's arguments. Arguments are passed to functions by value.
If the function changes the value of an argument, this change is not reflected globally or in the calling
function. However, object references are values, too, and they are special: if the function changes the
referred object's properties, that change is visible outside the function, as shown in the following example:

こっちはおかしな記述にはなってない。 英語版の更新について行ってないとかいうパターンなのかしらん。

■_ 30周年

Celebrate GNU's big "three-o" — Free Software Foundation — working together for free software を読んでたら GNU supporters all over the world are planning their own celebrations, and we've listed them all on the 30th anniversary page. Events are currently in the works in Buenos Aires, Argentina, Cox's Bazaar, Bangladesh, Kitchener, Canada, Prague, Czech Republic, Paris, France, and Tokyo, Japan. Check back often for new additions. なんか東京でもあるっぽい。リンクを辿り辿りすると FSIJ 月例会 GNUプロジェクト30周年を記念して、FSIJでもワークショップ形式の集いを開催します。 ふむん。 でも開催時間帯がきびしめ。

■_

2013年09月06日

■_

ついったで見かけた気になる新刊

原著者はこの人かな Jack Copeland - Wikipedia, the free encyclopedia Jack Copeland is the Director of the Turing Archive for the History of Computing,[3] an extensive online archive on the computing pioneer Alan Turing. んでこれが原著っぽい Turing: Pioneer of the Information Age: Jack Copeland: 9780199639793: Amazon.com: Books Publisher: Oxford University Press, USA (January 20, 2013) 去年が生誕100周年だったから去年の本かと思ったけどちょっとだけ違った。

■_

Programming Techniques: Regular expression search algorithm http://www.fing.edu.uy/inco/cursos/intropln/material/p419-thompson.pdf

■_

くだすれPython(超初心者用) その18

144 デフォルトの名無しさん [sage] 2013/09/01(日) 23:03:47.61 ID: Be:
    a = 0
    b = 1

    a += 1
    b += 1

    これを
    a , b = 1, 1
    の要領で
    a, b += 1, 1
    ってやってみたのですがダメでした
    こんなかんじで書ける方法ってありませんか? 

145 デフォルトの名無しさん [sage] 2013/09/01(日) 23:29:46.63 ID: Be:
    ありませんですん 

146 デフォルトの名無しさん [sage] 2013/09/01(日) 23:41:57.07 ID: Be:
    >>144
    NumPy 

足す数が同じで、足される数がベクトルとか配列でいいのならR とか APL でも。 NumPy 知らない。

> v <- c(0,1)
> v + 1
[1] 1 2

R の場合。

■_

推薦図書/必読書のためのスレッド 70

417 デフォルトの名無しさん [sage] 2013/09/06(金) 00:58:35.65 ID: Be:
    数学の知識が絶望的なのですが、半日で読めるようなプログラマのための数学の基礎的な本はないでしょうか?

    集合や上界・下界の概念が載っているものがいいです 

419 デフォルトの名無しさん [sage] 2013/09/06(金) 01:07:48.44 ID: Be:
    >>417
    岩波の松坂和夫「数学読本」全6冊がベスト 

420 デフォルトの名無しさん [sage] 2013/09/06(金) 01:22:12.58 ID: Be:
    >>419
    まさにこういう本を求めていました! 

421 デフォルトの名無しさん [sage] 2013/09/06(金) 01:43:12.75 ID: Be:
    でも半日で読むのは無理 

422 デフォルトの名無しさん [sage] 2013/09/06(金) 01:49:58.07 ID: Be:
    >>420
    ほんとかよw よかったな 

423 デフォルトの名無しさん [sage] 2013/09/06(金) 02:06:12.39 ID: Be:
    高校レベルの数学からして怪しいですからw 

428 デフォルトの名無しさん [sage] 2013/09/06(金) 11:36:35.92 ID: Be:
    高1で数学に挫折した僕がアルゴリズムイントロダクションを読めるところまで辿り着くには
    どのような本で勉強すればいいでしょうか 

429 デフォルトの名無しさん [sage] 2013/09/06(金) 12:31:56.69 ID: Be:
    中学生レベルから数学をやり直せばいいと思うよ
    マジで 

431 ◆QZschizo.ptH [sage] 2013/09/06(金) 12:34:03.57 ID: Be:
    >>428
    http://www.amazon.co.jp/dp/448601863X
    はどうだろう?冗長さ、人によってはうざったらしいらしいが、それがかえっていいかもしれない 

432 デフォルトの名無しさん [sage] 2013/09/06(金) 12:49:19.13 ID: Be:
    >>428
    まずアルゴリズムイントロダクションを読んでみて、
    「ここまでは理解できた」という最前線を把握したほうがいいと思う。

    で、理解できないところ理解するための手段をそれから考える。

    それは他の書籍かもしれないし、ネット上の情報で済むかもしれない。
    あるいは、勉強会なんかに出るのもいい。 

433 デフォルトの名無しさん [sage] 2013/09/06(金) 15:36:42.06 ID: Be:
    >>432
    最初の数学的準備でもうアウトなんだが 

434 デフォルトの名無しさん [sage] 2013/09/06(金) 16:15:42.79 ID: Be:
    受験参考書でも読んだら
    細野真宏おすすめ 

435 デフォルトの名無しさん [sage] 2013/09/06(金) 16:19:27.35 ID: Be:
    大学受験板か数学板で聞いてこいや 

436 デフォルトの名無しさん [sage] 2013/09/06(金) 16:34:39.39 ID: Be:
    >>>429-435
    ありがとう。参考になりました。
    >>431の本に興味を持ったし、>>432を見て、読めないのわかってても
    まずは手を出すというやり方もなるほどと思った。

    >>429、>>434
    やっぱり高校数学は必要なんだね。こつこつやっていくことにします。 


数学読本。これすか。 Amazon.co.jp: 数学読本〈1〉数・式の計算/方程式/不等式: 松坂 和夫: 本

■_

「Pythonコードは欠陥が少ない」という調査結果 | スラッシュドット・ジャパン デベロッパー こーゆーのは英語記事も読まないとどうにもならない(と思う)ので読む。 Open-Source Python Code Shows Lowest Defect Density - Slashdot

■_

2013年09月05日

■_

鳥取大学って、ソフトウェアの信頼性とかでぐぐるとよくひっかかるのよねえ (その手のことをやっている研究室があるらしい)

また信号無視の自転車に横断歩道でぶつけられそうに

■_

Requiem for C - Uncle Bob [SkillsMatter/ACCU 2012] : programming Skills Matter : ACCU 2012: Uncle Bob (Robert C. Martin) on R

■_ 評価順序

gawk。

/* Expressions, not including the comma operator.  */
exp
	: variable assign_operator exp %prec ASSIGNOP
	  {
		if (do_lint && $3->lasti->opcode == Op_match_rec)
			lintwarn_ln($2->source_line,
				_("regular expression on right of assignment"));
		$$ = mk_assignment($1, $3, $2);
	  }

構文規則では代入は↑のようになっていて、さらに最後の mk_assignent はこう↓

/* mk_assignment --- assignment bytecodes */

static INSTRUCTION *
mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op)
{
	INSTRUCTION *tp;
	INSTRUCTION *ip;

	tp = lhs->lasti;
	switch (tp->opcode) {
	case Op_field_spec:
		tp->opcode = Op_field_spec_lhs;
		break;
	case Op_subscript:
		tp->opcode = Op_subscript_lhs;
		break;
	case Op_push:
	case Op_push_array:
		tp->opcode = Op_push_lhs; 
		break;
	default:
		cant_happen();
	}

	tp->do_reference = (op->opcode != Op_assign);	/* check for uninitialized reference */

	if (rhs != NULL)
		ip = list_merge(rhs, lhs);
	else
		ip = lhs;

	(void) list_append(ip, op);

	if (tp->opcode == Op_push_lhs
			&& tp->memory->type == Node_var
			&& tp->memory->var_assign
	) {
		tp->do_reference = false; /* no uninitialized reference checking
		                           * for a special variable.
		                           */
		(void) list_append(ip, instruction(Op_var_assign));
		ip->lasti->assign_var = tp->memory->var_assign;
	} else if (tp->opcode == Op_field_spec_lhs) {
		(void) list_append(ip, instruction(Op_field_assign));
		ip->lasti->field_assign = (Func_ptr) 0;
		tp->target_assign = ip->lasti;
	} else if (tp->opcode == Op_subscript_lhs) {
		(void) list_append(ip, instruction(Op_subscript_assign));
	}

	return ip;
}

= による代入だけでなく、*= やら += なんかもここで処理するのでちょっと分かりづらいけど ポイントは真ん中辺りの ip = list_merge(rhs, lhs); こいつ。

static inline INSTRUCTION *
list_merge(INSTRUCTION *l1, INSTRUCTION *l2)
{
#ifdef GAWKDEBUG
	if (l1->opcode != Op_list)
		cant_happen();
	if (l2->opcode != Op_list)
		cant_happen();
#endif
	l1->lasti->nexti = l2->nexti;
	l1->lasti = l2->lasti;
	bcfree(l2);
	return l1;
}

のように linked list をマージしているので、 ip = list_merge(rhs, lhs); だと代入の右辺にあった式を変換した結果が先に来る。 というわけで代入の右辺側が先に評価されていたと。

一方 mawk は

expr  :   cat_expr
      |   lvalue   ASSIGN   expr { code1(_ASSIGN) ; }
lvalue  :  ID mark LBOX  args  RBOX
           { 
             if ( $4 > 1 )
             { code2op(A_CAT, $4) ; }

             check_array($1) ;
             if( is_local($1) )
             { code2op(LAE_PUSHA, $1->offset) ; }
             else code2(AE_PUSHA, $1->stval.array) ;
             $$ = $2 ;
           }
        ;
p_expr  :  ID mark LBOX  args  RBOX   %prec  AND
           { 
             if ( $4 > 1 )
             { code2op(A_CAT, $4) ; }

             check_array($1) ;
             if( is_local($1) )
             { code2op(LAE_PUSHI, $1->offset) ; }
             else code2(AE_PUSHI, $1->stval.array) ;
             $$ = $2 ;
           }

大雑把には左辺の変換結果、右辺の変換結果、代入のオペコードという順序で 実行すると左辺が先に評価されてると。

■_

2013年09月04日

■_

へーあそこも改良工事する(できる)のね。 JR東日本、中央線御茶ノ水駅の本格的な改良工事に着手 - 聖橋口駅舎も移設 | マイナビニュース

pragprog の雑誌、有料化して再開っぽい。 The Pragmatic Bookshelf | Read Our Magazines Subscriptions and current issues are available at http://www.swaine.com/pragpub.

The Prose Garden | get pragpub, the magazine for software artists

Is it free?

No, but it’s dirt cheap
The current issue of PragPub will cost you a couple of bucks. For all this.

Wasn’t it free once?

Yes, but giving it away proved unsustainable. We decided to commit to this publication for the long haul, and
that meant coming up with a revenue stream.

What if I want home delivery?

Just tell us what you want. We will be rolling out more subscription and delivery models, but for now you can
download the current issue here for two bucks or subscribe for about twenty. 

Prose Garden Shop | The Prose Garden の画面を見て、フォーマットごとに別料金になるのかとびびったけど違ったw unsustainable ってのはまあそうだよねえと納得。 単月だと $1.99、一年分まとめてだと $19.99。 ということでどーんと一年分いってみた。

■_ deep

deep type inference とか

■_

gawkとmawkの違い - jarp,

あとでしらべる。mawk はわからんけど gawk はAST のトラバースの処理順になってる気がする。

■_

2013年09月03日

■_

なんか「メタプログラミング .NET」の翻訳がちょっと怪しくね? という話が(要確認)

■_

Brilliant or insane code? - Stavros' Stuff

Brilliant or insane code? - Stavros' Stuff

def GetContourPoints(self, array):
    """Parses an array of xyz points and returns a array of point dictionaries."""
    return zip(*[iter(array)]*3)
Brilliant or insane code? - Stavros' Stuff

UPDATE: In JuanManuel Gimeno Illa’s comment below, he mentions that this is actually the officially sanctioned
way to cluster an iterable into n-length groups by the Python documentation on zip(). That’s very interesting,
and clarifies this whole method.

Brilliant or insane code? | Hacker News

ところで

Thanks for posting this. For reference, <i>paste</i> is a standard UNIX utility... | Hacker News

Thanks for posting this. For reference, paste is a standard UNIX utility, whose purpose is to do all sorts of
useful things not limited to 2-tuples:

  $ seq 1 9 | paste - - -
  1	2	3
  4	5	6
  7	8	9

こんなことできたのかー>paste

■_

2013年09月02日

■_

「有頂天家族」を読んでみようかな。という気になっている。 有頂天家族 (幻冬舎文庫)
有頂天家族 (幻冬舎文庫)

■_ 日経ソフトウエア

あ、なんかこんな記事が 記者の眼 - 「お金儲けの話」は嫌いですか:ITpro

記者の眼 - 「お金儲けの話」は嫌いですか:ITpro

 そして「プログラミングによる自動取引」。この特集に関して調べるまで知らなかったのですが、FX取引では「MetaTrader」
というソフトがデファクトスタンダードになっているそうです。MetaTraderでは、C言語に似た言語でプログラムを書いて自
動売買を行うこともできます。「これだ」と思いました。

 ただFX取引では「強制ロスカットで数百万円が溶けた」といった怖い話もよく聞きます。いい加減なことは書けません。そ
こで、MetaTraderのプログラミングに関する書籍の執筆経験があり、実際のFX取引も行っている大学教授の方に、「FXとは
何か」というところから解説していただきました。 

まさにこの辺になんだろなーと感じたんだよなあ。 他の項目と比べて明らかに毛色が違う感じだし。

■_

本の虫: 最悪のプログラミング言語、BANCStar TL にこの話題が結構流れてきましたが The Worst Programming Environment in the World? | Hacker News の前にこんなのがありましてですね (なんでCOBOLのおばちゃまからこういう話に…w) Grace Hopper | Hacker News

Having had to deal with a little COBOL now and then, I wonder whether English wo... | Hacker News

Having had to deal with a little COBOL now and then, I wonder whether English words are really what makes for
readability. I am reminded of something that Jacques Barzun wrote long ago about English, that it is the density
of the thought, not the length of the words, that makes for difficulty in reading.


I did something like that once for a truly awful machine-language-like system I had to work with at a bank:

  8607,,,1
  11547,15475,22002,22002
  1316,1629,1,1649
  3001,1316,3,30078
  11528,22052,22002,22002
  9301,0,1528,1528
  31568,10001,800,107
  8560,,,1568
  8550,210,,
  3001,,,
  3100,1316,3,30089
  11547,15475,22002,22002
  3001,1316,3,30089
  3001,1317,3,10000
  8400,,,
  8550,700,801,
  3001,,,
  9301,0,522,522
  3000,1284,3,10001
  8500,,3,
  8500,,5,
  1547,,1,-2301

Through the translator, the result looked like this: https://github.com/jloughry/BANCStar/blob/master/README.md

The arrows in the margin duplicated the handwritten notation developed by programmers to deal with the numeric
machine code. If a colour printer had been available at the time, it would have duplicated the highlighter pens
those programmers used too; instead I used boldface, italics, underlining, and condensed characters to
accomplish the same thing.

That's classic! You should make a post out of that link—it's great HN material.


Done. We'll see what kind of shreds the HN community tears it into. This ought to be fun.

https://news.ycombinator.com/item?id=6311717

そして例のスレッド? になったと。

あ、こんなものもあったw I am a MUMPS programmer – Ask me anything | Hacker News

おばちゃまスレにはこういう発言も

I got to meet Grace Hopper many years ago. She gave me a nanosecond after her ta... | Hacker News

I got to meet Grace Hopper many years ago. She gave me a nanosecond after her talk. This was in the 1980s,
probably while she was working for DEC. It made quite an impression on me, and it's now framed on the wall. I
wish I'd gotten her autograph!

She was one of the original hackers. I don't think that she was a woman was ever relevant to her, and by the
force of her personality, and her efforts, she made it irrelevant to everyone else. For instance, I keep
forgetting it. Not that she was female, but that it was unusual that she was female. EG: she wasn't a
"Pioneer of Female Programmers", she was instead simply a "Computer Pioneer".

I don't know the specific barriers she had to overcome, but I know they must have been significant-- for much
of her career, people didn't really understand what computers even were. Even as late as the 1980s, talking
heads on TV would often say things that implied they thought computers were intelligent, or other equally silly
perspectives... because they were so new they had never been exposed to society at large. Now take that lack of
understanding in the population in general and project it onto the navy which, as a military, is generally lower
tech and more conservative? Of course she was in the research area, but there were certainly huge amounts of
misunderstandings she had to deal with in people who simply had never been educated about computers. So she gave
these talks that continued after she left the Navy and started working for DEC. She made it her mission to teach
people about this new technology. I can't imagine her refusing to speak at a conference simply because there are
more men than women-- I imagine most of the conferences she went to, she was the only female speaker.

PS- I think her handing out the nanoseconds was brilliant, as a teaching aid. She took an abstract concept and
made it physical. How rare is that these days? Plus if you can give someone something they're much more likely
to remember what you're trying to teach them. Even if it is a bit of old telephone wire... that mundane piece of
plastic and copper became imbued with the story she told.

Quite and impression!
I wish I'd gotten her autograph! うんうんw

■_

■_

わたし的にはbottomsか: つらつらぐさ うぃきぺにこういう記述が

装甲騎兵ボトムズ - Wikipedia

高橋は当初作品タイトルの『ボトムズ』の英語スペルをBottomsにするつもりであったが、商標上の問題により実現せず、やむをえずVotomsに変えたという経緯がある。

次は「ザンボット3」あたりが見たいな(饅頭怖い的な意味で)。 なにぶん大昔の作品なんで結構キツイと思いますよーw

2013年09月01日

■_

あ、ガンダムの股くぐり行ってなかっ○| ̄|_

何日か前の記事で村田(ベイスターズ→ジャイアンツ)がその時点での年間最多安打とかいうのを 知ってびっくりしたんだけど、月間最多安打記録を8月で更新してしまったという。 さらには7月、8月と月間打率が4割超えてるとか何が起きたんだ村者。 FA 移籍は立派な権利の行使なんだし、望み通り優勝争いできるチームでプレイできて良いよねえ… といいつつ心境は複雑なのであるw

なんだこれw サンタナがPCに入り込むッッ!! ジョジョBD8巻にUSBメモリ | マイナビニュース

某所でヒレガス本の原書を見かけたんですが、やっぱり アドレスを渡してポインター操作ってのを「pass by refference」って書いてました。 うむむ。

■_

そういやわたしももらってたんだよな。あのCD本。

フリーソフト作者の愚痴 41

662 仕様書無しさん [sage] 2013/08/01(木) 21:28:27.85 ID: Be:
    質問したいんだけど、みんなベクターつかってるの?
    >>178-204 あたりにベクターに対する愚痴が数件あって
    じゃ、どこにする?って結論がないまま終わっちゃってるんだけど
    結局、日本ではベクター以外ないってこと?
    使い難し遅いし他にないのかって思ってさ 

663 仕様書無しさん [sage] 2013/08/02(金) 06:47:57.34 ID: Be:
    そーすふぉーじじゃね? 

665 仕様書無しさん [sage] 2013/08/02(金) 16:07:36.27 ID: Be:
    自分でWebサイト立ち上げなよ
    下手なサイトに登録するよりよっぽど自由にやれる 

666 仕様書無しさん [sage] 2013/08/02(金) 16:20:46.10 ID: Be:
    ベクターは同ジャンルのソフトが多すぎて自分のソフトが埋まってしまうからな
    それを考えれば自分のサイトで公開してもたいした違いは無いってことになる
    マイナーすぎるジャンルのソフトならググればすぐに出てくるようになるだろうし
    ベクターで公開する意味はますます無い 

667 仕様書無しさん [sage] 2013/08/02(金) 20:29:57.88 ID: Be:
    >>663-666
    sourceforgeにあげるか自分のHPに誘導してそっちに自由に上げるってことか
    とりあえずファイル上げられるHPサービス探してみる

    ちょっとしか見てないけど、sourceforgeはオープンソースだし
    ベクターと比較すると知名度が低くアクセスが少ないんじゃないかと思う
    でも、とにかく情報ありがとう 

668 仕様書無しさん [sage] 2013/08/03(土) 00:39:30.92 ID: Be:
    ゲームならフリームとかあるけど。
    ベクターに登録するのは一定の集客があるからで
    それがなけりゃ全力で避けたい。 

669 仕様書無しさん [sage] 2013/08/04(日) 23:52:42.69 ID: Be:
    >>662
    ベクター使ってる。無料で本が貰えたから。当時は通信が高くて(何せ
    従量制だから)、ソフトが一杯入ったCD-ROMからの検索はお金が
    掛からないで便利だったから。

    Webオンリーになった時に、無料のホームページサービスで作ろうかと
    思ったけど、小容量だけどベクターがくれたから、そこでちまちまやって
    そのままって感じだな。 

672 仕様書無しさん [sage] 2013/08/05(月) 21:30:05.59 ID: Be:
    >>669
    結構前からの利用者ですね
    昔から使ってる人は、いまさらどこかへ行かないだろうし
    更新してない放置ソフトもいっぱいあるから
    やっぱりはじめにシェアとったベクターに勝るところはないか 

673 669 [sage] 2013/08/05(月) 21:46:44.72 ID: Be:
    >>672
    うん、PC-VANにアップしていたDOSソフトを登録したのがきっかけ。

    でも、>>184で書いたとおり、これからはベクターの無料容量分で公開
    するだけだから、データベースには載らないし、他で公開するのと変わら
    ないんだけど。まあ、いまさら他に移動するのも面倒と言うことで。 

674 仕様書無しさん [sage] 2013/08/05(月) 23:08:42.59 ID: Be:
    >>673
    PC-VANてなにって検索したら、すごい昔からのユーザさんですね

    たしかにframeworkとかインストーラとか使わないから容量必要ないし
    自分のHPにアップすれば
    とはいえベクターの5MBは少ない気がする 

675 仕様書無しさん [sage] 2013/08/06(火) 20:16:20.34 ID: Be:
    昔のパソ通はASCIINet、NiftyServe、PC-VANが大手御三家だからな
    フリーソフト文化的なものはニフティを中心に育ったと思われる

    CDが10枚ぐらい入ったフリーソフト&シェアウェアPACK for Winって、ベクターがやってたんだっけ
    当時フリーソフト作ってると収録させてくれませんか?ってメール来て、その10枚組が送られてきてウマーだった 

676 仕様書無しさん [sage] 2013/08/06(火) 21:08:32.62 ID: Be:
    あのVectorの本すげえよな
    あれ収録された作者全員に配ってたんだからすごいわ
    俺ももらった
    1万本とかいう単位で入ってるわけじゃん
    無料で配るだけでも1万部近くなるわけだろ
    どんくらい売れる本だったんだろ 

677 仕様書無しさん [sage] 2013/08/06(火) 21:18:04.20 ID: Be:
    >>675
    >フリーソフト文化的なものはニフティを中心に育った思われる
    雑誌とかパソコン通信に興味なかったから貴重な情報です

    NiftyServeのwiki読んだけど「崩壊~終焉」あたりの時代感は哀愁さえ漂うね
    この先ベクターとかフリーソフトってどうなるの?
    ゲームとかは別にして、モチベーション保ったままつづけてる作家(いわゆるプログラマ)って
    減ってるんじゃないかと思うんだけど 

679 669 [sage] 2013/08/09(金) 22:40:16.14 ID: Be:
    >>674
    私のソフトは小さいのがほとんど(30KB~180KB)だから、余り困らなかっ
    たり。数も少ないから、もう全然問題ないくらい。

    >>675-676
    最初は1枚だか2枚だかだったんだけど、最終的に12枚になったんだっけ
    かな。収納場所に困って全部古本屋行きになったから調べられないけど。
    本屋では出ると必ず平積み(地方の本屋)になってたから、そこそこ売れ
    ていたと思われる。でも、作者全員に送るのはさすがに凄いと思った。 

680 仕様書無しさん [sage] 2013/08/11(日) 15:28:20.01 ID: Be:
    国産フリーソフトって下火になっちまったな・・・
    http://engawa.2ch.net/test/read.cgi/poverty/1376197651/ 

681 仕様書無しさん [sage] 2013/08/11(日) 22:12:39.43 ID: Be:
    >>680
    作家的にROMると
    ・フリーソフトの未来は険しい
    ・お金に結びつけるならスマホアプリ
    ・日本のユーザはだめで、外人はいい
    ・英語できるやつは海外のサイトへ
    って感じか 

■_ RED

ちょっと前のタブから回収。 REBOL の派生だか強い影響を受けたらしいプログラミング言語。 これまた検索しにくい名前に(ry 説明のスライドを見た感じでは結構面白そうなんだけど、 多少の使いやすさとかではどうにもならんところがあるからねえ。使われるには。 The Red Programming Language : programming Red Programming Language: About

Red Programming Language: About

About

Red is a new programming language, strongly inspired by REBOL. Main characteristics are:

    Functional, imperative and symbolic
    Prototype-based object support
    Homoiconic (Red is its own meta-language)
    Both statically and JIT-compiled to native code
    Concurrency and parallelism strong support (actors, parallel collections)
    Low-level system programming abilities through the built-in Red/System DSL
    High-level scripting and REPL console support
    Highly embeddable
    Low memory footprint, garbage collected
    Low disk footprint (< 1MB)


It was announced and presented for the first time at ReBorCon 2011 conference (March, 2011). See the slides
below, explaining the reasons for building it, showing the main features and the roadmap.

■_

■_

9月の新刊予定で気になったものなど。

なんでS の本とか。

洋書編


一つ前へ 2013年7月(下旬)
一つ後へ 2013年8月(中旬)

ホームへ


リンクはご自由にどうぞ

メールの宛先はこちらkbk AT kt DOT rim DOT or DOT jp