Valaãããžã§ã¯ãã¯2006幎ã«äœæãããŸããããäžè¬ãŠãŒã¶ãŒãå€ãã®éçºè
ã®éã§ã¯ãŸã ã»ãšãã©ç¥ãããŠããŸããã ãããäœã§ãããããããŠæãéèŠãªããšã«ã¯ããªããããå¿
èŠãªã®ãç解ããŠãã人ã¯ã»ãšãã©ããŸããã ãããŠããŽã¡ã©ã®ãã·ã¢èªã話ãITã³ãã¥ããã£ã®äžã§ãããã¯ãŸã£ããç¥ç§çã§ããããã®äž»é¡ã«é¢ããèšäºã¯ã»ãšãã©ãããŸããã ç§ã¯çŸåšã®ç¶æ³ããããã«ä¿®æ£ãããã®æè¡ã«ã€ããŠå°ãæ€èšããããšã«ããŸããã
Linuxã§ã®ãã¹ã¯ãããéçºã®çŸç¶
é ãããè¡ããã ãã¹ã¯ãããLinuxã§ã¯ã2ã€ã®ãã¯ãããžãŒïŒQtãšGtkïŒãé·ãéæ¯é
ãããŠããŸããïŒ2ã€ã®ç°ãªãäžçãšèšããŸãïŒã æ··ä¹±ãé¿ããããã«ãQtã¯GUIãæ§ç¯ããããã®ã©ã€ãã©ãªã§ããã ãã§ãªããGtkã¯GLibã«åºã¥ããã«ã¹ã¿ãã¯ã®å€ãã®ã©ã€ãã©ãªã®1ã€ã«ãããªãããšã«æ³šæããŠãã ããã ãããã£ãŠããã¹ã¯ãããã¯ããããã®ãã¯ãããžãŒã«åºã¥ãã2ã€ã®ãã¹ã¯ãããç°å¢-KDEãšGnomeã«åå²ãããŸãã
Qtã䜿çšããäžéšã®éçºè
ã«ãšã£ãŠã¯ããã¹ãŠãéåžžã«ã¹ã ãŒãºã§ã¯ã©ãŠãã¬ã¹ã§ãã 现é·ãçŸããAPIã䟿å©ãªéçºããŒã«ãåªããããã¥ã¡ã³ãã倧èŠæš¡ãªã³ãã¥ããã£ããããŸãã Gtkã®äžçã§ã¯ãã¹ãŠãããã»ã©ãã©è²ã§ã¯ãããŸããã æåã¯ãéçºã¯Cèšèªã§è¡ãããŸãããã®èšèªã§ã¯ãå€ãã®æœè±¡åãšèŠåã䜿çšããŠGLibãå®è£
ãããŸããããã¯ãCã«ã¯ãªãã£ãæ¬æ Œçãªãªããžã§ã¯ãã¢ãã«ã§ãã GLibã䜿çšããã¢ããªã±ãŒã·ã§ã³ã®ã³ãŒãã¯éåžžã«å¥åŠã«èŠããã»ãšãã©ã®äžè¬çãªGUIã©ã€ãã©ãªã®éçºè
ãæ
£ããŠãããã®ãšã¯ãŸã£ãã䌌ãŠããŸããã ããã«ãèšèªèªäœã¯ããã®ã¬ãã«ãäœããããã°ã©ãã£ã«ã«ã€ã³ã¿ãŒãã§ã€ã¹ãåããããã°ã©ã ã®éçºã«ã¯åœ¹ç«ã¡ãŸããã
ãã®çµæãGnomeã®éçºè
ã«ã¯ããã€ãã®åé¿çããããŸãã 1ã€ç®ã¯ãQtã§èšè¿°ããã¢ããªã±ãŒã·ã§ã³ãä»ã®ã¢ããªã±ãŒã·ã§ã³ãšæ¯èŒããŠç°è³ªã«ãªããªãããã«ããããšã§ãã 2ã€ç®ã¯ãGtkã«ãã€ã³ããããŠããã¹ã¯ãªããèšèªã䜿çšããããšã§ãã ãããŠããããã®ååãªãã®ããããŸãïŒPythonãRubyãLuaãLispãPerlãããã«ã¯PHPã 3çªç®ã¯ãJavaã§èšè¿°ããããšã§ãã ããããã¹ãŠã®ãœãªã¥ãŒã·ã§ã³ã«ã¯ãå©äŸ¿æ§ãšéçºæéã®ççž®ãšããæãããªå©ç¹ããããŸãã ããããæ¬ ç¹ããããŸãã ãŸã第äžã«ãããã¯å®è¡é床ã§ããããã¯ãCèšèªãšæ¯èŒããŠãã¹ã¯ãªããèšèªã§ã¯èããäœãã§ãã ããã°ã©ã ã®èµ·åé床ãäœäžããŸãã Qtã«ã¯ãããã®æ¬ ç¹ã¯ãããŸããããäžèšã®ç°è³ªæ§ã¯ãè¿å¹Žå€§å¹
ã«å¹³æºåãããŠãããšã¯ãããæããããŸãã
ããããæè¿éäžçã«æäŸããŠããäž»ãªãªãã·ã§ã³ã¯Monoã§ãã ã€ã³ã¿ãã¥ãŒã§ãéçºè
ã®1人ã¯æ¬¡ã®ããã«èšã£ãŠããŸãã ãããŠã圌ã«å察ããã®ã¯é£ããã§ãã Monoã¯ãææ°ã§é«ã¬ãã«ã®CïŒèšèªã䟿å©ãªMonoDevelop IDEãåºç¯ãªã³ãã¥ããã£ãæäŸããŸãïŒããã¯ãGtkã¢ããªã±ãŒã·ã§ã³éçºã§ã¯ãªããäž»ã«CïŒã®åé¡ãçŽæ¥æ¯æŽã§ããããšã«æ³šæããŠãã ããïŒã ããã§ããã ãã ããMonoã¯ãã¹ãŠåãåé¡ããããããŸãã èµ·åãšå®è¡ã®é床ã¯ãååã§ã¯ãããŸãããCã®é床ãããèããäœãã§ãã ããã«ãMonoã¯Gnomeã®äžèœè¬ã«ã¯ãªãåŸãŸãããããã¯ãMonoã§åå¥ã®ãœãããŠã§ã¢ã®ã¿ãéçºããããšãå¯èœã§ãããç°å¢èªäœãŸãã¯ã©ã€ãã©ãªã®åœ¢ã§ã®ãã®éšåãéçºã§ããªãããã§ãã
ãã®ç¶æ³ã§Gnomeãããžã§ã¯ãããããŸããã ã«ã¹ã¿ã ãœãããŠã§ã¢ã¯å¿å°ãããã®ã§æžãããŠããŸãããå
ã®Cã§ã¯æžãããŠããŸããã åœç¶ãäŸå€ããããŸããããããã¯Cã§ãã¹ã¯ããããœãããŠã§ã¢ãäœæããéçºè
ãæ¯èŒçå°ãªããšããäºå®ãå€æŽãããã®ã§ã¯ãããŸããã ãããŠãæ¯å¹Žãã®æ°ã¯æããã«å¢å ããŠããŸããã ã·ã³ãã«ã§ãšã¬ã¬ã³ããªãœãªã¥ãŒã·ã§ã³ãå¿
èŠã§ããã ãæ³åã®ãšããã圌ã®ååã¯Valaã§ãã
ãŽã¡ã©ãšã¯
ãŸã第äžã«ãValaã¯ãJÃŒrgBillerterãšRaffaele Sandriniã®2人ã ãã2006幎ã«ç«ã¡äžãããããžã§ã¯ãã§ãã Gtkéçºè
åãã®äŸ¿å©ã§ææ°ã®ããŒã«ããããäœæãããšã³ããªã®ãããå€ã倧å¹
ã«äžããããã«èšèšãããŸããã ãã®ãããžã§ã¯ãã¯ãValaãšGenieã®2ã€ã®èšèªã§æ§æãããŠããŸãã å®éãäž¡æ¹ãšããŸã£ããåãã§ãããæ§æã¯ç°ãªããŸãã Valaã¯CïŒãšJavaã«éåžžã«äŒŒãŠããŸãããGenieã¯PythonãšBooãšå€ãã®å
±éç¹ãæã£ãŠããŸãã Valaã®æ¹ã人æ°ããããããããã«ã€ããŠèª¬æããŸãã
Valaã®æŠå¿µã¯éåžžã«åçŽã§ããã³ãŒãã¯äŸ¿å©ãªé«çŽèšèªã§èšè¿°ãããæãäžè¬çãªCã³ãŒãã«å€æãããå®è¡å¯èœãªãã¡ã€ã«ãŸãã¯ã©ã€ãã©ãªã«ã³ã³ãã€ã«ãããŸãã ãããŒããã£ã¹ãã®ééæ§ã«ããããªãŒããŒããããå®å
šã«ãªããªããŸãã ã€ãŸããValaã§éçºããå ŽåãValaã«é¢é£ããè¿œå ã®ã©ã€ãã©ãªããã©ãã°ããªãã§ãã ããã ãã®æ©èœã«ã¯å¥ã®å©ç¹ããããŸã-å®å
šãªãã€ããªäºææ§ã ããã¯ãValaã§ã©ã€ãã©ãªãèšè¿°ã§ããCã³ãŒãïŒãŸãã¯ãã€ã³ãã£ã³ã°ãããå Žåã¯ä»ã®èšèªïŒãã䜿çšã§ããããšãæå³ããŸãã ãããã£ãŠãValaã¯ãã«ã¹ã¿ã ãœãããŠã§ã¢ã ãã§ãªããGnomeç°å¢èªäœãŸãã¯ãã®ãããžã§ã¯ãã®åã
ã®ã©ã€ãã©ãªã®éçºã«ãé©ããŠããŸãã
ããã°ã©ãã³ã°èšèªã«ã¯ãæãæçœãªåé¡ã解決ããããã®äžé£ã®é¢æ°ãŸãã¯ã¯ã©ã¹ãåããæšæºã©ã€ãã©ãªããããŸãã Valaã§ã¯ããã®åœ¹å²ã¯äžé£ã®æšæºãã€ã³ãã£ã³ã°ã«ãã£ãŠæããããŸãã éçºè
ã¯ãGnomeãæ§ç¯ãããŠããã©ã€ãã©ãªã®ã¹ã¿ãã¯å
šäœãèªç±ã«äœ¿çšã§ããŸãã ããã¯ãValaã§éåžžã«å€§èŠæš¡ã§è€éãªãããžã§ã¯ããããã«äœæã§ããããšãæå³ããŸãã ãã€ã³ãã£ã³ã°ã®å®å
šãªãªã¹ãã¯
ããã«ãããŸã ã ãã€ã³ãã£ã³ã°ã¯ãã©ã€ãã©ãªé¢æ°ãšæ§é ãã¯ã©ã¹ãåå空éãã¡ãœãããªã©ã«ã©ã®ããã«é¢é£ãããã翻蚳è
ã«èª¬æããvapiãã¡ã€ã«ã§ãã æ¢åã®ã©ã€ãã©ãªãŸãã¯Cã³ãŒããžã®ç¬èªã®ãã€ã³ãã£ã³ã°ãäœæã§ããŸãã
èšèªã®è©³çŽ°
åè¿°ã®ããã«ãValaã¯CïŒãšJavaã«éåžžã«äŒŒãŠããŸãã å®éã®ãã€ãã£ãããããã£ãã·ã°ãã«ããžã§ããªãã¯ãšããªã²ãŒããæœè±¡ã¯ã©ã¹ãšã€ã³ã¿ãŒãã§ã€ã¹ããããŸãã å€éç¶æ¿ã¯ãããŸããããã¯ã©ã¹ãšã€ã³ã¿ãŒãã§ãŒã¹ããåæã«ç¶æ¿ã§ããŸãã ãŸããValaã®ã€ã³ã¿ãŒãã§ãŒã¹ã«ã¯æ¬æ Œçãªã¡ãœãããå«ããããšãã§ãããããåé¡ãéšåçã«è§£æ±ºãããŸãïŒååšããå ŽåïŒã ã¡ãœããã®ãªãŒããŒããŒãããããŸããã ãã ããããã©ã«ãã®ãã©ã¡ãŒã¿ãŒãšååä»ãã³ã³ã¹ãã©ã¯ã¿ãŒããããŸãã ããããã£ã¯å€æŽæã«ä¿¡å·ãéä¿¡ãããããéåžžã«äŸ¿å©ã§ãã Valaã¯ãã¯ããŒãžã£ãŒãšã¢ãžã¥ãŒã«ã®ééçãªã€ã³ããŒãããµããŒãããŠããŸãã äžè¬çã«ãããã¯ååãªè¡šçŸåã®ããããŒã«ãåããåæã«CïŒéçºè
ã«ãªãã¿ã®é倧床ãä¿æããçŸä»£çã§çŸããããã°ã©ãã³ã°èšèªã§ãã Valaã®ã¡ã¢ãªç®¡çã¯èªååç
§ã«ãŠã³ãã«ãã£ãŠè¡ããããããéçºè
ã¯åžžã«ããã«ã€ããŠèããå¿
èŠã¯ãããŸããã ããããããšãã°C ++ã®ããã«ãæåå¶åŸ¡ã®å¯èœæ§ããããŸãã
ãã¿ã³ãã¯ãªãã¯ãããšã¡ãã»ãŒãžã衚瀺ããåçŽãªãŠã£ã³ããŠããã°ã©ã ã®äŸã次ã«ç€ºããŸãã
using Gtk;
public static int main ( string [] args) {
Gtk.init ( ref args);
Window window = new Window(WindowType.TOPLEVEL);
window.set_size_request(100, 100);
window.destroy.connect(main_quit);
Button button = new Button.with_label( "Push me" );
button.clicked.connect(() => {
MessageDialog msg = new MessageDialog(window, DialogFlags.MODAL,
MessageType.INFO, ButtonsType.OK, "Some message" );
msg.run();
msg.close();
});
window.add(button);
window.show_all();
Gtk.main();
return 0;
}
* This source code was highlighted with Source Code Highlighter .
ç§ã¯ããªãããã¹ãŠã®è¡ã解æããã¹ãã§ã¯ãªããšæããŸãããšã«ãããã¹ãŠãæ確ã§ãªããã°ãªããŸããã èšèªã®åºæ¬ã«ã€ããŠã®è©³çŽ°ã¯ã
å
¬åŒãã¥ãŒããªã¢ã«ã«èšèŒãããŠããŸãã ãã®äŸãã³ã³ãã€ã«ããã«ã¯ãã³ã³ãœãŒã«ã«æ¬¡ã®è¡ãå
¥åããå¿
èŠããããŸãïŒã³ãŒããtest.valaãã¡ã€ã«ã«ä¿åãããŠããå ŽåïŒã
valac test.vala --pkg gtk+-2.0 -o test
ããŒã«ããã
Valaãããžã§ã¯ãã¯ãCèšèªã®Valaããã³Genieèšèªã®ç¿»èš³è
ãæäŸããŸãã äžè¬çãªãã£ã¹ããªãã¥ãŒã·ã§ã³ã§ã¯ãå
¬åŒãªããžããªã«ãããŸãã ãã ããååãšããŠããããã¯å»æ¢ãããããŒãžã§ã³ã§ãã ãããã£ãŠãææ°ã®ããã±ãŒãžãå«ãè¿œå ã®ãªããžããªãæ¢ãããšããå§ãããŸãã ããšãã°ãUbuntuã®å Žåã
vala-teamããããŸãã
Valaã«ã¯ããã€ãã®IDEããããŸãïŒããããåŒã³åºãããšãã§ããå ŽåïŒã ãŸãã
ValïŒaïŒIDEã§ãã 匷調衚瀺ã§ããã®ã¯ããã£ã¬ã¯ããªããªãŒããããžã§ã¯ããã¡ã€ã«ã®ãªã¹ããèªåè£å®ïŒãããŸã§ã®ãšããéåžžã«åŒ±ãïŒãç¬èªã®ãã«ãã·ã¹ãã ãããã³ãµãŒãããŒãã£ã·ã¹ãã ã®ãµããŒãã§ãã äœãèšå®ããå¿
èŠã¯ãããŸããããã¹ãŠãèªåçã«çµã¿ç«ãŠãããèµ·åãããŸããã³ãŒããæžãæéãããã ãã§ãã
Valaã®ãµããŒãã¯
MonoDevelopãš
Anjutaã§çºè¡šãããŸããããå人çã«ã¯ããããã®ç°å¢ã¯æ¯æŽãããã³ãŒãã®äœæã劚ããå¯èœæ§ãé«ããšããå°è±¡ãåããŸããã
ãããŠæåŸã«ãç§ãèªåã§äœ¿çšãããã®ïŒ
Valenciaã¯Geditã®ãã©ã°ã€ã³ã§ãã 圌ã¯èªåè£å®ãšValaã®ã·ã³ãã«ã®ãªã¹ããGnomeã®æšæºãšãã£ã¿ãŒã«ãããããŸãã ãã¡ãããããã§ã¯ååã§ã¯ãããŸããããå°ãªããšãã³ãŒãã®äœæã劚ããããšã¯ãããŸããã Valaã®éçºããŒã«ã®å®å
šãªãªã¹ãã¯ã
httpïŒ//live.gnome.org/Valaã®IDEãµããŒãã»ã¯ã·ã§ã³ã«ãããŸãã
ããããããã°ã©ã ãäœæããã«ã¯ã1人ã®ãšãã£ã¿ãŒã§ã¯äžååã§ãã ãã«ãã·ã¹ãã ãå¿
èŠã§ãã ãªãŒãã³ãœãŒã¹ã®äžçã§ã¯ã
CMakeã®äººæ°ãé«ãŸã£ãŠããŸãã ããã¯éåžžã«æè»ã§åŒ·åãªãœãªã¥ãŒã·ã§ã³ã§ããã... Valaã®ãµããŒãã¯ãããŸããã ãã ããããã¯äžæçãªçŸè±¡ã§ããã次ã®ãªãªãŒã¹ãŸã§ã«ããã®è¿·æãªçç¥ãä¿®æ£ããããšãçŽæããŠããŸãã ãããŸã§ã®éããããžã§ã¯ãã®éçºè
ã¯ãValaã§ããã°ã©ã ããã«ãããããã«å¿
èŠãªã¹ã¯ãªãããå«ã
ç¹å¥ãªãã¯ãã䜿çšã§ããŸãã
ãŸããPythonã§èšè¿°ããããã«ãã·ã¹ãã ã§ãããValaã®åæãµããŒãããã
Wafã¯ç¡èŠã§ããŸããã ã¹ã¯ãªããã¯Pythonã§èšè¿°ãããŠãããããã¢ã»ã³ããªã«å¿
èŠãªãã®ãã¹ãŠãšç¡éã®æè»æ§ãåããéåžžã«äŸ¿å©ãªã·ã¹ãã ã§ãã ãã ãã1ã€ã®é倧ãªæ¬ ç¹ããããŸãããã¹ãŠã®ãã£ã¹ããªãã¥ãŒã·ã§ã³ã§é©åã«åŠçãããããã§ã¯ãããŸããã ç¹ã«ãWaf
ã¯ãªããžããªãã
åé€ãããäºå®ã§ãããã ãDebianã®ã¡ã³ãããŒã¯éçºè
ã«å¥ã®ã·ã¹ãã ãžã®åãæ¿ããæ±ããŠããŸãã
æè¿ã§ã¯ãValaã®éçºè
ã
éåžžã«èå³æ·±ãæ©èœã
çºè¡šããŠããŸã-Valaã¯ã€ã³ã¿ããªã¿ã¢ãŒãã§ãã ä»»æã®ã¹ã¯ãªããèšèªã®ããã«ã¹ã¯ãªãããæžãããšãã§ãããããã¯æåã§ã¢ã»ã³ãã«ããå¿
èŠãªãã«ãªã³ã¶ãã©ã€ã§å®è¡ãããŸãã ããã«ãããèšèªãžã®èŠªãã¿ã倧å¹
ã«ç°¡çŽ åããããã楜ãããªããŸããå人çãªå®éšã§ã¯ããããžã§ã¯ãã®çµã¿ç«ãŠãèšèšã«ç
©ããããå¿
èŠããªãããã§ãã
ãŽã¡ã©ã®çŸç¶ãšå±æ
çŸæç¹ã§ã¯ãValaã®ææ°ããŒãžã§ã³ã¯0.9.3ã§ãã ãããŠã1.0ã«è¿ã¥ãã»ã©ãéçºã¯éããªããŸãã ãããããã¹ãŠããããªã«è¯ãããã§ã¯ãããŸããã ãããžã§ã¯ãã®ããŒããããã¯äœåºŠãæžãçŽãããŸãããããã®çã®1ã€ã«ãããšãVala 1.0ã¯1幎ååã«ç»å Žããäºå®ã§ããã ããã§ã
ããŒããããã®ãã
ããŒãžã¯å®å
šã«æ¶ããŸããã ããã«ããããããããããžã§ã¯ãã¯æŽ»çºã§æŽ»çºã«éçºãããŠããŸãã éçºã®æçµæ®µéåã«ãããããããèšèªæ§æãå«ãæ°ããæ©èœãè¿œå ãããŠããŸãã ããã¯ãããŒãžã§ã³ã®å€æŽæã«äºææ§ããªããåã
ã®ã³ãŒããæžãæããå¿
èŠããããããããããªäžäŸ¿ããããããŸãã
Valaã³ãã¥ããã£ã¯ãå°èŠæš¡ã§ã¯ãããŸããéåžžã«æŽ»çºã§ãã ã¡ã€ã³ã®ããŸãå Žã¯
ã¡ãŒãªã³ã°ãªã¹ã㧠ãValaã«é¢é£ãããããã¯ã«é¢ããå€ãã®è°è«ãå«ãŸããŠããŸãã ããã§ãèªåã§è³ªåãããããšãã§ããŸããã»ãšãã©ã®å Žåãè¿
éãã€å®å
šãªåçãåŸãããŸãã ããããå
¬å¹³ã®ããã«ããã¹ãŠã®è³ªåãå¿çãèŠã€ããããã§ã¯ãªãããšã«æ³šæãã䟡å€ããããŸãã æ°ãæåãç§ã¯Valaã§ã©ã€ãã©ãªã®1ã€ã«å¯Ÿããå®å
šã«æ©èœããªããã€ã³ãã£ã³ã°ãèŠã€ããŸããã ããããæžããŸããããå¿çããããŸããã ããã«ç¶æ³ãåã³ç¹°ãè¿ãããä¿®æ£ããããã€ã³ãã£ã³ã°ããããžã§ã¯ãã«çŽæ¥è¿œå ããå¿
èŠããããŸããã
ç§ã®æèŠã§ã¯ãValaã®éçºã¯Gnomeãããžã§ã¯ãã®æãéèŠãªåéã®1ã€ã§ãã ãæãããšã¯èšããããããŸããããã«ã¹ã¿ã ãœãããŠã§ã¢ã®éçºè
ã«åããã¹ãããããªããã°ããã©ãããã©ãŒã ãæ®åãããããšã¯éåžžã«å°é£ã§ãã Gnomeã®Valaã«é¢ããå®å
šãªæ²é»ã¯ããã¹ãŠå¥åŠã«èŠããŸãã Ubuntuã®éçºè
ã§ããCanonicalãšãããã®ç°å¢ã®äž»ãªãããã³ã®åŽããã®ãã®æ¹åãžã®å
¬åŒãªã·ããã¯ãããŸããã ãããŸã§ã®ãšãããæè¡ãšããŠã®Valaã¯èªåŸçã«ååšãããã®å°æ¥ã¯çŽç²ã«ç¬èªã®ã³ãã¥ããã£ã«äŸåããŠããŸãã ãããã£ãŠã幞ããªæªæ¥ãžã®å¯äžã®æ¹æ³ã¯ããã®ã³ãã¥ããã£ã匷åããæ¡å€§ããããšã§ãã ã©ãããããŸããŠ