C Omega
-
Upload
iradarji -
Category
Technology
-
view
911 -
download
0
description
Transcript of C Omega
![Page 1: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/1.jpg)
![Page 2: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/2.jpg)
Cω is a strongly typed, data oriented programming language that bridges the gap between semi-structured hierarchical data (XML), relational data (SQL), and the .NET Common Type System (CTS).
![Page 3: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/3.jpg)
Concurrency is going mainstream: rise of multi-core and asynchronous web applications.
“Great! Pity they’re tied to an outdated research compiler…”
Cω extended C# 1.0 with high-level, asynchronous concurrency abstractions -join patterns - based on the join calculus.
(variant of Polyphonic C#, related to JoCaml).
![Page 4: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/4.jpg)
Cω’s features have been used in the creation of the LINQ extension in C#.
The concurrency constructs have also been released in a slightly modified form as library, named Joins Concurrency Library, for C#, some prototype extensions for VB and other .NET languages by Microsoft Research.
![Page 5: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/5.jpg)
Direct support of Asynchronous concurrency and processing of relational and semi-structured data. Stronger compile-time guarantees Freedom to choose different
implementation strategies for compiler. More natural syntax. Better support from other tools such as
editors and debuggers.
![Page 6: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/6.jpg)
No Reinvention of wheel. Extend an already-popular language.
The aim is to take models and lessons learnt from the design of more academic, special purpose languages and try to incorporate them within the mainstream object-oriented framework Example:▪ Concurrency – from - join calculus and JoCaml.
![Page 7: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/7.jpg)
![Page 8: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/8.jpg)
Provide an integration of the object, relational and semi-structured data models.
Generalization, rather than specializations
XSDSQL
CTR
Cω
![Page 9: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/9.jpg)
Ordered homogeneous collections of zero or more values.
Closely related to C#’s IEnumerable<>
Generated using iterators, which are blocks that contain yield statements.
They are always flattened; there are no nested streams of streams
Apply-to-all expression variable it
![Page 10: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/10.jpg)
![Page 11: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/11.jpg)
Ordered collections of heterogeneous values.
Allows repeated occurrences of the same member name within an anonymous struct type, even at different types
![Page 12: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/12.jpg)
![Page 13: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/13.jpg)
Discriminated Union typeProvides a test, e is T on choice
values to test the value's type.
![Page 14: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/14.jpg)
choice{int;Button;} x = 3; choice{int;Button;} y = new Button();
![Page 15: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/15.jpg)
A normal class that has a single unlabelled type that describes the content of that class
![Page 16: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/16.jpg)
![Page 17: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/17.jpg)
Cω offers some XPath-like expressivity: Filters▪ allows a filter to be passed over a stream. ▪ Example: friends[ it.age < 18]
Queries by type
![Page 18: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/18.jpg)
![Page 19: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/19.jpg)
![Page 20: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/20.jpg)
![Page 21: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/21.jpg)
![Page 22: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/22.jpg)
The projection list results in the select expression returning a stream of "tuple types", namely
struct{SqlInt32 ProductId; SqlMoney Total; }* The from clause specifies the data source being
queried. This can be either an object in a SQL database, or any in-memory object.
Cω select statement supports various forms of joins, which are essential to any real database application.
Cω also supports order by and group by clauses. The where clause can specify any valid Cω
Boolean predicate for filtering the selection.
![Page 23: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/23.jpg)
![Page 24: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/24.jpg)
Methods can be defined as either synchronous or asynchronous
When a synchronous method is called, the caller is blocked until the method returns
When an asynchronous method is called, there is no result and the caller proceeds immediately without being blocked
![Page 25: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/25.jpg)
A body may be associated with a set of methods. Such a definition is called chord.
A particular method may appear in the header of several chords.
The body of a chord can only execute once all the methods in its header have been called.
Thus, when a method is called there may be zero, one, or more chords which are enabled:
![Page 26: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/26.jpg)
If no chord is enabled then the method invocation is queued up. If the method is asynchronous, then this simply involves adding the arguments (the contents of the message) to a queue. If the method is synchronous, then the calling thread is blocked.
If there is a single enabled chord, then the arguments of the calls involved in the match are de-queued, any blocked thread involved in the match is awakened, and the body runs.
![Page 27: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/27.jpg)
When a chord which involves only asynchronous methods runs, then it does so in a new thread.
If there are several chords which are enabled then an unspecified one of them is chosen to run.
Similarly, if there are multiple calls to a particular method queued up, we do not specify which call will be de-queued when there is a match.
![Page 28: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/28.jpg)
![Page 29: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/29.jpg)
Cω contains elegant primitives for asynchronous communication, and offers a strongly-typed integration of the object, relational and semi-structured data models.
It makes easier to write the data-intensive distributed applications being written today
![Page 30: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/30.jpg)
http://www.google.co.in/http://research.microsoft.com/
comega/http://bartdesmet.net/blogs/bart/
archive/tags/Comega/default.aspxhttp://msdn.microsoft.com/en-us/
library/ms974195.aspxhttp://channel9.msdn.com/
![Page 31: C Omega](https://reader033.fdocument.org/reader033/viewer/2022052900/555a4407d8b42ae1398b502a/html5/thumbnails/31.jpg)
Thank You