Cobra Changelog

What's new in Cobra 0.9.6

Dec 27, 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?.
  • 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.

New in Cobra 0.9.4 (May 27, 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.
  • There are more details in the doc strings. This will subsume the CobraCore.findCobraExe shared methods that do the same thing.
  • It is now easier to specify that you want the .exe and not just the cobra script (CobraCommand.find vs. CobraCommand.findExe).
  • 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.0 (Sep 27, 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.
  • Improved error checking and improved error messages.
  • Fixed various bugs.
  • 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.
  • 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 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.
  • Added extension methods:
  • interface IList
  • interface IList
  • class Stack: def clone as Stack
  • class String
  • 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.
  • Kickstarted Cobra Koans.
  • Expanded the wiki.
  • Continued discussion and support in the forums.
  • Added Samples:
  • Notepad for WPF
  • Gtk Source Editor
  • HexDump
  • 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.

New in Cobra 2010-10-18 (Oct 19, 2010)

  • Enhancements:
  • 2010-04-23) New -document-library or -doc-lib option to document libraries as opposed to source code.
  • Use like: cobra -doc-lib:System.Web
  • 2010-04-23) Doc generator improvements
  • Show values for constants.
  • Show events.
  • Show `out` and `inout` modifiers on parameter types.
  • Support indexers.
  • Highlight references to types.
  • Pick up styles from the current directory as well as the sibling ../styles/ directory.
  • 2010-05-01) Missing `inout` produces a C# error message rather than a Cobra error message. ticket:199 credit:hopscc
  • 2010-05-02) Added new overloads to String.split to take a single string rather than a character or an array of strings.
  • 2010-05-05) Improve error messages when in/out/inout arguments and parameters mismatch.
  • 2010-05-07) Improve error checking around capitalized local variables.
  • 2010-05-07) Improve error messages.
  • 2010-05-09) Suggest "print" when user attempts to use "puts" from Ruby.
  • 2010-05-10) Bump the Mono version requirement from 1.9 to 2.0 which was already in the docs and already effectively required. reported-by:themaniac
  • 2010-05-15) For dynamic-typed values, numeric promotion is now applied to comparisons the same way that is applied to arithmetic.
  • 2010-05-22) Added new sample: Simple English Parser.
  • 2010-06-01) Added a comment about a known exception when running unit tests on Windows on network drives.
  • 2010-06-05) Enumeration members can now be placed on the same line separated by commas. credit:hopscc
  • 2010-06-05) Improve -doc and -doc-type HTML output.
  • 2010-06-19) Made properties using `from var` search for a __name after _name. ticket:205 credit:hopscc
  • 2010-06-21) Reserved keyword "par" for parallel programming enhancements.
  • 2010-06-24) Improve the output of `ct_trace`.
  • 2010-07-02) Deprecate `$sharp(...)` in favor of `sharp'...'` and `sharp"..."`. ticket:207 credit:hopscc
  • 2010-07-02) Installer: Don't overwrite symbolic links. Fix bug in copying "cobra" into the path when it already exists. ticket:209 credit:nevdelap,Chuck.Esterbrook
  • 2010-07-04) Update copyright.
  • 2010-07-31) Print errors and warnings to stderr which is preferred by some IDEs and matches some other compilers.
  • 2010-07-31) Accommodate XNA library oddity where some method arguments have empty names ('').
  • 2010-07-31) Added new XNA How-To courtesy of Kurper. Can you outrun the dog?
  • 2010-08-23) Clarify -compile-if-needed in the cobra -help. In response to ticket:240
  • 2010-09-11) Structs have implicit parameterless initializers and do not allow explicit ones to be declared.
  • 2010-10-11) Improvements and fixes around Mono 2.8
  • 2010-10-13) Add a How-To for using OpenTK.
  • Fixes:
  • 2010-04-10) Fixed: Cannot directly refer to an open generic type such as `t = List`. ticket:192 reported-by:gauthier
  • 2010-04-22) Fixed: Missing error checks for `out` and `inout` being used on an indexer or property. reported-by:omar-syed
  • 2010-04-25) Fixed: `someEnum is nil` causes a run-time exception.
  • 2010-04-25) Fixed: `cobra -compile-if-needed ...` is broken on Mono only.
  • 2010-04-30) Fixed: Cannot access `libtcodWrapper.Console`.
  • 2010-05-01) Fixed: Failure to infer types related to System.Text.RegularExpressions (MatchCollection and GroupCollections items). ticket:163 credit:hopscc
  • 2010-05-05) Fixed: changeset:2304 caused a regression regarding the `void` type and member access.
  • 2010-05-07) Fixed: Cannot use a chained comparison (`0

New in Cobra 2010-04-02 (Apr 7, 2010)

  • (2010-03-25) Added new initializers for Set including the ability to take an IEqualityComparer.
  • (2010-03-19) Improvements to the How-To's.
  • (2010-03-19) Added ObjectLister utility class.
  • (2010-03-17) Improve some error messages from the C# backend.
  • (2010-03-12) An above error about numeric types indicates that you may want to set the default numeric type with "@number [expectedType]" in a source file or "cobra -number:[expectedType]" at the command line.
  • (2010-03-10) Make stackoverflow handling more robust. Stack overflow handling is in effect when -detailed-stack-trace is on.
  • (2010-03-05) Add test cases for concatenation of dynamic vars.
  • (2010-02-28) Added -test-runner command line option to specify the method to invoke to run the unit tests.
  • (2010-02-27) Use the new Cobra.Lang.Test.TestRunner for running inline unit tests.
  • Fix some test cases from the last checkin.
  • (2010-02-26) Added new Cobra.Lang.Test namespace with TestRunner, TestSuite, Test and related classes.
  • (2010-02-13) Improved error recovery. Avoid an uncaught exception in the compiler.
  • Unfortunately, I do not have a new (self contained, small) test case for this.
  • Existing test cases pass.
  • (2009-12-12) Remove Cobra's explicit following of assembly references. Read assembly dependencies on demand from encountered types.
  • reported-by:gauthier
  • (2009-12-09) Added -verbosity-ref option to output information about resolving references to libraries.
  • (2009-11-29) Add STAThread which is the normal approach for WinForms programs.
  • (2009-11-23) Better error recovery for slicing.
  • credit:eric.sellon,Chuck
  • (2009-11-22) Make le.cobra more robust.
  • (2009-11-14) Add ability to comment a testify .skip. directive.
  • Add .skip. to two test cases.
  • (2009-11-08) Added .clone to ISet.
  • (2009-11-07) Improved error checking for `print to dest` block format.
  • (2009-11-05) TestifyRunner cleanup.
  • ticket:186
  • credit:hopscc,Chuck
  • (2009-11-05) Added svn:eol-style = native
  • (2009-11-05) Catch assignments to read-only properties and indexers.
  • ticket:75
  • credit:eric.sellon
  • (2009-11-02) Added support for chain comparisons such as `0