Cobra Changelog

What's new in Cobra 0.9.6

Dec 23, 2013
  • 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.
  • Added modifier sections in type declarations.
  • 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 to inherit from .NET 4's HashSet?.
  • Added new Process extension methods
  • 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:
  • Added MonoDevelop solution file for the Cobra compiler.
  • Added msbuild/xbuild support. For example, there is now a CobraCompiler? ToolTask?.
  • There have been plenty of documentation improvements through the wiki. See StandardLibraryExtensionMethods, which will lead to other documentation pages.

New in Cobra 0.9.4 (May 25, 2013)

  • Language:
  • Added readonly keyword.
  • Improved parsing of method sections with respect to contracts, test and body.
  • Fixed: Enum members that are the same name except in case cause an internal compiler error. Add error check: Cannot have members with the same name in different case ("foo").
  • Fixed: Incomplete support for vari nilable parameters
  • Compiler:
  • When method calls have incorrect number of arguments or types, give the method sigs.
  • Turned off reflection-only assembly loading. Use only if the COBRA_REFLECTION_ONLY environ var is set to 1, true or yes.
  • Fixed: Some in expressions, especially those against arrays, can give an invalid error message.
  • Fixed: A single line comment made with /# ... #/ silently truncates the source file.
  • Fixed: The compiler can fail with an internal error when reading certain libraries (generic extension methods with test sections).
  • Fixed: The compiler can produce an internal error in obscure situations involving lambda expressions that have an error.
  • Fixed: Unfinished multi-line comments are silently ignored.
  • Fixed: An inline comment nested inside a multi-line comment is erroneously treated as the end of the multi-line comment.
  • Fixed: Arrays of nilables produce false compilation errors.
  • Fixed: Shared constructor wants to initialize instance variables of reference types.
  • Fixed: In compile-time error recovery situations, there are extraneous warnings regarding the inherits operator and the passthrough type.
  • Fixed: Cobra internal error on mixin method collision.
  • Fixed: Poor error message for whitespace between method name and opening paren for a call.
  • Fixed: -test option doesn't handle @args -target:lib
  • Fixed: False compilation error for complex expressions involving indexing followed by calling (obj.foo[i]()).
  • Fixed: Internal error on some forward references.
  • Fixed: A program left unfinished in a parameter list results in a Cobra internal error.
  • Fixed: Line numbers mysteriously jump around during debugging. Has to do with local vars.
  • Library / Run-time:
  • Added new CobraCommand class to the std lib for conveniently finding and invoking the Cobra command line program from within Cobra.
  • New env vars COBRA_COMMAND_PATH and COBRA_EXE_PATH are supported. Old COBRA env var is not.
  • Split CobraCore.runAllTests into .runAppTests and .runAllTests.
  • Optimization: Add an In() run-time support overload for int arrays.
  • Fixed: Dynamic arithmetic operations throw an exception when used with small int types (int16 for example).
  • Fixed: CobraCore.findCobraExe can fail to find cobra.exe when run under sudo as in sudo mono foo.exe.
  • Command Line:
  • New -show-shared-data option used during compilation will output all shared/global data in the program.
  • Give a proper error message for -pkg: if the pkg-config command cannot be found.
  • The output from -timeit can be unreadable in some environments.
  • For -turbo, don't exclude trace statements anymore.
  • Added -embed-version compiler option. Embed a version string in the generated assembly. If version is not explicitly given, embed the current Cobra compiler version.
  • Installer:
  • Check for another error condition where the installer package has the same path as the install target.
  • Fixed: Fails awkwardly when placed at target directory.
  • Other:
  • Improved Samples/Sizes?.cobra.
  • dump-assembly.cobra
  • Moved from Source/ to Supplements/ as originally intended
  • Support reading a filename (rather than just a partial name or assembly name).

New in Cobra 0.9.2 (Nov 26, 2012)

  • Language:
  • Mixins
  • Mixins can now declare protected and private members.
  • Mixins can now be used as proper types, such as the type of a parameter.
  • Fixed: Cannot declare a mix-in inside a namespace.
  • Fixed: Mixins cannot use the from declaration from of properties.
  • The power-to operator as in base ** exponent is now supported.
  • All numeric types work.
  • Augmented assignment (**=) works.
  • For b ** e where both are ints, a negative int value for e will throw an InvalidOperationException. You can address this by casting either to a fractional type (number, decimal, float).
  • Division
  • Added //= for augmented assignment of integers with "integer division". This corresponds to the binary arithmetic operator //.
  • Added error check for using "augmented fractional division" to modify integers -
  • Cannot use fractional division (/=) to modify an integer. Use integer division (//=) instead.
  • Fixed: The operator //= for fractional types does not floor the result like // does, making the two operators inconsistent.
  • Added support for int literals outside a 32-bit range.
  • Inferred types are now int, uint, int64 and uint32.
  • Works for decimal and hexadecimal bases.
  • Added new error check: Cannot raise events for other objects.
  • Don't run the tests of referenced libraries by default.
  • Fixed: Test blocks in generic classes ignored.
  • Library:
  • In CobraCore, added .isRunningOnWindows and .isRunningOnMac.
  • In CobraCore, changed .isRunningOnMono and .isRunningOnUnix from properties to methods.
  • Moved IList.numbered up to IEnumerable.
  • Added .first, .take and .skip extension methods to IEnumerable.
  • Added the overload IEnumerable.numbered(start as int).
  • Command Line:
  • Enhanced -native-compiler to search the system PATH if the specified compiler could not be found by the Process class.
  • In cobra -about, print a warning if Cobra.Core.dll is not found next to cobra.exe.
  • Fixed: cobra -embed-run-time requires write perms to the install directory.
  • The -embed-run-time/-ert option now makes a local copy of Cobra.Core which is removed later.
  • Installer:
  • Support .NET 4.5 (actually released in Cobra 0.9.1)
  • Make the Windows-based install-from-workspace.bat robust against the user's starting directory.
  • Use the environment variables "PROGRAMFILES" and "ProgramW6432" instead of hard coding "\Program Files [(x86)]".
  • Other:
  • Advanced the JVM back-end (could still use open source volunteers).
  • Better reporting of column number in error messages.
  • Updated Notepad.cobra sample to .NET 4.0.
  • Added dump-assembly.cobra command line util in Supplements/.
  • Improvements to the online wiki.
  • There have been concurrent improvements to the MonoDevelop add-in for Cobra

New in Cobra 0.9.0 (Sep 29, 2012)

  • Language:
  • Enabled multiple test sections in methods and properties.
  • Added new try...catch...get expression.
  • Added support for namespace doc strings.
  • Added unpacking the new Pair classes with assignments and for loops.
  • Throw an UnpackException? for multi-target assignment (target1, target2 = source) if there is a mismatch in the number of source items and targets
  • Enhanced the treatment of == and between objects to fall back to a strongly type .equals method if a strongly typed .compareTo method is not available.
  • Added numeric literals like 45n for number and 45d for decimal. Previously, the d suffix required a decimal portion (45.0d) and there was no n suffix available.
  • Added recognition of the interfaces of primitive types such as int implementing IComparable.
  • Added proper support for DllImport also known as "P/Invoke".
  • Added local variable creation and type inference for out parameters in method calls.
  • New warnings
  • Do not use the identity operator "is" with an object literal. Use an equality operator such as "==" or "".
  • Cannot cast a string to a numeric type. Consider using "int.parse" or "int.tryParse". Use "@help int" for details.
  • Improved error checking and improved error messages.
  • Fixed various bugs.
  • Library:
  • Renamed "Cobra.Lang" to "Cobra.Core"
  • Added MultiList? class.
  • Added Pair and Pair clasess.
  • Improved the default formatting of the trace statement (which is also configurable).
  • Added CobraCore.operatingSystemDescription as String.
  • Added extension methods
  • interface IList - def addRange(items as System.Collections.IEnumerable)
  • interface IList - def addRange(items as IEnumerable); def pop as T
  • class Stack: def clone as Stack
  • class String -
  • def before(sep as String) as String
  • def after(sep as String) as String
  • def count(substring as String) as int
  • def limitLength(maxLength as int, suffix as String?) as String
  • def repeat(times as int) as String
  • def splitWords as List
  • Added CobraCore.htmlDecode, .urlEncode and .urlDecode.
  • Improved CobraCore.findCobraExe (changset:2473).
  • A Cobra.Compiler library is now always provided during installation.
  • Renamed "CobraInfo" to "CompileTimeInfo" and added .date and .subversionRevision.
  • Fixed various bugs.
  • Command Line:
  • Command line: -native-compiler: The absolute path to the native compiler is no longer required. A simple "csc.exe" or "dmcs" will suffice if it is in the system PATH.
  • Added -clr-platform option (like C#'s -platform option).
  • For "cobra -about", show the path that cobra.exe comes from.
  • Learning:
  • Added How To: Customize Object Equality.
  • Added Samples
  • Notepad for WPF
  • Gtk Source Editor
  • HexDump
  • Kickstarted Cobra Koans.
  • Expanded the wiki.
  • Continued discussion and support in the forums.
  • Other:
  • Added support for .NET 4.0.
  • Improved the output of the @help directive.
  • Improved the installer in numerous ways.
  • Expanded the test suite.
  • Advanced the JVM back-end (could still use open source volunteers).
  • Bumped the Mono requirement from 2.4 to 2.6 based on a survey about VM versions.