You are browsing the archive for Oxygene.

Profile photo of marc

by marc

Oxygene for Delphi Developers: New Features

January 28, 2015 in Elements, Oxygene

Oxygene has come so far from where Delphi left the Pascal language when it stopped innovating in the late ’90s that it’s hard to provide a simple and concise overview of what’s “new” in Oxygene for Delphi developers – there’s just so much.

This topic will try to provide brief sections on most of the major improvements and new language features that Oxygene provides, covering them with a brief introduction and then linking off to the main language documentation where you can find more details.

Pretty much all of these features, with the one exception of Generics, will be new to you, whether you are coming from Delphi 7 or a more recent Delphi version such as XE7, because the Delphi language really hasn’t changed much over the past 15 years.

Types

While pretty much all code in Oxygene lives inside types, this first section looks at new kinds of types that Oxygene introduces (such as tuples and sequences), and fundamentally new things you can do with types (such as nullability). Let’s get started.

Sequences

Sequences are a special type that exist on a similar level to Arrays, and can also be thought of as a collection of elements.

Different from arrays, sequences do not imply a specific form of data storage, but can represent any collection of elements that is accessible in a specific order. This could be an array (and as a matter of fact, all arrays can be treated as a sequence) or a different data store.

One major advantage of working with data via sequences is that your code can start to work on the first items of a sequence before the entire sequence has been generated. Your code might even stop working the sequence at some point, and the remainder of it never will be generated. This allows for some pretty powerful use. For example, you can query a large database table, and have rows fetched as you need them. You could even have an infinite sequence that generates all the digits of Pi, and choose to process only the first 10,000.

Sequences are defined with the sequence of keyword combo, parallel to arrays:

var lCustomers: sequence of Customer;

Sequences can be looped over with the regular for each loops that recent versions of Delphi have also introduced, and they also work great with LINQ and Oxygene’s from expression syntax for LINQ.

Aside from many APIs in the frameworks that already expose sequences, the Iterators and For Loop Expressions features discussed below help you define your own sequences in Oxygene.

Tuples

Tuples are the second new kind of “container” type introduced by Oxygene. You can think of a tuples as a group of two or more strongly typed variables that can be used and passed around in combination – for example passed into or returned from a method.

Each member of a tuple can have a different, well-defined type (for example, you can have a tuple of a number and a string), but different than a record, members of a tuple have no individual names. Commonly, tuples are used in a more light-weight fashion, in places where declaring an explicit record type somewhere else would seem overkill.

Types are defined with the tuple of keyword combo:

var lError: tuple of (Integer, String) := (404, "Page not found")

You can access individual members of a tuple using their numeric index, such as lError.0. You can also assign tuples back into individual variables by using a tuple literal on the left side of an assignment:

(lCode, lMessage) := WebRequest.GetError();

Future Types

A Future Type is variant of a type that promises to have a value at a later time, but that value might not be calculated or obtained yet, and may be derived either asynchronously in the background, or the first time the future’s value is accessed.

Any ordinary type known in Oxygene can be used as future by prefixing its type name with the future keyword:

var lCount: future Integer := lSomeSequence.Count; // the count of a sequence might be costly to determine

An ordinary future as in the example above will be evaluated the first time the value is accessed. All future access to the variable will use that same value. In essence, the future enables lCount to be referred to multiple times, but ensures it won’t actually be calculated until (and unless) it is actually accessed. Within any subsequent code, lCount can be used just as if it were an ordinary Integer, so it could for example be used in arithmetic expressions such as lCount/4+lCount.

Futures really shine when used in combination with async expressions, as covered below. A future initialized with an asynchronous expression will start calculating its value in the background automatically, so it might already be available when first accessed. As such, futures really help writing parallelized code that can take advantage of multi-core CPUs, with very little work.

Anonymous Classes

Anonymous Classes provide a syntax to quickly define and instantiate a simple class – commonly containing only data, but no code – from inside the code that will use it. Anonymous classes are not often used on their own, but they really shine when used in combination with Sequences and LINQ, as they enable you to filter down or combine data from sequences into new objects on the fly.

For example, as you are processing a lot of Customers and their Orders, you might want to generate a new list that contains each Customer and their total order volume, and then loop over that list. Anonymous classes make that easy without having to clumsily define a class for this. In particular, the select clause of LINQ from expressions will commonly define new anonymous classes.

Anonymous classes are defined using the new class keyword combo:

var lCustomerData := new class(CustomerID: lCustomerID, OrderVolume: lOrders.Sum);

Anonymous Interfaces

Anonymous Interfaces are very similar to anonymous classes, and are used to define a new class inline that satisfies (i.e. implements) a given interface. This is commonly used on the Java and Android platform, where rather than Delphi- or .NET-style Events, controls usually are assigned a delegate object that implements a given interface in order to receive callbacks when events happen – such as to react to the click of a button.

Anonymous interfaces allow you define such a class inline and implement one or more handler methods without having to implement the interface on the containing class (which can be awkward if you need to provide different handlers to different controls – for example two different click events on two different buttons).

You can think of anonymous interfaces as an extension or a more sophisticated version of Anonymous Methods. In fact, an anonymous method is considered the same as an anonymous interface with just one method.

Anonymous classes are defined using the new interface keyword combo:

fButton.delegate := new interface(OnClick := method begin
// handle the click here
end);

Partial Types

The Partial Types feature allows the definition of a Class or Record to be split across two or more source files. This is mainly used for three different types of scenarios:

  • Complex or very large classes can be split up to keep the individual code files more manageable.
  • Classes that are shared across platforms (for example via Shared Projects can have one part that’s shared, and another that provides platform-specific logic, without needing excessive $IFDEFing.
  • Some UI frameworks, such as WinForms and WPF will use one part for user code, while a second part is maintained by the visual designer or build tool chain.

Nullability

In Oxygene, like Delphi, simple value types that are stored on the stack will always have a value (a default of 0, if not otherwise initialized), while reference types (mostly Class) that are stored on the heap will be nil unless initialized.

Oxygene, however, provides a way to override this. A variable, field or parameter of value type can be marked as nullable type to indicate that it will default to (and can be assigned) nil. Similarly, a variable of reference type can be marked as not nullable, causing the compiler to enforce it to always be assigned a valid value and never be nil.

Most interestingly, and unique to Oxygene and the other Elements languages, nullable value types can be used in code, including arithmetic expressions, just as their regular counterparts. The Nullability will filter through, so that any expression using a nullable type will in turn also be nullable – and in true tertiary boolean logic, an actual nil value in an arithmetic expression will turn the whole expression nil.

var x := nullable Int; // nil
var y := 5;
var z := 10*x+y; //z will be nullable, and nil

You can read more about nullability here.

Mapped Types

Mapped type are a unique feature of the Elements compiler. They let you create compatibility wrappers for types without ending up with classes that contain the real type. The wrappers will be eliminated by the compiler and rewritten to use the type the mapping maps to.

When working with Oxygene, you will most commonly use mapped types (for example as provided by the Sugar cross-platform library). Using mapped types is seamless, and they behave just like regular non-mapped types.

You will not often need to implement mapped types yourself, but for when you do, Oxygene – like RemObjects C# and Swift – provides a syntax for implementing mapped types when needed, with the mapped keyword.

Please refer to the Mapped Types topic in the Language Concepts section for more details.

Type Members

That covers actual types, and as you see, Oxygene has quite a lot to offer. Next, let’s have a look at what you can do within those types (and in particular, Class or Record. It’s also worth mentioning that in Oxygene, Records are elevated to be pretty much as powerful as classes: In addition to fields, they can contain properties and methods, just like their siblings.

Pretty much the only difference between the two kinds of types is that classes are heap based – they get created in memory as needed, and variables refer to their memory location. More than one variable can point to the same class instance, and you can pass class instances all around your program. Records are stack based and value types. Two variables of record type will always point to unique copies of the record, and passing a record as parameter or assigning it to a second field or variable will create a copy of its data.

Advanced Fields

Fields in classes and records work and behave pretty much as you know them from Delphi. The only new feature for fields is that they can be marked with the readonly directive, which indicates that they can only be written from the Constructor or via an initializer, but are then immutable.

Fields can also be initialized in line, and when they are, their type can be omitted if it can be inferred from the initial value.

fCount := 5; readonly; // fCount will be an Integer

Advanced Properties

Just like fields, Properties in principle work as in Delphi, but as mentioned above are also supported in Records, not just Classes.

That said, Oxygene vastly expands the syntax for declaring properties, making them a lot more convenient to define and work with. All of these features are covered in detail in the Properties section.

  • Like fields, properties can me marked readonly.
  • Like fields, properties can be initialized inline.
  • Properties can be declared without read and write clause, and will automatically be backed by an implicitly created field.
  • Properties themselves can be marked virtual and be overridden, which is cleaner than relying on virtual getters/setters as Delphi does.
  • Properties can be defined in Interfaces.
  • Properties can define different visibility for the getter and setter, for example letting you declare a property that is public readable but only private or protected writable, which can be very powerful.
  • Properties can be marked as locked to synchronize their access to be thread-safe.
  • Properties can be marked to generate Notifications when they change, via the notify directive.
  • Properties can be marked as lazy and have their initialization deferred until they are first accessed.
  • Properties can use more complex expressions than just a field or method name for their read and write statement.

Advanced Methods

Methods also work just as in Delphi, and are supported in Records as well, not just Classes. As mentioned in the Minor Differences topic, Oxygene introduces a new method keyword that we recommend to use for methods, instead of the old procedure and function keywords. It emphasizes the Object-Oriented nature of Oxygene, and deemphasizes the largely irrelevant difference of whether a method returns a value or not. But procedure and function still work as well, in Delphi Language Compatibility Mode.

But once again, Oxygene expands the syntax for declaring methods, all of which is covered in detail in the Methods section.

  • Like properties, methods can be marked as locked to synchronize their access to be thread-safe.
  • Methods can me marked as async to indicate that they will automatically execute in the background. async methods with a return value will return a Future.
  • Methods can me marked as empty if they are placeholders that perform no function. This saves creating an empty method body.
  • Methods can be marked as inline, and their logic will then be embedded into the calling code for performance optimization.

In Oxygene, methods can use a new “multi-part method name” syntax that embraces Cocoa naming conventions (but is available on all platforms, and for all three languages) and makes for more readable and expressive method calls. You can read more in the respective section in the Methods topic.

Methods can also define pre- and post-conditions to validate their arguments and their results, which is covered further down on this page and under Class Contracts.

Iterators

Iterators are a special kind of method that makes it easy to implement dynamically generated Sequences. Marked with the iterator directive, an iterator method can write regular linear code that can use the yield statement to add values to the sequence. yield works similar to exit in that it returns a value, except that the execution flow of the iterator method keeps going, because the returned value is just one of many that make up the final sequence.

Multi-Cast Events and Blocks

Oxygene introduces a new kind of member for classes and records: Events. While in Delphi events are essentially properties of a special type, and thus get no special syntax, events in Oxygene are fundamentally different and separate from regular properties, and are defined with the event keyword.

Events are multi-cast, meaning that more than one handler can be assigned to an event using the += operator that Oxygene introduces exclusively for events. When the event is triggered, all assigned handlers will be called.

Multi-cast Events are almost exclusively used on the .NET platform, since the Cocoa, Java and Android platforms have different default mechanisms to deal with this concept – such as the Anonymous Interfaces discussed earlier on Java, or more traditional delegate classes on Cocoa. But the Event syntax and infrastructure is nonetheless available on all three platforms, should you wish to use it.

Custom Operators

Finally, Oxygene allows you to define Custom Operators for your classes and records, allowing them to participate naturally in arithmetic expressions. For example, you can define the + operator for a record representing a Complex number or a Matrix, allowing code that consumes the new record (or class) to seamlessly add two values together.

You can read more in the Custom Operators section.

Statements

We’ve now covered both types and their members, so next, let’s take a look at what Oxygene lets you do inside those members, most particularly Methods-like members, in terms of the kinds of Statements you can write.

Inline vars and Type Inference

Most prominently, Oxygene does away with the need for an explicit var section at the top of each method where all the method’s local variables need to be declared.

Instead, Oxygene lets you declare variables throughout the flow of your method where they are needed, with the new var statement. This makes code easier to understand, as variables can be declared closer to where they are used, and even inside nested scopes, such as if blocks or Loops.

More importantly, the var statement supports type inference, so you can, for example, assign the result of a method call to a new local variable without restating (or even knowing) the exact type. Variables defined with inferred type will of course still be strongly typed.

Type Inference is of course especially important when working with Anonymous Classes discussed above, since these classes don’t even have a known type name that could be explicitly stated. Type inference is the only way to declare a variable holding such a type (or a Sequences of such types).

Infinite Loops

Mostly a curiosity but handy at times, Oxygene introduces a new loop type that runs indefinitely, with the loop keyword. A loop loop, also called an infinite loop, has no pre-determined exit condition and keeps running until it is broken out of with break or exit.

While not used often, loop does make for cleaner code and lets you avoid awkward and unintuitive while true or repeat until false loops.

Improved For Loops

for loops have also bee greatly expanded in Oxygene.

For one, Oxygene adds a new for each/in variation in addition to the trusted for/to loop. for each loops run over all members of a collection, Array or Sequences, without your code having to maintain an indexer manually. (More recent versions of Delphi have adopted this loop style as well, so you might already be familiar with it.)

for each loops also have two advanced syntaxes.

  • Via the index keyword, you can introduce a second loop variable that keeps track of the count of loop iterations, without you having to increment the variable yourself. Essentially, index gives you the best of both for each and for/to loops, in one.
  • Via the matching keyword, you can limit the loop to only execute for those members of a collection that are of a specific sub-type.

Currently on .NET only, both loop types can also be made to run multiple loop iterations in parallel on different threads, via the parallel keyword.

Exception handling

Exception Handling has been expanded over Delphi’s in two ways:

  • A single try block can be followed by both a finally block and one or more except blocks. There no longer is any need to nest two try blocks just to leverage both types of handler.
  • except blocks can be expanded using where clauses to further filter which exception a given block will catch, using criteria other than just the mere exception type.

Advanced Case Statements

Oxygene expands the case statement to be more flexible. case statements can work on strings (smartly using a hash table in the background for efficiently finding the proper case to execute). This not only saves code over needing to write multiple if/else if/else if statements, but is also faster.

The case statement can also execute different branches based on the type of its parameter, via the new case/type of syntax.

Refer to the case Statements topic for more details.

Locking

Similarly to the locked directive on Methods and Properties already mentioned above, the locking statement can protect a section of code against parallel execution on multiple threads, making it very easy to write code that is ready for parallelization. Via its parameter, the locking statement gives you flexibility for how granularly to synchronize execution – for example per instance, or globally.

Using

While Oxygene uses GC or ARC on all platforms and you do not usually need to worry about memory and object lifetime management, sometimes your code will interact with external resources (such as file or network handles) that do need to be released in a clean and timely fashion.

The using statement allows you to write a block of code that will run and make use of a specific object and automatically dispose of the object at the end. Essentially, using is a convenient way to encode a try/finally block that makes sure your object and external (“unmanaged”) resources get cleaned up.

Expressions

With statements out of the way, let’s look at some of the improved Expression types Oxygene provides.

Colon Operator

Small but immensely powerful, the Colon (:) Operator is a team favorite of all the features in Oxygene.

Delphi and Oxygene normally use the Dot (.) operator to access members such as Properties or Methods of a class reference. This is something so natural and so frequently done, we mostly don’t even think about this as a special expression.

When trying to access a member of a class reference that happens to be nil, an exception is raised. In Delphi, that is the dreaded Access Violation straight from the CPU, in Oxygene it’s a Null Reference Exception, often chummily called “NRE”.

NREs are great when they happen on truly broken code, as they report the failure in a clean and obvious manner. But oftentimes it would be nice to be able to write code that doesn’t need to care if an object is nil or not. That’s where the Colon (:) Operator comes in.

If you use : instead of . to call a member, Oxygene will automatically check whether the object you are trying to call into is valid or not. If the object is valid, the call will proceed as normal, same as with .. But if the object is nil, then rather than raising an NRE, Oxygene will just skip the call altogether and return nil as the result.

Consider this example:

var lKnownSiblings := lSomeObject.Parent:GetChildren();

This code will call the GetChildren method of the object from the Parent property of lSomeObject. But what if Parent is not assigned (for example because data is incomplete, or because lSomeObject is the root of the hierarchy)? Because the code uses :, the call to GetChildren will simply be omitted, and lKnownSiblings will be set to nil.

The Colon (:) Operator allows you to write code that’s simpler (often avoiding many nested if assigned(...) checks) and less error prone.

Double Boolean Comparisons

Double Boolean Comparisons allow you to compare three values in one step with a ternary operator – for example to check if a given value falls between two boundaries.

if 5 <= Count <= 10 then writeLn('between five and ten');

Lambda Expressions

[Lambda Expressions] provide a convenient shortcut syntax for writing short Anonymous Methods without the overhead of a full method/begin/end declaration. Lambda expressions are commonly used for single-statement methods, where they consist of an (optional) parameter list, the special -> operator, and the single statement. For example:

var lFives := lMyCollection.Where(x -> x.Value = 5); // filter list to items with value 5

Lambda expressions can be used anywhere anonymous methods can be used – for example as event handler assignments or as Block parameters to methods. One very common scenario, as shown in the example, is to use them with the LINQ query operators.

If Expressions

if expressions take the regular if statement and allow it to be used for expressions. As such, the if expression evaluates a condition, and then returns one value or the other.

var lLabel := if lList.Count = 1 then 'Item' else 'Items';

Case Expressions

Similar to if expressions, case allow the regular case statement syntax to be used as an expression to return a conditional value:

var lCountString := case lList.Count of
0: 'none';
1: 'one';
2: 'two';
else 'more than i can count';
end;

For Loop Expressions

You are probably seeing a pattern here. For Loop Expressions are the expression version of the regular for loop statement. Since a for loop, by its nature, can run for many iterations, the result of a for loop expression is a Sequences of values:

var lSomeEvenNumbers := for i := 1 to 100 yield i*2;

Similar to Iterators, for loop expressions use the yield keyword to add a value to the generated sequence. Also like iterators, the value of a for loop expression merely represents the functional logic for generating the sequence. The loop code does not actually run until the sequence is enumerated.

Async Expressions

async expressions allow a statement or an expression to be executed and evaluated asynchronously on a background thread, returning a Future Type.

Calling an async expression will return immediately, and execution will begin in the background (immediately, or once a free thread is available based on system resources).

Await Expressions (.NET)

Available on .NET only, the await expression construct can be used to “unwrap” otherwise asynchronous code so that future results can be dealt with in a linear fashion. Under the hood, await will break the method into different parts, scheduling them to be executed asynchronously once the awaited actions have been completed.

Please refer to the await Expressions topic for more details.

From (LINQ) Expressions

A huge topic on their own, from expressions provide a rather sophisticated sub-language that allows you to use an SQL-like syntax to work with Sequences of objects in a strongly-typed fashion. They form the basis of LINQ support.

var lFilteredData := from c in lCustomers
where c.Name.StartsWith('O') // filter by name
order by c.DateOfBirth // order by date
select c.Name, c.Address; // and return only two fields
// via a new anonymous class

Note: Although LINQ technology originated on .NET, Oxygene makes it and from expressions available on all platforms.

“is not” / “not in”

Oxygene expands the standard is type check operator and the in operator that checks for membership in a set to allow for more natural use with the not keyword.

“`
if not (x is Button) then … // traditional Delphi
if not (5 in MySet) then … // traditional Delphi

if x is not Button then … // Oxygene
if 5 not in MySet then … // Oxygene
“`

Class Contracts

Last but not least, Oxygene introduces a major language feature called Class Contracts that allows you to write self-testing code in a “Design-by-Contract” fashion.

Class Contracts consist of two syntax features:

  • Inside method implementations, you can add code to check for pre-conditions and post-conditions using the require and ensure keywords, as shown in the “Method Implementation Syntax” section of the Methods topic.

  • On a class (or record) level, you can define Invariants that are used to define a fixed state the type must fulfill at any given time. This makes it easy to detect bugs where any method or property setter leaves the type in an inconsistent state.

You can read more about these features in the Class Contracts topic.

 

This article originally appeared on our new Elements docs site at docs.elementscompiler.com. Check out our whole section for newcomers from Delphi at docs.elementscompiler.com/Oxygene/Delphi

Profile photo of marc

by marc

Two Major Announcements Today, here at RemObjects

July 24, 2014 in "Silver", Cooper, Echoes, Elements, Fire, Nougat, Oxygene, RemObjects, RemObjects C#

Today is a day I’ve been looking forward to for a while. Why? Because today we officially announced two major projects that I am really excited about, and one of them is a project I have been working on for a long time that — as of today — is in the hands of thousands of Elements developers.

So First, Fire.

I cannot overstate how excited I am about Fire. I started working on this project almost two years ago, as a side/weekend project. It evolved slowly at first, and then began picking up speed and came to the point where — much sooner than I had expected — it had become usable. Late last fall, Fire was promoted to be an “official company project”, this spring, it went out to less than a handful of very dedicated external testers. And today, while still considered Beta, it’s being made available to every Oxygene and RemObjects C# user as part of their active subscription.

What is Fire? I am glad you asked.

Fire is a Mac native app, and it’s a place to go to cook up great apps. If you want to use less fancy terms, you could also say that Fire is a new IDE for Oxygene and RemObjects C# that runs on Mac OS X.

My reasons for starting work on Fire where two-fold.

One, I’ve been a Mac user for a long time now (since 2007), but I’m always keeping a Windows VM around to do what? To run Visual Studio. I really wanted to break out of that and develop in Oxygene (and more recently RemObjects C#) directly on my Macs. On my laptop, a VM is way too much overhead, so I never bothered installing one; but even on the desktop, it’s annoying to always have your IDE in a “box”.

Two, while I (kinda) like Visual Studio and love Xcode, I’ve had my own ideas about what would make an IDE great, and I wanted to put those in practice. For version 1.0 those mainly revolve around lightweightness and the IDE not getting in my way. Beyond 1.0, I (and all of us) have more radical ideas.

Fire is the fulfillment of both of those dreams. Since early this year, I have been using it exclusively for all my Elements developing tasks and — if you’re a Mac user — I hope you will be as well, starting today.

You can read more about Fire at remobjects.com/fire, and I’ll also be talking about it more, and going into features in more detail, in future blog posts.

Second, Silver

But just one announcement would be boring, right? That’s why we have two. Today, we also took the wraps off another project we have been cooking up — this one not quite so long, but for about a month and a half.

As you probably know, last month at WWDC, Apple announced Swift, their new programming language for Mac and iOS. We started digging into Swift immediately, and really liked what we saw. So much in fact that we thought about what would be involved in bringing Swift into the Elements language family as a third member. And we didn’t just think about it, we put Carlo to work on it immediately as well.

So today we’re pre-announcing “Silver”, which is our project to do just that. “Silver” will bring the Swift language to Android/Java and .NET developers (and it will work on Cocoa too, for completeness sake). In essence, any place where you can use Oxygene or RemObjects C# now, you’ll be able to use Swift as well. And it will of course work in both Visual Studio and Fire.

While “Silver” is already working pretty great internally, we don’t have a public preview quite yet — but we will soon. You can leave your email with us on the “Silver” home page (below), and we’ll keep you in the loop.

You can find more info on “Silver” and sign up at remobjects.com/silver.

Exciting times are ahead. Let us know what you think!

Profile photo of marc

by marc

Reminder: Get Oxygene for .NET as part of your RAD Studio SA

November 20, 2013 in Elements, Oxygene

Hi.

i just wanted to shoot out a reminder that if you purchased “Support & Maintenance”, a.k.a Software Assurance (SA) for RAD Studio XE3 from Embarcadero, you are entitled to updated releases of Oxygene for .NET for the duration of your SA period.

Embarcadero might be telling you (if they say anything at all, that is) that Prism is discontinued or dead, but nothing could be further from the truth.

Prism has always been just a rebranded version of our Oxygene for .NET product. And while Embarcadero might no longer be delivering it to you (in spite of happily taking your SA money), Oxygene is alive and well, of course, and we here at RemObjects have decided to honor the full SA periods and provide you with the latest updates to Oxygene for .NET for the duration of your SA period – on our own dime.

What do you need to do?

Two simple things:

  1. Register an existing XE3.2 (or XE3.1 or XE3, if you never received the others) serial number with us at remobjects.com/oxygene/registerserial.
  2. Contact us at sales@remobjects.com with details about your SA contract, most importantly its coverage period, and (if not obvious from your name or email address) the username you created in Step 1.

We’ll update your account with access to the latest release of Oxygene for .NET covered by your SA period (which may include future releases, too), and get back to you, ASAP.

Caveats

As i mentioned above, we’re doing this on our own dime, so we need to set some cut-off date, or else we’d be shipping free Oxygene to everyone, forever, and not be able to pay our salaries.

Our official cut-off date for the above offer is April 23, 2013. On that date, Embarcadero announced RAD Studio XE4, which officially no longer included Prism.

If you purchased RAD Studio XE3 with DA, or renewed SA for RAD Studio before that date, you qualify for the above deal. If you renewed after this date, your previous SA period has already been fully covered, and your new SA period is for XE4 and does not, i’m sorry to say, include Prism anymore.

That said, if you purchased or renewed RAD Studio SA after the above-mentions date and feel in any way that you were misled or that the lack of Prism in your new purchase was mis-represented (and i’m only bringing this scenario up because we had countless people contact us with that exact concern), please email us anyway, and we will try and find a fair solution.

Our #1 goal is that every Prism customer gets a fair deal and does not feel cheated out of the product they paid for.

Full Oxygene

If you don’t have SA, or your SA has expired, of course there’s always the option (and we’ll love you for it) of just going and renewing to the full Oxygene product from us.

Not only does this give you a fresh year of updates to Oxygene for .NET, but it also gives you access to the other two platform editions, letting you build fully native no-compromise apps for iOS, Mac, Android and Java.

And if your SA is still active (and/or extended via the above offer), renewing will add an extra year on top of your current SA period – essentially giving you more than a year of updates for all three platforms.

  • If you have an extended license with us: Renew for $499 to add a year of Oxygene for .NET, Cocoa and Java, on top.
  • If you don’t have a current/non-expired subscription: Cross-grade for $599 for a fresh year of updates.(You can also cross-grade if you own any version of Delphi or any past version of Prism.)

In Summary

We’re very excited about Oxygene, what we have done with it over the past year, and what we have planned moving forward. We’re also very thankful for your patronage, and we hope that you love working in Oxygene as much as we do (and as much as we love creating it), and we look forward to what 2014 will bring, with you on board.


Party Time!

Android resources

September 20, 2013 in Elements, Guest Post, Java, Oxygene

For those Pascal programmers looking at building Android applications, be it with Delphi XE5 or with Oxygene for Java (I work with both!), here are a few Android-related resources that may come in useful:

  • Google’s Android Device Manager – if you mislay your Android device this allows you to locate it on a map (if it’s got a data/WiFi connection) and also ring it (presumably if it’s a telephone – I haven’t checked whether this option does anything on a tablet). Clearly this is similar to Apple’s Find My iPhone functionality.
    [Update: Jim confirms that tablets will happily ring too]
  • Using remote Android emulators – because Android emulators emulate the device CPU they can be hideously slow, and basically unusable in a VM. If your dev tool runs in a VM then it can be useful to communicate to an Android emulator (technically called an Android Virtual Device or AVD) either on the host machine or another machine on your network. This is a useful technique entirely independent of your chosen development tool as it revolves around how your local adb.exe communicates with the emulator. This post by Jim McKeeth runs through how to set this up using SSH. You can also find a write-up in the Delphi online documentation.
  • If you are using Oxygene for your Android development you may want to look at setting up your AVD to use an x86 CPU, potentially taking advantage of Intel Virtualization Technology via Intel HAXM (Hardware Accelerated Execution Manager) to provide VM acceleration. Delphi developers cannot take advantage of this because Delphi targets the ARMv7 CPU.
  • App testing across many devices. The Android emulator has long been held up as pretty much the only way of testing your app across the range of form factors that different devices can offer. Now it’s not the only option though, as Apkudo for Developers offers developers a free online app-testing platform where your app will be tested on over 260 different Android devices. Just upload your app to the queue and a report will be sent back when the tests have been run.
  • Since Android’s Ice Cream Sandwich release introduced the Roboto font as the default, you may want a copy to install on your machines. You can download it from the link in the blue box here (or this is the direct d/l link).
  • Google’s sample icons pack can be downloaded with this link.
  • For anyone who does presenting it can be very useful to have a means of showing on your computer screen what your device is doing. There are various VNC-based solutions for this out there, but Jim McKeeth has built a simple solution using repeated screen-captures called Android Screen View. You can download the source code for it here or pull down a build here.
  • The Android dashboards show you the percentage of devices sharing various characteristics as obtained from the Google Play store. All the devices in question will be running Android 2.2 (FroYo) and above.
    This device breakdown can be useful to decide what OS and form factor to ensure you support.
    On the dashboards you can see the breakdown of:
    • Android OS versions
    • Screen sizes and densities
    • OpenGL version
  • If you have a nose that needs to be poked inside everything, consider pulling down the Android source code. Information on how is available here.
Profile photo of marc

by marc

Embarcadero Prism to Oxygene License Migration

August 15, 2013 in Elements, non-tech, Oxygene

form Prism to Oxygene

Dear Embarcadero Prism Customers,

we want to thank you once again for choosing Oxygene for your .NET development needs in form of Embarcadero Prism.

As you might have already heard, our collaboration and reseller agreement with Embarcadero is coming to an end, and starting with our next upcoming release Oxygene for .NET will be available exclusively from us at RemObjects.

We can assure you that the product itself is alive and well, and with or without Embarcadero we are looking towards a bright future for Oxygene – on .NET and on the other platforms supported by the Oxygene language.

The end of our agreement with Embarcadero, however, means that starting with the upcoming Oxygene 6.1 release the product will stop accepting Embarcadero “Sanctuary” serial numbers, and we’ll be switching all customers over to our own unintrusive, no-nonsense licensing system.

Embarcadero Software Assurance

We do realize that many of you have purchased Software Assurance with Embarcadero in good faith that it would continue to include Prism.

Because we believe in treating our customers fairly, we have decided to fully honor any SA contracts between you and Embarcadero that have been purchased or renewed before April 22, 2013 (the date when Embarcadero announced its discontinuation of Prism) on our own dime, and you will continue to receive free updates for the remaining period of your SA from us.

In order to get you set up on our side, we kindly ask you to do two things:

  1. If you have not already done so, please make sure to register your latest XE3.2 serial numbers with us at remobjects.com/oxygene/registerserial. We will use these registrations to keep track of customers with (potentially) active SA.
  2. Please send us an email to sales@remobjects.com with details about your current SA contract, including when it was bought or renewed and when it expires. Based on this information, we’ll set you up with the appropriate Oxygene for .NET licenses in our system.

If you have active Software Assurance for RAD Studio XE3 or Prism XE3, and you have not received an XE3.2 serial number, please reach out to your contacts at Embarcadero (and feel free to include sales@remobjects.com in CC for your communication, so we can also follow up on our end) to ask them for your XE3.2 key.

We do apologize that we need to ask you for these manual steps, but unfortunately we receive no information or details about Prism users and their SA contracts from Embarcadero, so the only way we have to move you into our system you is by you contacting us.

Renewals, and/or moving to the full Oxygene Package

If you do not have Software Assurance, or your SA ends before August 23, 2013, we have attractive renewal options explicitly for Prism customers that will let you upgrade/renew to our full Oxygene package — with Oxygene for Cocoa, Oxygene for Java and of course Oxygene for .NET..

We have emailed everyone who registered their Prism serial number with us with the details for this today.

If you have not registered your serial yet, but are going to do so, we will email you once we received your registration. If you have any questions, or for some reason cannot register your serial number (maybe because you’re on Prism XE or later, which we don’t accept serials for), please just email sales@remobjects.com with your details, and we will sort you out as best as we can.

Exciting Things Ahead

We’re very excited about the things we have planned for Oxygene (and Hydrogene) moving forward. The imminent 6.1 release contains some very cool features that many of you have been asking for, including initial support for Refactoring (that we’ll build upon further going forward) and other IDE and language enhancements. And we have more exciting and more groundbreaking things planned for the rest of the year and for 2014.

We hope that you will continue to put your faith in us and in Oxygene, even without Embarcadero. Prism, and the Oxygene Language, always have been 100% driven by us at RemObjects, and it will keep getting better and better.

We’re looking forward to having you along for the ride as we move ahead further.

Yours,

marc hoffman
Chief Software Architect
RemObjects Software

Profile photo of marc

by marc

Announcing the Oxygene 6 “July 2013″ Update

July 30, 2013 in .NET, Cocoa, Cooper, Elements, iOS, Java, Nougat, Oxygene, Platforms, Visual Studio, Windows


Oxygene "July 2013"

We’re thrilled to inform you that the “July 2013″ update for Oxygene 6 is available now.

The team has been incredibly hard at work since we shipped Oxygene 6 in May, both on this update and on the next feature release coming up in August, and the “July 2013″ update brings with it a good ~140 fixes and improvements across all three editions and across the entire toolchain, from compiler to IDE.

Even though we consider this update a “bug-fix release”, we could not stop ourselves from including two major compiler/language enhancements, as well: On the Java/Android side, the Oxygene language has gained full support for unsigned integer types — a feature not available in the Java language and not officially supported by the Java Runtime, we know that a lot of you who use Oxygene on Java have been looking forward to this. On the Cocoa side, the compiler has been updated with support for Oxygene’s trademark Future Types (one of my favorite features), based on GCD under the hood.

With these two changes, we’re taking another big step towards bringing the Oxygene language closer together on all three platforms.

What’s Next?

We’ve also been busy at work for the upcoming 6.1 release (for which alpha/beta builds have been available for a while now) and beyond. Check out my blog post for more details and some hints at what is coming up. We’re very excited.

Prism

Embarcadero Prism customers, please note that the “July 2013″ release will be the last update made available to you under the Prism brand, and the last release to accept Embarcadero serial numbers.

Please make sure that you have your Prism XE3.2 serial number registered with us, so that we know about you and can contact you about moving forward. As mentioned in the past, we will honor existing SA agreements you may have with Embarcadero beyond July – but we can only do that if we know who you are ;).

As always, if you have any questions or concerns at all, please contact us at sales@remobjects.com.

Yours,
marc hoffman
Chief Architect

Profile photo of marc

by marc

“After which no more maintenance releases are planned”. Not.

June 7, 2013 in Elements, non-tech, Oxygene

Our good friends and trusted long-time partners at Embarcadero have recently sent out announcements to make sure that all of our shared Prism/Oxygene customers are fully aware of their future path for continuing using the Oxygene language, coverage of Oxygene updates for the full period of Software Assurance this customers have paid for, and are assured that their technological investment in Prism/Oxygene are savely going forward.

I thought it might make sense to post this message here, to make sure noone misses it.

Dear Embarcadero Customer,

Embarcadero Technologies is pleased to announce the release of Embarcadero Prism XE3.2.

Embarcadero Prism is no longer an included product within RAD Studio as of the XE4 release. Maintenance updates will continue to be provided through August 2013, after which no more maintenance releases are planned.

We wish you success in using this latest Embarcadero Technologies product.

Regards,

Embarcadero Product Management

We want to thank our friends and partners at Embarcadero once again for getting the word out on this, and for letting our shared customers know where to obtain Oxygene going forward, especially beyond August. It goes without saying that we (RemObjects Software) will honor all active SA contracts, on our dime, beyond August. Please contact us if you have any questions.

Oxygene 6 now includes Oxygene for Cocoa

May 31, 2013 in Elements, Guest Post, Java, Oxygene

Ah, it’s been released… The May 2013 release of Oxygene, released on 27th May 2013, brings us Oxygene 6.0, and Oxygene 6.0 brings us the official release of Oxygene for Cocoa.

The Oxygene language now gives ways of coding for all the currently interesting platforms using the three available editions of Oxygene:

  • Oxygene for .NET (formerly also known as Delphi Prism) – targets the .NET platform, allowing you to build Windows applications, Windows phone applications, Silverlight applications and so on, using the relevant .NET frameworks. Also targets the Mono platform, allowing applications to go to the many places where Mono goes, such as Mac and Linux and also Android and iPhone/iPad using Xamarin.Android (aka Mono for Android) and Xamarin.iOS (aka MonoTouch) using those frameworks.
  • Oxygene for Java – targets the Java runtime, allowing you to build Java apps, Java servlets, Java applets and also, perhaps most interestingly, Android apps. Java apps will use your chosen Java frameworks and Android apps use the Android SDK framework.
  • Oxygene for Cocoa – targets iOS and OS X allowing native ARM applications to be built for iPhone and iPad as well as 64-bit native OS X applications. Applications are built against the native OS X Cocoa and iOS CocoaTouch frameworks.

Oxygene is hosted in Visual Studio 2012 (support for Visual Studio 2010 has now been phased out in Oxygene 6.0). If you don;t have a copy of Visual Studio 2012 the Oxygene installer can set up the Visual Studio 2012 shell first.

For existing users of Oxygene for .NET and/or Oxygene for Java there are some new features added to Oxygene 6.0, including a spate of new conditional defines to help distinguish which compiler built your code or which platform you are targeting:

Oxygene 6.0 edition Edition define Platform define GC/ARC define
.NET ECHOES DOTNET GC
Java COOPER JAVA GC
Cocoa NOUGAT COCOA ARC

However the main thrust of the release is Oxygene for Cocoa, which works in conjunction (if you want) with Apple’s UI designer to support visual UI design via nib (.xib) files or storyboard files. It also understands and fully supports multi-part method names so that it fits in directly with the Objective-C naming system and can represent and refer to any existing methods. It support the iOS Simulator, supports debugging there and on-device and offers all the options needed to sign and provision your apps. It supports ARC (automatic reference counting), understands bridging and uses an LLVM back-end to generate good ARM and 64-bit Intel code.

It ships with all the standard frameworks imported and has a tool that allows you to import any additional libraries you need to work with. Because Oxygene always uses the frameworks that natively exist on the target platforms, there is not an awful lot to learn specific to Oxygene when building Mac or iOS apps. Anything you learn on the Internet about how to build aspects of Mac/iOS apps applies directly – it’s just a case of expressing the various local API calls in the Oxygene syntax, which is a very familiar Object Pascal based syntax.

During pre-release development Oxygene for Cocoa was called Project “Nougat” and I worked with it a lot to keep tabs on how it progressed. I’ve built a whole bundle of test apps to keep on top of (mostly) iOS application development techniques by simply following various online Objective-C tutorials, and just entering the code in Pascal instead of in Objective-C.

I’m delighted Oxygene for Cocoa is now released as I’ve been productive with the tool for quite a long time now. I’ve wanted to make blog posts about how I do thing with it, but given it’s just a syntax shift there hasn’t really been much of a need for it. I guess maybe I’ll do one at some point to show the basics of building up an iOS app in the Visual Studio IDE and getting it launching in iOS Simulator, but after that it’s just writing code in the same way any other iOS developer does; just in Pascal.

On June 17th I’ll be demonstrating the product with a talk at a Developers Group meeting in Maidenhead, UK.

You can find more information about Oxygene for Cocoa at these links:

Buying Oxygene is reasonably pocket-friendly. If you’re new to it then $699 gets you all three versions. Otherwise there is a $499 renewal price for existing Oxygene for Java or Prism customers, a $599 cross-grade price for any users of Embarcadero Delphi or of older Embarcadero Prism versions (XE2 and below) and also a $99 academic price.

If you want to see how you get on with Oxygene 6.0 without committing you can always pull down a trial version first.

Profile photo of marc

by marc

Announcing Oxygene 6 and the new Oxygene for Cocoa

May 28, 2013 in .NET, Android, Cocoa, Elements, iOS, Java, Mac, Oxygene, Visual Studio

Hello everyone.

We are more than pleased to announce the release of Oxygene 6, the next major milestone of our Oxygene language. This new version includes a significant update to the existing “Oxygene for .NET” and “Oxygene for Java” editions, but – most excitingly – it also marks the first release version of our all-new Oxygene for Cocoa.

Oxygene for Cocoa is a brand-new edition of our Oxygene language, and it targets native Mac and iOS development with the Cocoa frameworks, using the same great language you already know and love from .NET and Java. We are very excited about Oxygene for Cocoa, and we think it will be a game-changer for how you create apps for Mac and iOS.

Oxygene for Cocoa is a very unique product, in that it is the only language (next to Apple’s own Objective-C) to truly natively target the Cocoa platform and the Objective-C runtime. It gives you access to all the great frameworks and libraries provided by the platform, lets you use all the native UI controls, and generates executables that are lean, mean and blazingly fast – and compiled directly for Intel x64 (Mac) or ARMv7 and ARMv7s (iOS).

Get Oxygene now

Support for all three platforms is available in the new Oxygene 6 package, which is a free update for all active subscribers who bought Oxygene form us since last August. It is available for new users at only $699 (again including all three platforms!), and individual platform support is also included in our Suite Subscriptions for .NET, Cocoa and Java, respectively.

Special renewal pricing is available for existing Oxygene for Java or Prism customers $499, as well as a special $599 cross-grade offer for any users of Embarcadero Delphi or of older Embarcadero Prism versions (XE2 and below).

We’re also for the first time ever introducing a new academic pricing for students, teachers and non-profit researchers, at an amazingly low $99.

And of course, as always, theres a free fully-functional 30-day trial version available, as well.

This is only the beginning

But we’re just getting started with this release and have many further exciting things planned for this year and beyond, including two minor updates for June and July, a significant “6.1” release in Fall, as well as several related products and technologies that will extend the Oxygene ecosystem that we’re not quite ready to talk about yet.

In the meantime, we hope you will enjoy the first release of Oxygene 6.0 and Oxygene for Cocoa – and we’re looking forward to hearing what Apps you will be building with it!

You can learn more about Oxygene at remobjects.com/oxygene and wiki.oxygenelanguage.com.

 

Yours,

marc hoffman
Chief Architect,
RemObjects Software

Profile photo of marc

by marc

Prism XE4, Where Art Thou?

April 17, 2013 in Elements, Oxygene, Uncategorized

Update: (May 26, 2013) We have an official FAQ for the migration of Prism licenses to Oxygene available now at remobjects.com/oxygene/prism. Also updated pricing references within the post to reflect current pricing.

Ok, so the cat is out of the bag, if a few days ahead of schedule: starting with the upcoming release of XE4, Embarcadero Prism will no longer be part of the RAD Studio SKU, and there will be no “XE4″ branded edition of Prism.

But worry not. As you all know, Prism has been nothing more than a re-branded version of our Oxygene for .NET product — and Oxygene will keep going on, stronger than ever.

In fact, Oxygene has long outgrown its Prism-branded edition, first when we introduced full native support for Java and Android to the language over 18 months ago, and of course with our upcoming support for truly native iOS and Mac apps, shipping next month.

So “Embarcadero Prism” as a product is going away, but the Oxygene language you have come to love and depend on will continue to shine and evolve, as it always has.

What exactly does all of this mean?

We believe that in the end, this change will be a net positive for Oxygene.

When we first started working with Embarcadero in 2008 to bring Oxygene 3.0 into RAD Studio, Embarcadero had a gap left in their lineup with the discontinuation of their ill-fated Delphi for .NET product. Both companies shared a vision of Delphi and Oxygene — then getting branded Delphi Prism — becoming two sides of the same coin: two languages evolving together and influencing each other to push Pascal forward both for CPU-native Windows development and for managed targets.

Over the years, it turned out that this was not happening, and as Embarcadero was shifting their focus to “(CPU-)native, native über alles” and onto FireMonkey, Prism (and with it Oxygene, as i’m going to start referring to it from now on exclusively) became the odd man out — the product that was there, as part of RAD Studio, but no-one liked to talk about, because it did not really fit the vision of the company.

This became clearer as Oxygene evolved.

We added support for Java and (more importably) Android, but Embarcadero had their own (very long term ;) vision of how they wanted to pursue the platform that conflicted with what Oxygene had to offer. As a result, Oxygene was forced into a split personality — with Oxygene for .NET remaining under the Prism umbrella, and Oxygene for Java becoming a separate product (for a while).

At the same time, Embarcadero became less and less interested in actually marketing and promoting the product, and it was being relegated to a “filler” to pad up RAD Studio as a worthwhile product suite.

Things got even more complicated when we started working on “Nougat”, our vision for really and properly bringing Object Pascal and Oxygene onto the (misleadingly named) Objective-C runtime that is the engine behind iOS and Mac. Once again, Embarcadero had different plans for the platform, and what is more, they — understandably — raised the concern that Oxygene for Cocoa would be too direct a competitor to their efforts on iOS (albeit once again our two companies were following two very different visions).

To wrap things up short and sweet, as of right now, Oxygene is finally standing on its own two feet again.

During the five years of partnership, RemObjects Software has always been the sole technical contributor to the core Oxygene product, and having Oxygene “back to ourselves” really just means one thing: that we can, more aggressively and consistently, continue to drive the product on all three target platforms, according to the vision we have for it. And trust me, we have some amazing things planned for 2013 and 2014, with “Nougat”, our Mac and iOS support, only being the tip of the iceberg.

What does this mean for existing customers?

Worry not. We have every eventuality covered.

First of all, if you already bought Oxygene directly from us or one of our reseller (i.e. without an Embarcadero serial number), none of this will affect you at all, you’re already set.

If you’re an Oxygene user from the Embarcadero side of the fence, now more than ever, make sure you register your XE2.x or XE3.x serial number with us. This way, we know about you and can take care of you moving forward.

If you have registered your XE3.1 serial, you can take advantage of our special renewal price for Prism customers and renew to a full Oxygene package licensed directly from RemObjects Software, for only $499. Remember, this not only renews you for future updates to Oxygene for .NET (the product you have now), but it also gives you the Java/Android and Mac/iOS targets, as well!

If you have active software assurance (SA) with Embarcadero that covers Oxygene, that will of course be honored. Up until August (i.e. one year from when XE3 shipped), you will continue to receive the latest updates to Oxygene for .NET from Embarcadero. This will (assuming your SA is still active at the time) include the upcoming major 6.0 release, next month.

Once your current SA expires, renewing it will not include renewed access to Oxygene, but you can use the link above at any time to renew to the full Oxygene package from us. (Note that the current renewal price of $349 is a special offer and will increase slightly once “Nougat” ships next month.)

It’s probably unlikely that you’re buying RAD Studio XE4 “fresh” without already being an existing RAD Studio user, but if you do, i’m afraid you will not receive “Prism XE4″ as part of it. You (and every other Delphi user) can use our special cross-grade offer to purchase a full Oxygene package from us, at $599 (this is also a special offer, and the price will increase slightly once we ship 6.0 next month).

In Summary

As the old saying goes, The King is dead, long live the King! Embarcadero Prism is no more, starting next week, but Oxygene is going stronger than ever.

We, and i personally, are incredibly excited about Oxygene, and about the things we have planned thru-out the rest of the year and beyond. We can’t wait to walk down the road ahead with you.

yours,
marc hoffman
Chief Architect & Oxygene Team Lead
RemObjects Software