Walkthrough of the following script (v8:6573).
var logFoo;
var promise1 = Promise.resolve().then( () => logFoo = () => console.log( "foo" ) );
promise1.then( () => logFoo() ).then( logFoo );
// Automatic FlutterFlow imports | |
import '/backend/backend.dart'; | |
import '/backend/schema/structs/index.dart'; | |
import '/flutter_flow/flutter_flow_theme.dart'; | |
import '/flutter_flow/flutter_flow_util.dart'; | |
import '/custom_code/actions/index.dart'; // Imports other custom actions | |
import '/flutter_flow/custom_functions.dart'; // Imports custom functions | |
import 'package:flutter/material.dart'; | |
// Begin custom action code | |
// DO NOT REMOVE OR MODIFY THE CODE ABOVE! |
/** | |
* Simple and educational `malloc` implementation. | |
* | |
* Dmitry Soshnikov <[email protected]> | |
* | |
* Maintains explicit linked list of allocated memory blocks. Each block | |
* has a header, containing meta-information, such as whether a block is | |
* free, its size, and a reference to the next block. | |
* | |
* Homework assignments: |
Cancellation follows a source -> sink model and consists of three components: Source, Sink, and Signal.
CancellationSource
.CancellationToken
.(module | |
(func $addTwo (param i32 i32) (result i32) | |
(i32.add | |
(get_local 0) | |
(get_local 1))) | |
(export "addTwo" (func $addTwo))) |
Yes, this is a very significant departure from web workers, the current browser concurrency model. But I feel the lower level, more tightly integrated nature of it will make it far faster and lighter in practice, while still avoiding some significant footguns and working with the traditional single-threaded nature of JavaScript. Additionally, raw objects are much easier to deal with than pure message passing with workers.
So here's my idea:
// parent.js
#!/usr/bin/env python | |
import rospy | |
import mavros | |
from geometry_msgs.msg import PoseStamped | |
from mavros.msg import State | |
from mavros.srv import CommandBool, SetMode | |
# callback method for state sub | |
current_state = State() |
import React, { Component } from 'react'; | |
import storeDecorator from './store-decorator'; | |
import someStore, { SOME_STORE_SYMBOL } from './some-reflux-store'; | |
@storeDecorator(someStore) | |
class SomeComponent extends Component { | |
render() { | |
return ( | |
<div> | |
{this.state[SOME_STORE_SYMBOL].someProperty} |
Re: http://blog.chromium.org/2015/03/new-javascript-techniques-for-rapid.html
As mentioned in our Chromium blog post, Chrome 41 introduces support for streaming parsing of JavaScript files using the async
or defer
attributes. This is where the V8 parser will parse any incoming JavaScript piece-by-piece so the compiler can immediately begin compiling the AST when script loading has completed. This lets us do something useful while waiting for the page to load. Compare:
This means parsing can be removed from the critical path when loading up the page. In these cases such scripts are parsed on a separate thread as soon as the download begins, allowing parsing to complete very soon after the download has completed (milliseconds), leading to pages (potentially) loading much faster.
const CANCEL = Symbol(); | |
class CancellationToken { | |
constructor() { | |
this.cancelled = false; | |
} | |
throwIfCancelled() { | |
if (this.isCancelled()) { |