D言語 Part8

このエントリーをはてなブックマークに追加
952デフォルトの名無しさん:2006/04/29(土) 14:11:26

0.156 な件
953デフォルトの名無しさん:2006/04/29(土) 14:52:44
0.155にデバッグ出力が残ってたそうで
954デフォルトの名無しさん:2006/04/29(土) 14:54:34
Walterさんは相変わらずうっかりさんだなw
955デフォルトの名無しさん:2006/04/29(土) 15:21:12
D 0.155(0.156)

New/Changed Features

* Added Microsoft windbg.exe Win32 debugger.
* Removed std.recls, instead use http://synesis.com.au/software/recls/.
* Incorporated Dave Fladebo's changes:
o std.regexp speedups.
o Fixed a bug in pauseHandler whereby the stackTop was being overwritten by subsequently
resumed threads causing a crash in gcx.mark(). (The fix was to just move sem_post(&flagSuspend);
to right before the sigsuspend loop).
o Moved linux semaphore declarations to std/c/linux/linux.d
o Changed void wait(uint milliseconds){} to be a timed wait function instead of just a stub for void wait() {}
on linux (it is comparable to the Win32 Thread method now). This is implemented with pthread mutexes
and conditions and the extra overhead to initialize phobos Threads does not result in slower executables
(Threads, GC and startup time are not effected).
o Changed the allThreads static array size to the same as Windows. This in conjunction w/ the stack size
change will allow the creation of more than 100 threads on linux for better compatibility w/ the Win32 version.
o Added optional stack size parameter to constructors. Since the stackBottom is static when the threads
are created and the stackTop is dynamic based on the stack pointer (or context for Win32), allowing the threads
to be created with a non-default stack size shouldn't interfere with the GC. This adds little overhead to either
the Win32 or Linux Thread implementations.
956デフォルトの名無しさん:2006/04/29(土) 15:23:54
で、結局D用のGUIライブラリはどれが標準なの?
957デフォルトの名無しさん:2006/04/29(土) 15:35:58
>>956
ない。
まだコンパイラも安定してない状況で求めるのが以下略
958デフォルトの名無しさん:2006/04/29(土) 16:36:44
DからCのiconvを使ってみたんですけどうまく動作しません。
どこがいけないんでしょう?

import std.string;

typedef void* iconv_t;

extern (C) iconv_t iconv_open(char* tocode, char* fromcode);

extern (C) size_t iconv(iconv_t cd, char** inbuf, size_t* inbytesleft, char** outbuf, size_t* outbytesleft);

extern (C) int iconv_close(iconv_t cd);

void main()
{
    char[] str = "テスト文字列";

    char* src = toStringz(str);
    size_t srcSize = 19;

    char* dst = new char[1024];
    size_t dstSize = 1024;
    for (size_t i = 0; i < dstSize; ++i) dst[i] = 0;

    iconv_t ic = iconv_open("EUC-JP", "UTF-8");
    iconv(ic, &src, &srcSize, &dst, &dstSize);
    iconv_close(ic);

    printf("%s\n", dst);
}
959デフォルトの名無しさん:2006/04/29(土) 19:56:36
どううまく動作しないのか症状が書かれてないから適切な回答ができない。
環境もわからない。
960958:2006/04/29(土) 20:17:17
環境:linux
症状:dstが全く書き換えられていない。

どうもポインタのポインタの内容がCの関数側でおかしくなっているみたいですね。
これから詳しく調べてみます。
961デフォルトの名無しさん:2006/04/29(土) 20:37:30
ここは一つ、C、あるいはC++で記述してはどうか。
962デフォルトの名無しさん:2006/04/29(土) 20:39:45
>>958
iconv()の第4引数は変更されるらしいから、呼び出し前に退避させておかないといけないはず。

    iconv_t ic = iconv_open("EUC-JP", "UTF-8");
    iconv(ic, &src, &srcSize, &dst, &dstSize);
    iconv_close(ic);

    printf("%s\n", dst);

        ↓

    iconv_t ic = iconv_open("EUC-JP", "UTF-8");
    char* dst_buf = dst;
    iconv(ic, &src, &srcSize, &dst_buf, &dstSize);
    iconv_close(ic);

    printf("%s\n", dst);

こうだと思う。
963958:2006/04/29(土) 21:02:57
>>962
あ、できました。ありがとうございます。
確かにCのサンプルコードもdstにあたるものを退避させてます。
964デフォルトの名無しさん:2006/04/29(土) 23:54:49
愛昆布
965デフォルトの名無しさん:2006/04/30(日) 14:46:26

http://www.dprogramming.com/~gregorr/gdc.php

The 'gdc-Ego' branch of GDC is a highly experimental branch of GDC with patches by Gregor Richards,
using the the DMD 0.156 frontend. Furthermore, it has fixes to several bugs that were in GDC 0.17 which
caused inconsistencies between DMD and GDC. It's experimental and has known bugs, but should allow
you to compile D software that is only compatible with the latest DMD.

http://www.dprogramming.com/~gregorr/GDC-d-Ego-0.156.1.tar.bz2
966デフォルトの名無しさん:2006/04/30(日) 15:24:07
GDCのgdc-EgoブランチはGregor Richardsのパッチを入れたGDCのとても実験的なブランチです。
DMD 0.156のフロントエンドを利用しています。
さらに、GDC0.17にあったDMDとGDCの間の矛盾を引き起こしていたいくつかのバグを修正しています。
実験的で存知のバグも存在していますが、最新のDMDとしか互換性がないD言語で書かれたソフトウェアをコンパイルできるべきです。
967デフォルトの名無しさん:2006/04/30(日) 19:47:32
The gdc-Ego branch of GDC is a very experimental branch of GDC that puts the patch of Gregor Richards.
The front end of DMD 0.156 is used.
In addition, the bug of shoes that want to cause the contradiction between DMD and GDC that exists in GDC0.17 is corrected.
The software written in only latest DMD and an incompatible D language should be able to be compiled though the bug of knowing exists experimentally, too.
968デフォルトの名無しさん:2006/04/30(日) 22:59:37
char[]ってchar*と違ってバイナリに何か仕込まれるんですか?
969デフォルトの名無しさん:2006/04/30(日) 23:12:57
Egoブランチをビルドしてみようとしたけどinteger_tで突っかかる。

Mac OS X 10.3.9

/usr/include/mach/ppc/vm_types.h:86: error: conflicting types for `typedef int integer_t'
../../gcc/d/dmd/mars.h:146: error: previous declaration as `typedef long long unsigned int integer_t'
970デフォルトの名無しさん:2006/04/30(日) 23:18:46
>>969

> Ran into some kind of error with "gcc/d/dmd/expression.c":
> {standard input}:26:FATAL:Symbol __ZN10IntegerExp1tE already defined.

Looks like it was a botched macro integration from upstream...

Will bugreport the "mars.h" header file from DMD to Bugzilla,
but here's the trivial patch needed for the gdc-Ego snapshot:

--- gcc/d/dmd/mars.h.orig Sat Apr 29 04:56:03 2006
+++ gcc/d/dmd/mars.h Sun Apr 30 00:45:13 2006
@@ -131,7 +131,6 @@

#ifdef __DMC__
typedef _Complex long double complex_t;
-#elif IN_GCC
#else
#ifndef IN_GCC
#include "complex_t.h"

It wasn't defining the "integer_t" type properly on __APPLE__
(integer_t is a system type, so it uses dmd_integer_t instead)

--anders

かな?
971デフォルトの名無しさん:2006/04/30(日) 23:36:51
>>970
それだ。コンパイルは通った
972デフォルトの名無しさん:2006/04/30(日) 23:48:54
>>966
直接関係ないのだが、DMD 0.156 ってもうでてたっけ?

>>968
char[]だと、ポインタだけじゃなくて配列の長さも管理されてる。
(なので32bitマシンだとchar[]は大抵8Byte)
973デフォルトの名無しさん:2006/05/01(月) 00:02:37
ちょっと、キョン!当然あたしたちのCD予約したわよね?
――えっ、まだしてないの?あんた、SOS団の一員としての自覚あるの?
――何、「曲のほうは?」って?それなら心配いらないわ!
なんったって、団長のあたしが保証するんだから間違いないわ!
一度聴いたら、ぜ〜〜ったい踊りたくなるんだから!
涼宮ハルヒの憂鬱ED「ハレ晴レユカイ」5月10日発売!
絶対買いなさい!!
974デフォルトの名無しさん:2006/05/01(月) 00:14:52
975デフォルトの名無しさん:2006/05/01(月) 01:02:38
どうでもいいがdelegateも8byteくらいの予感
976デフォルトの名無しさん:2006/05/01(月) 06:34:37
スタックと関数のポインタだから、そうなるだろうね。

実際は、当然ながら実装依存なわけだが。
977デフォルトの名無しさん:2006/05/01(月) 18:51:07
引数が何であっても入れることのできるdelegateってないかな?
978デフォルトの名無しさん:2006/05/01(月) 19:00:58
>977
呼び出しの際の扱いに苦労しないか、それ?
979デフォルトの名無しさん:2006/05/01(月) 19:08:33
>>978
適当にスタックにプッシュするだけでオーケーだよお兄さん。
980デフォルトの名無しさん:2006/05/01(月) 20:06:35
utf8→sjis変換テンプレートはすぐ出来たけどその後がダメポ。
変換テーブルをstatic ifにしようが巨大文字列リテラルの一部参照にしようが
static ifを上位ビットからの分木構造にしようが使い物にならない。
多分コンパイラの字句解析が時間を食ってるんだろう。
分木で別のモジュールをimportするようなものなら字句解析時間をごっそり削れると思うけど
漏れはモウダメポなんであとはこのスレの住人にまかせる。


変換テーブルを生成するために作ったもの
ttp://www.uploda.org/uporg378043.zip

変換テンプレートとstatic if変換テーブル
ttp://www.uploda.org/uporg378045.zip
(utf8形式のソースでコンパイルして
windowsのchcp932のコンソールで実行した環境しか試してないが)

テンプレート名もシンボル名も自由に変えてOK。
色々変更加えてOK。
981デフォルトの名無しさん:2006/05/01(月) 20:45:11
今、DでDOM実装してるんだがつくづくDらしくねえ・・・
982デフォルトの名無しさん:2006/05/01(月) 20:47:10
ttp://d.hatena.ne.jp/rinset/20060328
ttp://www.kmonos.net/alang/d/declaration.html

暗黙の型推論とRAIIのためにautoキーワードが使われているわけだけど,
何か両立させたくない理由あるのかな.
何もないなら普通に別のキーワードを使って可能にして欲しいんだけど.

type a = new C(); // 暗黙の型推論
auto C b = new C(); // RAII
auto type c = new C(); // 暗黙の型推論とRAII

こんな感じにすればいいだけなんじゃないのかと.
983デフォルトの名無しさん:2006/05/01(月) 20:50:38
>>559-570
なんか既出だったみたいですね
次スレ近づけてすまん
984デフォルトの名無しさん:2006/05/02(火) 07:34:39
>>957
dwtじゃないの?
985デフォルトの名無しさん:2006/05/02(火) 13:01:49
>>984
そういう話が出てたのは知ってるが、決定なの?
あ、俺は>>957じゃないが。
986デフォルトの名無しさん:2006/05/02(火) 13:20:43
デファクトスタンダード≠標準
987デフォルトの名無しさん:2006/05/02(火) 14:55:15
I believe that DWT is the best chance for D to get a comprehensive,
portable, top quality GUI given our limited resources.
だそうです。

http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/32633
988デフォルトの名無しさん:2006/05/02(火) 14:59:44
SWTがイマイチだから試してないけどDWTもなあって感じだな。
特にTable廻りとか。
989デフォルトの名無しさん:2006/05/02(火) 18:49:04
dwtいいとおもうよ。dflに比べたらだけど。
Linux版ほしい。
>>988
そんなあなたのおすすめはなんでしょうか。
990デフォルトの名無しさん:2006/05/03(水) 20:39:44
991デフォルトの名無しさん:2006/05/05(金) 01:19:12
>>985
ニュースグループで「とりあえず今はdwtがよさそうだし、もっと良いのができたら後から変更すればいい」みたいなことを
walterタソが言ってたような気がする。
digitalmars.D.dwtもあるし。
992デフォルトの名無しさん:2006/05/06(土) 14:53:38
ぬるぽ
993デフォルトの名無しさん:2006/05/06(土) 16:47:54
>>992
ガッ
>>990
おつりんこ
994デフォルトの名無しさん:2006/05/06(土) 18:18:20
次スレがあるんだから
もう、埋めようぜ
995デフォルトの名無しさん:2006/05/06(土) 18:18:58
996デフォルトの名無しさん:2006/05/06(土) 18:19:59
997デフォルトの名無しさん:2006/05/06(土) 18:20:34
998デフォルトの名無しさん:2006/05/06(土) 18:21:05
999デフォルトの名無しさん:2006/05/06(土) 18:24:47
1000
1000デフォルトの名無しさん:2006/05/06(土) 18:26:13
10011001
このスレッドは1000を超えました。
もう書けないので、新しいスレッドを立ててくださいです。。。