Content deleted Content added
Sabre ball (talk | contribs) Reassess article. Start class. |
syntaxhighlight & fix lint |
||
(19 intermediate revisions by 13 users not shown) | |||
Line 1:
{{Talk header}}
{{WikiProject Computer science|class=start|importance=low}}▼
{{WikiProject banner shell|class=Start|
{{WikiProject Computing|importance=Low|science=yes|science-importance=Low|free-software=yes|free-software-importance=Mid|software=yes}}
{{WikiProject C/C++|importance=Mid|c=yes}}
}}
==run()==
Line 7 ⟶ 12:
If it should be as simple as possible, we should use something like this:
<
using GLib;
Line 13 ⟶ 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 57 ⟶ 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 99 ⟶ 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 120 ⟶ 131:
:I agree. According to the manual, "[GLib] works on many UNIX-like platforms, Windows, OS/2 and BeOS"[http://library.gnome.org/devel/glib/2.18/glib.html]—while that covers a ''huge'' chunk of OS's ("UNIX-like" includes IRIX, Solaris, OSX, BSDs, GNU/Linux, &c), I'd bet there's a system somewhere in the world with a working ANSI C compiler that won't build GLib. I think the description should be something like "Every platform supported by GLib." [[Special:Contributions/24.243.3.27|24.243.3.27]] ([[User talk:24.243.3.27|talk]]) 03:08, 22 February 2009 (UTC)
== Name? ==
What's the origin of the name "Vala"? I can think of several candidates... [[User:Arny|Arny]] ([[User talk:Arny|talk]]) 00:26, 2 April 2012 (UTC)
== A new Vala article is needed! ==
I'm sorry for such drastic petition, but a programming language is characterized mainly by it's syntax and semantics.
Not by examples of how to code the classic Hello World! in different styles.
The object oriented example is very ill constructed,
the line:
<syntaxhighlight lang="text">
stdout.printf("hello world!\n");
</syntaxhighlight>
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.
It is too artificial to embed it in a class called sample, as was done in the article.
I came to this article trying to understand a free software source which includes modules with the .vala extension.
But this article says no substantial thing about such language.
What is it's advantage compared with plain C or C++, if I only see some complicated examples.
The article could start with an informal, or should I said semi-formal description of Vala syntax, maybe comparing it with C and C++. From which it seems to be inspired.
Then the formal syntax rules of the language (in BNF or similar) or at least a pointer to the official definition.
Then give some important semantic features, like differences in meaning of statements with the same syntax in C or C++ and Vala.
I do not expect a formal (operational) semantics, for vala, as the vast of those new languages are not developed on such formal basis, but as variants or little improvements of other languages, like C/C++.
Neither I do expect from it to include all the semantics of the language in an encyclopedia article, but some important features at least.
The present article mentions the capability to write anonymous functions, which seems interesting.
I may be developed saying for example:
Why is important to have anonymous functions? How are they written? Are they really useful? I can define them, but can I generate them?
In plain ANSI C one can use function pointers, but one can not create functions on the fly, (technically speaking: it is not a higher order language). There are some forms to overload functions, and that is why it is an interesting feature. Of course overloading methods is more natural in OO languages like C++. Can you say something like that in the Vala article?
How about recursion, iteration oriented languages, are not good to implement recursive functions, because as part of semantics, each time a function is called information to return is stored in a stack (see about the heap) which may be too small to be useful in practice. But self calling functions can be transformed in several ways to avoid such problem. Can you say something about this issue in Vala?
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)
|