Last update July 14, 2009

Tango Workshop Results



The results of the Workshop

Language standardization over Compilers

Spec bugs

ABI

ABI still has omissions and contradictions. In particular:

  • classes
    • does not mention nested classes and classes implementing interfaces at all
    • the last part about classes is unclear, in particular the "Generates the following:" list.
  • interfaces not documented
  • parameter passing calling convention spec is contradictory and unclear, Issue:2320 has some info
    • would be nice to have the parameter passing order spelled out more directly in terms of the x86 stack
  • exception handling is not documented
  • module initialization is not documented
  • unittesting is not documented
ABI specification for non-x86 targets is required as compilers become available for these.

In reality much of this info has limited usefulness. Different compilers have different runtime implementations and DMD's runtime is written in a non portable, x86 specific way. Other compilers that support more platforms/architectures will most like change the prototypes of the runtime functions to avoid having to maintain several runtime implementations (besides some version blocks). Native object files compiled by different compilers will call into the respective runtime implementations of the compiler that generated them and expect a specific function signature for each of these calls, unless these match 100% across, which as said is highly unlikely, the code might link but will crash.

What is useful is implementing the same calling convention and storage layout for things, so that inline assembly blocks will work across different compilers, but for the same CPU architecture.

nested classes/functions

not always clear/defined when one gets a stack frame pointer and when a class/object pointer.

IFTI

exact rules for implicit instantiation of templates not defined

Spec wishes

vararg

generally messy, still needed for classes/virtual methods method to pass on the arguments without writing two functions would be very welcome

lindquist: I made a proposal for this a long time ago, it's not hard to implement (and the proposal is imperfect, but should get the message across, I can rewrite it if there's interest) NG:digitalmars.D/62140

probably a good solution is pushing *all* args on the stack, to be clean TypeInfo?.alignoft would be needed.

The ABI contradictions could easily be fixed if the caller just passes a pointer to the varargs instead of pushing them as variadic params, this is also much easier to handle in a multi-platform compiler.

dmd doesn't follow spec for extern(C) varargs: Issue:937

length in array slices

should not mean the array length, but a local variable length, for array length $ is available

overloading 1

overloading and aliases, (it should not get the first symbol)

overloading 2

overloading and subclasses don't play well together: {{{
	class A{}
	f(A,int){} f(A,long){}
	class B:A{}
	B b;
	f(b,1); // does not work, f(cast(A)b,1); is needed
}}}

interfaces to objects

implicit cast of interfaces to Object should work (COM is the only exception, and it makes code much uglier)

non-typed associative arrays

Sometimes associative arrays are used as hashsets and can be sped up and optimized for such, a syntactic sugar to support this would be nice: [type] varname;

Runtime features

  • callback for allocation
  • default implementation for stack trace
  • fast locks (as per Bartosz)
  • Fibers

Common runtime

common runtime a good idea, tango mostly better for D1.0. Main problem someone has to do the work to make it happen, and both sides then should not discurage the effort

actual status wrt. druntime was not known, see DsourceProject:tango/forums/topic/615

FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: July 14, 2009 5:14 (diff))