New Dart Editor build 0.4.2.5_r20193

520 views
Skip to first unread message

Eric Clayberg

unread,
Mar 19, 2013, 11:23:22 AM3/19/13
to mi...@dartlang.org
A new Dart Editor build is available at www.dartlang.org/editorChanges include:
  • New analyzer available via experimental preference.
    (work in progress, all features not enabled yet).
  • Package root preferences removed in favor of --package-root cmd line option.
  • Reduced heap usage by ~25%.
  • Fixed a memory leak which could eventually consume 10% of the heap.
Breaking Change List:
  • Wide-ranging changes:
    • All HTML callback APIs have been converted to Futures (with a few exceptions: RtcPeerConnection.getStats, Window.setImmediate, Window.requestAnimationFrame, Window.openDatabase, WorkerContext.openDatabase, and MutationObserver).

  • Name/functionality changes in corelib:
    • IOSink interface has changed. It now implements StringSink with the methods write,writeln, writeAll and writeCharCode for writing strings to an IOSink. As writing strings to an IOSink requires an encoding theIOSink now has en encoding property. Depending on what the IOSink is connected to this encoding property might be mutable. For the IOSink on HttpClientRequest and HttpResponse the encoding is determined from the "charset" parameter of the "Content-Type" header. The default in this case is ISO_8859_1.
      To match the write prefix of the methods on StringSink the add (for writing bytes) have been renamed to writeBytes and addStream has been renamed to writeStream.
    • StreamSink becomes EventSink, signalError becomes addError
    • num.floor(), .ceil(), .truncate(), .round() return integers now (even on doubles).
    • xMatching -> xWhere:
      Iterable.firstMatching -> Iterable.firstWhere
      Iterable.lastMatching -> Iterable.lastWhere
      Iterable.singleMatching -> Iterable.singleWhere
      Stream.firstMatching -> Stream.firstWhere
      Stream.lastMatching -> Stream.lastWhere
      Stream.singleMatching -> Stream.singleWhere
      Collection.removeMatching -> Collection.removeWhere
      Collection.retainMatching -> Collection.retainWhere
    • Timer.repeating -> Timer.periodic
    • Set.containsAll(Collection) -> Set.containsAll(Iterable)
    • Set.intersection(Collection) -> Set.intersection(Set)
    • Duration has a private variable now and its implicit interface cannot be implemented anymore without warnings.

  • Deprecations in corelib:
    • Set.isSubsetOf deprecated, to be removed.
    • List.getRange(start, length) deprecated, to be removed.
    • Iterable.min, Iterable.max, Stream.min, Stream.max deprecated, to be removed.

  • dart:html:
    • Rect has been renamed to CssRect, RgbColor has been renamed to CssRgbColor.
    • General-purpose Rect and Point classes have been added
    • APIs exposing ClientRect now expose Rect
    • Element.client* and Element.offset* properties have now become rects as well.The old syntax is currently deprecated.
      Old:
      var top = Element.clientTop;
      New:
      var top = Element.client.top;
    • Input events are having their position properties change from clientX & clientY to a single Point field. The old syntax is currently deprecated.
      Old:
      var x = mouseEvent.offsetX;
      New:
      var x = mouseEvent.offset.x;
    • CanvasRenderingContext.drawImage(canvas_OR_image_OR_video, num sx_OR_x, num sy_OR_y, [numsw_OR_width, num height_OR_sh, num dx, num dy, num dw, num dh]) has changed to two functions with more reasonable parameters:
      void drawImage(CanvasImageSource source, num destinationX, num destinationY) and
      void drawImageAtScale(CanvasImageSource source, Rect destinationRect, {Rect sourceRect})
      CanvasImageSource is one of ImageElement, VideoElement, or CanvasElement.
      The primary reason for this change is to make the method signature more understandable, while not reducing any functionality.
    • DirectoryEntry.getFile and DirectoryEntry.getDirectory have changed function signatures and added DirectoryEntry.createFile and DirectoryEntry.createDirectory methods.
    • The EventSource constructor, Notification constructor, and MutationObserver.observer have different signatures -- in all of these cases the Map argument now uses optional named parameters instead.
    • Window.requestFileSystem and WorkerContext.requestFileSystem have a slightly different signature. By default the user only needs to specify the desired file system size, and we will request temporary storage. The user can specify that they want permanent storage by setting a named optional parameter to true.

  • dart:io
    • The event stream from a WebSocket is now a stream of the messages (of type List<int> or type String). The close event is now the onDone on the stream with the close code and close reason available as properties on the WebSocket object.
    • The IOSink interface now implements StringSink. This renames addString to write, add to writeBytes and addStream to writeStream.

  • pub
    • Support for SDK packages (depending on a package directly from the locally-installed SDK) has been removed. All SDK packages are and have been available from pub.dartlang.org for months and almost all users should have moved over at this point so it shouldn’t affect many.
And as always,view the changelog for the full list of changes, and to get started with the Editor see our tutorial.

--
Eric Clayberg
Dart Editor Team
Google, Inc.

Moises Belchin

unread,
Mar 19, 2013, 11:37:55 AM3/19/13
to General Dart Discussion
We're waiting for this new release like these animals. :-D



Saludos.
Moisés Belchín.


2013/3/19 Eric Clayberg <clay...@google.com>

--
Consider asking HOWTO questions at Stack Overflow: http://stackoverflow.com/tags/dart
 
 

Jos Hirth

unread,
Mar 19, 2013, 11:53:46 AM3/19/13
to mi...@dartlang.org
Can we have another build which includes the changes from r20205?

Right now, mouse handling doesn't work correctly (Y = X) with the generated JavaScript.

http://dartbug.com/9261 - dart2js: mouse input broken (Y = X) in Chrome & Opera

Matthew Butler

unread,
Mar 19, 2013, 11:59:01 AM3/19/13
to mi...@dartlang.org
Excellent! One of the bug fixes I've been waiting for, which was not mentioned in the release notes is:
http://dartbug.com/9029

Session cookies are now forced to '/'

Matt

Moises Belchin

unread,
Mar 19, 2013, 12:08:23 PM3/19/13
to General Dart Discussion
Good work, the debugger now is very fast and the editor for my Win7 pro 32bit 4GB Ram only eats about 500MB. My system goes smoothly and it doesn't freeze.

thanks for work.


Saludos.
Moisés Belchín.


2013/3/19 Matthew Butler <butler....@gmail.com>

Seth Ladd

unread,
Mar 19, 2013, 12:58:51 PM3/19/13
to General Dart Discussion
Hi Jos,

Thanks for the head's up. I think I see that patch queued up for a cherry pick. Sorry about that buggy slipping through!

Seth


--

Don Olmstead

unread,
Mar 19, 2013, 1:03:20 PM3/19/13
to mi...@dartlang.org
Hey Seth did the WebGL fixes get in?

Jos Hirth

unread,
Mar 19, 2013, 1:15:38 PM3/19/13
to mi...@dartlang.org
On Tuesday, March 19, 2013 6:03:20 PM UTC+1, Don Olmstead wrote:
Hey Seth did the WebGL fixes get in?

Yes, the WebGL stuff was fixed with r20191.

r20193 (the rev of this build) merged that fix into trunk.

WebGL should work again.

John McCutchan

unread,
Mar 19, 2013, 1:29:38 PM3/19/13
to General Dart Discussion
WebGL is broken in checked mode.


John


--
Consider asking HOWTO questions at Stack Overflow: http://stackoverflow.com/tags/dart
 
 



--
John McCutchan <jo...@johnmccutchan.com>

Alex Tatumizer

unread,
Mar 19, 2013, 2:15:21 PM3/19/13
to mi...@dartlang.org
Speaking of floor, ceil, round etc
I found cute shortcuts:
print(5.2~/1); // 5 - floor
print(5.2~/1+1) // ceil

BTW, I tried use floor:
print(-5.2.floor()); // prints -5
but doc says returned value should be the greatest int NO GREATER than this one.
You can call me insane, but -5 looks to me greater than -5.2 (though slightly greater, so it's not a such a big deal :)
To check myself, I had to resort to complicated mental exercises, so if my conclusions are wrong, I apologize in advance.

Bernhard Pichler

unread,
Mar 19, 2013, 2:17:39 PM3/19/13
to mi...@dartlang.org
print(-5.2.floor()) means print(-(5.2.floor())). 

macdevign

unread,
Mar 19, 2013, 2:38:49 PM3/19/13
to mi...@dartlang.org

It will be great if the dart team could fix the autocompletion for top-level function ( eg print ) :) . The latest build still does not autocomplete some functions (eg print).  Will be good to have a more reliable and consistent autocomplete functionality at this point.

Alex Tatumizer

unread,
Mar 19, 2013, 3:15:59 PM3/19/13
to mi...@dartlang.org

> print(-5.2.floor()) means print(-(5.2.floor())).
What a disappoinment. I knew it was too good to be true.
BTW, my other discovery (that x~/1+1 is equivalent to ceil() is also wrong, because it doesn't apply to integer x.
And x~/1 is not a floor either. It's truncate.
3 discoveries - 3 errors. Bad day.

.. 

Eric Clayberg (Google)

unread,
Mar 19, 2013, 3:39:20 PM3/19/13
to mi...@dartlang.org
Code completion is currently undergoing a complete re-write and refactoring as part of our work on the new analysis engine. 

Charles Monteiro

unread,
Mar 19, 2013, 4:00:37 PM3/19/13
to mi...@dartlang.org
Hi Eric:

Just wanted to say hi. Just started to play with Dart and I"m happy to know that you are working on it.

-Charles
NYC Smalltalk

Craig R Ewert

unread,
Mar 19, 2013, 9:02:23 PM3/19/13
to mi...@dartlang.org
That seems like a language mistake to me.

Maybe I'm a mathematician, but I think -5.2 should be one token:
"-5.2" not two:
"-" "5.2" as you say it is.  Is there a compelling reason we don't have negative number literals?



print(-5.2.floor()) means print(-(5.2.floor())). 

Simon Pai

unread,
Mar 19, 2013, 9:51:38 PM3/19/13
to mi...@dartlang.org
Anyone experience a serious issue where you can't open any dart file? I am using Windows 7 and it fails to open any dart file, only showing the following stacktrace:

Could not open the editor: Editor could not be initialized.

java.lang.NoSuchMethodError: java.nio.CharBuffer.subSequence(II)Ljava/nio/CharBuffer;
    at com.google.dart.engine.scanner.CharBufferScanner.getString(CharBufferScanner.java:72)
    at com.google.dart.engine.scanner.AbstractScanner.tokenizeIdentifier(AbstractScanner.java:733)
    at com.google.dart.engine.scanner.AbstractScanner.tokenizeKeywordOrIdentifier(AbstractScanner.java:789)
    at com.google.dart.engine.scanner.AbstractScanner.bigSwitch(AbstractScanner.java:323)
    at com.google.dart.engine.scanner.AbstractScanner.tokenize(AbstractScanner.java:144)
    at com.google.dart.engine.internal.context.AnalysisContextImpl$1.accept(AnalysisContextImpl.java:587)
    at com.google.dart.engine.source.FileBasedSource.getContents(FileBasedSource.java:131)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.internalScan(AnalysisContextImpl.java:599)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.parse(AnalysisContextImpl.java:428)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.computeKindOf(AnalysisContextImpl.java:538)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.sourceAvailable(AnalysisContextImpl.java:624)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.applyChanges(AnalysisContextImpl.java:164)
    at com.google.dart.tools.ui.internal.text.editor.DartEditor.doSetInput(DartEditor.java:3118)
    at com.google.dart.tools.ui.internal.text.editor.CompilationUnitEditor.doSetInput(CompilationUnitEditor.java:1571)
    at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3200)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
    at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2642)
    at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3218)
    at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3245)
    at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:828)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:647)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
    at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
    at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
    at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
    at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
    at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
    at org.eclipse.ui.internal.PartStack.handleDeferredEvents(PartStack.java:1213)
    at org.eclipse.ui.internal.LayoutPart.deferUpdates(LayoutPart.java:400)
    at org.eclipse.ui.internal.PartSashContainer.handleDeferredEvents(PartSashContainer.java:1409)
    at org.eclipse.ui.internal.LayoutPart.deferUpdates(LayoutPart.java:400)
    at org.eclipse.ui.internal.WorkbenchPage.handleDeferredEvents(WorkbenchPage.java:1495)
    at org.eclipse.ui.internal.WorkbenchPage.deferUpdates(WorkbenchPage.java:1485)
    at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1459)
    at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1514)
    at org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:61)
    at org.eclipse.ui.internal.PartStack.close(PartStack.java:537)
    at org.eclipse.ui.internal.EditorStack.close(EditorStack.java:206)
    at org.eclipse.ui.internal.PartStack$1.close(PartStack.java:120)
    at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:83)
    at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:269)
    at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:278)
    at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access$1(DefaultTabFolder.java:1)
    at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder$1.closeButtonPressed(DefaultTabFolder.java:71)
    at org.eclipse.ui.internal.presentations.PaneFolder.notifyCloseListeners(PaneFolder.java:631)
    at org.eclipse.ui.internal.presentations.PaneFolder$3.close(PaneFolder.java:206)
    at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1598)
    at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:261)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at com.google.dart.tools.deploy.DartIDEApplication.start(DartIDEApplication.java:98)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

I think it's a Java 1.6/1.7 issue. (After a recent Java update on Windows 7 I somehow got both 1.6 and 1.7 installed in my machine. And changing the -Dosgi.requiredJavaVersion=1.6 to 1.7 will fail to even start the Dart Editor.)

Cheers,
Simon


On Tuesday, March 19, 2013 11:23:22 PM UTC+8, Eric Clayberg (Google) wrote:

Dan Grove

unread,
Mar 19, 2013, 10:51:24 PM3/19/13
to General Dart Discussion
this was fixed in https://code.google.com/p/dart/source/detail?r=20239 , which will be released in a new trunk build tomorrow (it's building now). With luck, you'll be able to pick up this build later tonight from http://gsdview.appspot.com/dart-editor-archive-trunk/latest/ 

Dan


--

Devon Carew

unread,
Mar 19, 2013, 10:56:58 PM3/19/13
to General Dart Discussion
this was fixed in https://code.google.com/p/dart/source/detail?r=20239 , which will be released in a new trunk build tomorrow (it's building now). With luck, you'll be able to pick up this build later tonight from http://gsdview.appspot.com/dart-editor-archive-trunk/latest/ 

To add to what Dan said, you can either download the build about to come out, or edit the editor.properties property file in your editor directory, and remove the "new_analyzer" line. This should let your current build start back up.

Devon



--
Devon Carew
Software Engineer
Google, Inc.

Alex Tatumizer

unread,
Mar 19, 2013, 11:12:54 PM3/19/13
to mi...@dartlang.org
After upgrade, experienced performance downgrade on Windows 7.
 setRange for List<int> for 65536 bytes retrieved by "listen" copied into fixed size List<int> -  takes 16 milliseconds.

My "reverse complement" exercise has to deal with moving target. I optimize one thing - another gets out of hand...

Maybe it has something to do with reduced buffer size mentioned in another thread?

Simon Pai

unread,
Mar 19, 2013, 11:21:57 PM3/19/13
to mi...@dartlang.org
Dan, Devon,

Good to know that. Thanks for the help!

Simon

Alex Tatumizer

unread,
Mar 20, 2013, 9:22:48 AM3/20/13
to mi...@dartlang.org
setRange problem is not easy to isolate, and even more difficult to explain.
In the context of "reverse-complement', it's almost always slow (but not in 100% cases).
When i run stripped-down test, it happens sometimes, but "sometimes" enough to make average look bad.
test(int iter) {
  Stopwatch w=new Stopwatch()..start();
  var buf=new List<int>(65536);
  for (int i=0; i<buf.length; i++)
    buf[i]=123;
  var buf1=new List<int>(65536);
  for (int i=0; i<iter; i++) {
    print("${w.elapsedMilliseconds}");  // shows some periods of 16 ms
    buf1.setRange(0, buf1.length, buf, 0);
  } 
  print("per int ${1000000*w.elapsedMilliseconds/(65536*iter)} ns");
  print("total time for run  ${w.elapsedMilliseconds} msec");
}
 
main() {
  test(100);
  test(100);
  test(1000);
  test(1000);
}

In the end, it prints average timing per int = 6 nanoseconds - which is, of course, nowhere near expected performance. Probably, something is happening periodically in the runtime, which is not necessarily related to setRange itself. 



Bob Nystrom

unread,
Mar 20, 2013, 12:10:53 PM3/20/13
to General Dart Discussion

On Tue, Mar 19, 2013 at 6:02 PM, Craig R Ewert <cr...@eeewert.org> wrote:
Maybe I'm a mathematician, but I think -5.2 should be one token:
"-5.2" not two:
"-" "5.2" as you say it is.  Is there a compelling reason we don't have negative number literals?

I know this was discussed by the language team a long time ago and the current behavior is deliberate, but I don't know if the rationale was ever written down anywhere.

My guess is that I think it would be more surprising if "-" behaved inconsistently between literal values and non-literals.

For example, I think most people would expect print(-bounds.left) to print the negated left bound, and not try to negate the bounds and then access its .left property. So from that, we can intuit that unary "-" should have lower precedence than ".".

If Dart had negative number literals then this:

print(-1.abs())

would print 1. But then lets say you decide to store that in a variable:

var a = -1;
print(-a.abs());

Now it would print -1, so the behavior has changed. I think this is case where you have two intuitions that are inconsistent with each other and the language just has to pick one. Dart picked consistency between literals and non-literals.

Cheers!

- bob

Alex Tatumizer

unread,
Mar 20, 2013, 12:26:49 PM3/20/13
to mi...@dartlang.org
@Bob: current rules are good, but there's a more convincing argument to show they are good.
Look at precedence rules:
Unary postfix  . , ?id, e++, e--, e1[e2], e1(), ()  Priority: 15

Unary prefix   -e, !e, ~e, ++e, --e                 Priority: 14

Current rules are easy to remember! Unary operator on the right is stronger than unary operator on the left. No exceptions.











Alex Tatumizer

unread,
Mar 20, 2013, 12:33:45 PM3/20/13
to mi...@dartlang.org
BTW, what is "?id" in the table above? Is it postfix? And what is "()" ? Is it postfix? how it's different from e1() , which is obviously postfix?
(I copied the above table from spec).












Bob Nystrom

unread,
Mar 20, 2013, 12:45:59 PM3/20/13
to General Dart Discussion
On Wed, Mar 20, 2013 at 9:33 AM, Alex Tatumizer <tatu...@gmail.com> wrote:
BTW, what is "?id" in the table above?

That is the "argument definition test" operator.
 
Is it postfix?

Prefix, unlike the ternary operator that uses "?" which is "mixfix".
 
And what is "()" ?

Function application.
 
Is it postfix? how it's different from e1() , which is obviously postfix?

Same thing. We don't usually think of "()" as a postfix expression, but from the grammar's perspective it is.

Cheers!

- bob

Alex Tatumizer

unread,
Mar 20, 2013, 12:56:13 PM3/20/13
to mi...@dartlang.org
If ?x is prefix, why it resides in a table row called "unary postfix" in the spec?


And what is "()" ?

Function application.

But in the same row in the spec, there's e1() - which is a function application, too, is it not?
I'm a bit confused.
Maybe rules are not as simple as I thought :-)


Bob Nystrom

unread,
Mar 20, 2013, 1:36:28 PM3/20/13
to General Dart Discussion
On Wed, Mar 20, 2013 at 9:56 AM, Alex Tatumizer <tatu...@gmail.com> wrote:
If ?x is prefix, why it resides in a table row called "unary postfix" in the spec?

It's just a label. The row name doesn't mean anything. (Actually the entire table is non-normative.)
 


And what is "()" ?

Function application.

But in the same row in the spec, there's e1() - which is a function application, too, is it not?
I'm a bit confused.

Oh I see your question now. () is grouping, e1() is application:

(a) // grouping
a() // application

- bob

Alex Tatumizer

unread,
Mar 20, 2013, 3:53:36 PM3/20/13
to mi...@dartlang.org
I checked performance of setRange for  Int8List, and it was tolerable (0.7 ns per byte ), so I can proceed with refactoring "reverse complement" with typed arrays. But it's still not clear what  happened with regular int lists in this release. I don't know whether I should create bug or not - please advice.

Dzenan Ridjanovic

unread,
Mar 20, 2013, 5:05:05 PM3/20/13
to mi...@dartlang.org

What's wrong with min and max ? 

 

From the API doc:

Deprecated. Use reduce with a binary min method if needed.


What is a binary min method?

Mike

unread,
Mar 20, 2013, 5:12:38 PM3/20/13
to mi...@dartlang.org
Hi Bob

The counter-examples you gave:
-1.abs() == 1
-a.abs() == -1 for a == -1
reflect the behaviour I would intuitively expect. I understand that the precedence is different in the two examples but there is a substantial difference after all between a negative sign before a variable name and one before a number. Btw, in languages where the item to be abs'd goes inside the brackets there is no such ambiguity.

Alex Tatumizer

unread,
Mar 20, 2013, 8:58:33 PM3/20/13
to mi...@dartlang.org
I was too quick to praise the performance of Uint8List setRange() method.
In a context of long-running (3 sec) application, it disappoints.
I'm nowhere near performance I had before last update.

Looking forward to future releases !!! :-)



Alex Tatumizer

unread,
Mar 21, 2013, 11:01:53 PM3/21/13
to mi...@dartlang.org
What this program is doing on the first and third iteration? Anybody knows? almost 3 sec? Is it a coffee break?

incTest() {
  Stopwatch w=new Stopwatch()..start();
  for (int i = 0; i < 50000000; ++i) {};
  print("time:  ${w.elapsedMilliseconds} msec");
}
  
main() {
  for (int i=0; i<10; i++)
     incTest();
}
time:  2934 msec
time:  76 msec
time:  2925 msec
time:  78 msec
time:  77 msec
time:  76 msec
time:  77 msec
time:  76 msec
time:  76 msec
time:  77 msec



Jos Hirth

unread,
Mar 21, 2013, 11:55:15 PM3/21/13
to mi...@dartlang.org
First iteration: Slow, because there is no on-stack replacement. It won't get replaced with a faster version.

Third iteration: No idea, but the very same thing happens on my machine.

Ladislav Thon

unread,
Mar 22, 2013, 5:15:07 AM3/22/13
to mi...@dartlang.org
First iteration: Slow, because there is no on-stack replacement. It won't get replaced with a faster version.

Third iteration: No idea, but the very same thing happens on my machine.

Maybe it deoptimizes for some reason? I believe there is a command line option to show deoptimizations...

LT
 


On Friday, March 22, 2013 4:01:53 AM UTC+1, Alex Tatumizer wrote:
What this program is doing on the first and third iteration? Anybody knows? almost 3 sec? Is it a coffee break?

incTest() {
  Stopwatch w=new Stopwatch()..start();
  for (int i = 0; i < 50000000; ++i) {};
  print("time:  ${w.elapsedMilliseconds} msec");
}
  
main() {
  for (int i=0; i<10; i++)
     incTest();
}
time:  2934 msec
time:  76 msec
time:  2925 msec
time:  78 msec
time:  77 msec
time:  76 msec
time:  77 msec
time:  76 msec
time:  76 msec
time:  77 msec



Craig R Ewert

unread,
Apr 18, 2013, 3:12:48 PM4/18/13
to mi...@dartlang.org

Thanks for the answer.  I guess we have different intuitions.  I see the '-' in -a and -5 as two different things, as the '()' in a() and (a) are different things. And the '.' In 4.3 and a.b .

--
Reply all
Reply to author
Forward
0 new messages