Wiki
Version 1 (modified by Charles, 10 years ago)

--

Cobra 0.9.6 Release Notes

2013-12-23

To get Cobra 0.9.6, visit  Downloads.

Below are the changes included in this release. There are 5 enhancements, 12 refinements, 17 fixes and new IDE support. At this point, the Cobra language is very stable and we're mostly refining and fixing as we put it into practice.

For even more details, browse the revision log which includes check-in comments and source code changes.

This release requires .NET 4.0 and higher (.NET 4.0 is now three years old). Cobra also runs on Mono and is tested on both Mac and Linux.

IDE

One of the most notable recent developments for Cobra is actually outside the compiler. The Cobra add-in for MonoDevelop / XamarinStudio offers

  • syntax highlighting
  • background compilation
  • member completion suggestions
  • parameter completion
  • mouseover tooltips
  • go to declaration

Language

  • Support optional and named parameters. For example:
    class X
    
        def main
            .show('foo')
            .show('bar', 5)
            .show('baz', count = 3)
            .show(s = 'can', count = 2)
    
        def show(s as String, count as int = 2)
            for i in count, print s
            print
    
  • Added modifier sections in type declarations. For example:
    class C
    
        private, shared
    
            def foo
                pass
    
            def bar
                pass
    
        def baz
            pass
    

Compiler

  • Improved error checking on arguments of initializer/constructor calls.
  • Improved error checking on missed of in generics call.
  • Fixed: An unfinished assignment statement causes an internal error instead of a normal error message ("unexpected end of file").
  • Fixed: Internal error for dynamic argument on a method overload.
  • Fixed: Internal error if source file ends in the middle of a comma separated expression.
  • Fixed: Cobra internal error when mixin declared after class.
  • Fixed: In libraries, a field and property that differ only by case of a type with the same name triggers an internal compiler error.
  • Fixed: Token on line after end of docstring causes parser confusion and 'useless error'.
  • Fixed: Calling a method with an underscore name from within an initializer/constructor that is overloaded, causes an internal compiler error.
  • Fixed: The compiler gracefully handles I/O exceptions when trying to delete intermediate files, but not unauthorized access exceptions.
  • Fixed: If the compiler cannot delete an intermediate file, no warning is recorded.
  • Fixed: Cobra gives a false parse error if there is a blank line after a doc string and before the get section of a property.
  • Fixed: Using a namespace as a generic parameter can cause an internal error.
  • Fixed: Raising a shared event causes an internal compiler error.
  • Fixed: An anonymous method inside a method with a local variable named result causes a false compilation error.
  • Fixed: Some CLR libraries cause an internal error when read by the compiler, specifically static readonly generics.
  • Fixed: Some object creation expressions can cause an internal compiler error if one or more of the arguments has an error.

Library / Run-time

  • Changed Cobra's Set<of T> to inherit from .NET 4's HashSet?<of T>.
  • Added new Process extension methods:
    def runAndCaptureOutput as ProcessOutput?
    def runAndCaptureOutput(verbose as false) as ProcessOutput?
    

The return value can be queried for .standardOutput, .errorOutput and .combinedOutput.

  • In CobraCommand.find, check the C: drive if an attempted file system path is not found on the current drive.
  • New compiler API improvements. See changeset:2987 changeset:2990 changeset:3014 changeset:3016
  • Fixed: Accessing Keywords.groups in Cobra.Compiler throws an exception
  • Added INode.goToDefinitionLocation for IDEs.

Command Line

  • Enhanced -lib: option to accept {EnvironmentVariables} and {@latest}.
  • Minor tweaks to -native-compiler-arg command line option. Now singular. Was always an accumulator.

Installer

  • There is no explicit -net4 option as .NET 4.0 and higher is now the base requirement.
  • Verify that libraries installed in the GAC have the correct version number.
  • Locate the gacutil that comes with Visual Studio 2012.
  • Added installer support for Windows 8.1 SDK.
  • Fixed: When the installer is testing that hello.cobra can be compiled with the new compiler, it does not respect any -platform argument that was passed to the installer, resulting in an error.

Other

Credits

Cobra is a community-driven, open source project under the MIT license. For this release, thanks go to:

  • hopscc
  • nerdzero
  • dwilliamii
  • Chasm
  • DelphiGuy
  • Jonno
  • sephthir

Additional people contributed through testing and discussion.

See Also