Git Product home page Git Product logo

going-deep-with-dart's People

Contributors

i-zanis avatar vandadnp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

going-deep-with-dart's Issues

Some Questions about the generated codes

Hi, dear Vandad!

I have some questions about the dart compilers that I thought this repository would be a great place to speak about it and document for others.

  1. As you know in the dart JIT/AOT compiler we can pass definitions via --define=<key>=<value> option. Now my question is the below code snnipts.
// JIT compiler
// $ dart --define=name=ehsan main.dart
var definition = String.fromEnvironment('name');
print(definition); // ehsan

but in AOT compilation value isn't accessible, if the variable type qualifier be var and should be const

// AOT compiler
// $ dart compile exe --define=name=ehsan -o main main.dart; ./main
var definition = String.fromEnvironment('name'); // also `bool.hasEnvironment('name')` returns false
print(definition); // '' empty String, false boolean, 0 int

Actully my question is what happen in generated code that makes this difference in AOT and JIT compilation?

  1. Is platform checking will happen in runtime? (in AOT compilation)
// the is<platform> static variables also use this getter
 switch (Platform.operatingSystem) {
   case 'linux':
     // do something linux
     break;
   case 'macos':
     // do something in mac
     break;
   // and so on...
 }

corrections for issue 3

The section for loops over variable iterables misinterprets the meaning of call qword [rax+rcx*8+0x60], this is how interface calls work in the code produced by Dart AOT compiler. We use an approach called "global dispatch table". In the sequence above rax would be a pointer to the dispatch table, rcx would be class id of the receiver object and 0x60 is a selector id (which determines which virtual method we are looking up).

Based on the call sequence I'd say this is an invocation of get current on the iterator object which is implicitly created by the for-in loops.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.