Content deleted Content added
m Signing comment by 189.178.72.176 - "→A new Vala article is needed!: new section" |
syntaxhighlight & fix lint |
||
(13 intermediate revisions by 10 users not shown) | |||
Line 1:
{{Talk header}}
{{WikiProject Computer science
{{WikiProject Computing
{{WikiProject C/C++|importance=Mid|c=yes}}
▲{{WikiProject C/C++|class=Start|importance=Mid|c=yes}}
}}
Line 13 ⟶ 12:
If it should be as simple as possible, we should use something like this:
<
using GLib;
Line 19 ⟶ 18:
print ("Hello World\n");
}
</syntaxhighlight>
However, it would be useful to have a second example, then, that shows a bit more of the syntax.
[[User:Juergbi|Juergbi]] ([[User talk:Juergbi|talk]]) 14:14, 22 June 2008 (UTC)
::If it were to be as simple as possible you could drop the glib import and just have the one-liner:
<blockquote><blockquote><
void main() { print("Hello World\n"); }
</
::[[Special:Contributions/24.243.3.27|24.243.3.27]] ([[User talk:24.243.3.27|talk]]) 09:53, 19 October 2008 (UTC)
Line 63 ⟶ 62:
:Ps. As an example of how easy it is to wrap C libraries, one can copy the default glib-2.0.vapi somewhere and edit it to wrap g_chdir by putting the following code under the DirUtils namespace, then compiling with the switch --vapidir=/path/to/modified/vapi:
<blockquote><
[CCode (cname = "g_chdir")]
public static int chdir (string pathname);
</
:Which then be used from Vala code:
<blockquote><
DirUtils.chdir( "/foo/bar" );
</
:[[Special:Contributions/24.243.3.27|24.243.3.27]] ([[User talk:24.243.3.27|talk]]) 08:00, 22 September 2008 (UTC)
Line 105 ⟶ 104:
:::I won't edit-war over the issue, but I will note my dissenting view once again. Vala specifically states that one of it's main goals is to generate pure ANSI C code for platforms without a Vala compiler. Thus, I judge it a good and necessary aide to considering the meaning and purpose of Vala in an encyclopedia article, to include a small sample of the generate C code. If I had never used Vala, I would consider it highly relevant to see a small sample of the type of C code that Vala generates. [[Special:Contributions/64.234.10.32|64.234.10.32]] ([[User talk:64.234.10.32|talk]]) 07:18, 16 June 2009 (UTC)
::::I saw teeth and blood all over the floor!, please be more kind when discussing. When to include or not the target code, depends on how is it relevant to explain the semantics of the language. That should be the criterion to decide it's inclusion. I still not understand what is Vala, here says that it is a preprocessor, maybe something like the old [[ratfor]] (rational Fortran)?
::::That is not clear in the article, for that reason I think is better to write a new one as suggested below <small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/189.178.72.176|189.178.72.176]] ([[User talk:189.178.72.176|talk]]) 04:48, 12 October 2015 (UTC)</small><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
On the one hand, most languages compile down to either physical or VM machine code and C++ itself used to be a front end that was was translated into C, yet not many pages (any?) on Wikipedia display this translated form. On the other, "not having to write in GLib C" is a feature of Vala, hence maybe it is useful to show an example of the C code. In the end however the latter can simply be stated, and for consistency with other languages pages on Wikipedia, removing the generated code example seems like a good idea. [[User:Mjog|mjog]] ([[User talk:Mjog|talk]]) 03:36, 21 October 2016 (UTC)
==Mem mgmt?==
Line 140 ⟶ 145:
the line:
<syntaxhighlight lang="text">
stdout.printf("hello world!\n");
</
means that <code>stdout</code>, which is an instance of the streams class, which is capable to process the <code>printf("hello world!\n")</code> message.
Line 168 ⟶ 173:
I hope that I have been clear with the idea of how an article like this about a programming language Vala, may be structured. <small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/189.178.72.176|189.178.72.176]] ([[User talk:189.178.72.176|talk]]) 02:54, 12 October 2015 (UTC)</small><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
== Please update the release version. ==
—<span style="color:blue ; text-shadow: 0pt 1px 2px blue; font-style:italic">[[User: Wi24rd|wi24rd]]</span> <sup>[[User talk:wi24rd|<span style="color:purple; font-style:italic">leave a comment</span>]]</sup> 17:32, 13 February 2019 (UTC)
:You can do this yourself by simply editing the page. --[[User:Mjog|mjog]] ([[User talk:Mjog|talk]]) 00:45, 18 February 2020 (UTC)
== How should the infobox indicate there is a LTS version? ==
The current Vala versions are 0.46.9 (Stable) and 0.48.5 (LTS), both released on April 23, 2020. How can the infobox indicate there is a long-term support release? [[User:Kiamlaluno|Kiamlaluno]] ([[User talk:Kiamlaluno|talk]]) 11:57, 23 April 2020 (UTC)
|