V2EX 首页   注册   登录
 dtysky 最近的时间轴更新
ONLINE

dtysky

自由地看待世界,真诚地看待自己。
  •   Bilibili / 前端工程师
  •   V2EX 第 113030 号会员,加入于 2015-04-23 22:00:17 +08:00,今日活跃度排名 5913
    我是一个好人。
    编译 TypeScript、C++和 Rust 到 WebAssembly
    JavaScript  •  dtysky  •  20 天前  •  最后回复来自 dtysky
    4
    Bilibili《七夕之约 - Double;7》技术剖析
  •  2   
    程序员  •  dtysky  •  145 天前  •  最后回复来自 LaserUFO
    1
    毕业这两年
  •  2   
    程序员  •  dtysky  •  167 天前  •  最后回复来自 Plsea
    33
    BlogReworkPro - 一个 SEO 友好的 SPA,相关 React 全家桶, FLASK,服务端渲染
  •  1   
    程序员  •  dtysky  •  2016-10-14 21:06:23 PM  •  最后回复来自 chux0519
    10
    这种图片是怎样实现的?
    程序员  •  dtysky  •  2016-09-06 13:03:54 PM  •  最后回复来自 pysama
    13
    MoeNotes v0.9 发布:更新 Lolita 主题并添加 PDF/HTML 导出功能
    程序员  •  dtysky  •  2016-07-08 11:30:27 AM  •  最后回复来自 sumuu
    2
    是舍弃的还不够多么
  •  1   
    职场话题  •  dtysky  •  2016-07-05 11:51:52 AM  •  最后回复来自 zhonghua
    73
    撸了个笔记 APP
    程序员  •  dtysky  •  2016-05-20 15:31:13 PM  •  最后回复来自 popfeng
    4
    诸君自己的开源软件下载包一般放在哪?
    程序员  •  dtysky  •  2016-05-15 17:12:57 PM  •  最后回复来自 zmr90
    13
    dtysky 最近回复了
    7 天前
    回复了 mb135 创建的主题 程序员 猿们,还记得前几年火热的 nosql 吗?
    这叫螺旋上升,条件有了,以前做不好的就可以做好了

    至于理念么,工程界玩的大都是学界上个阶段的东西,没什么好说的,很多年翻来覆去也很正常

    需求才是一切,需要什么用什么
    游戏引擎
    Error Correction

    One of the most hotly contested religious wars in the JS community (besides tabs vs. spaces) is whether to rely heavily/exclusively on ASI or not.

    Most, but not all, semicolons are optional, but the two ;s in the for ( .. ) .. loop header are required.

    On the pro side of this debate, many developers believe that ASI is a useful mechanism that allows them to write more terse (and more "beautiful") code by omitting all but the strictly required ;s (which are very few). It is often asserted that ASI makes many ;s optional, so a correctly written program without them is no different than a correctly written program with them.

    On the con side of the debate, many other developers will assert that there are too many places that can be accidental gotchas, especially for newer, less experienced developers, where unintended ;s being magically inserted change the meaning. Similarly, some developers will argue that if they omit a semicolon, it's a flat-out mistake, and they want their tools (linters, etc.) to catch it before the JS engine corrects the mistake under the covers.

    Let me just share my perspective. A strict reading of the spec implies that ASI is an "error correction" routine. What kind of error, you may ask? Specifically, a parser error. In other words, in an attempt to have the parser fail less, ASI lets it be more tolerant.

    But tolerant of what? In my view, the only way a parser error occurs is if it's given an incorrect/errored program to parse. So, while ASI is strictly correcting parser errors, the only way it can get such errors is if there were first program authoring errors -- omitting semicolons where the grammar rules require them.

    So, to put it more bluntly, when I hear someone claim that they want to omit "optional semicolons," my brain translates that claim to "I want to write the most parser-broken program I can that will still work."

    I find that to be a ludicrous position to take and the arguments of saving keystrokes and having more "beautiful code" to be weak at best.

    Furthermore, I don't agree that this is the same thing as the spaces vs tabs debate -- that it's purely cosmetic -- but rather I believe it's a fundamental question of writing code that adheres to grammar requirements vs. code that relies on grammar exceptions to just barely skate through.

    Another way of looking at it is that relying on ASI is essentially considering newlines to be significant "whitespace." Other languages like Python have true significant whitespace. But is it really appropriate to think of JavaScript as having significant newlines as it stands today?

    My take: use semicolons wherever you know they are "required," and limit your assumptions about ASI to a minimum.
    这种事吧,咋说呢,喜欢你的不会因为这点介意,自己不邋遢干散就行了
    在下穿衣风格属于突变型的,夏天 COSPA 彩色宅 T,冬天全身休闲正装+衬衫,妹子也没说什么(逃
    @xwhxbg 这两个都是可以逆向的,只是相对安全点罢了
    @bombless 那你试试 rust 的 yew 吧 2333
    20 天前
    回复了 dtysky 创建的主题 JavaScript 编译 TypeScript、C++和 Rust 到 WebAssembly
    @zhouheyang0919
    嗯,昨儿有人提了个 issue,我早上加到说明里了

    Now, rustc supports another method to generate pure wasm file, please see here for resolution: [Rust for the Web]( https://www.hellorust.com/setup/wasm-target/):

    ```bash
    rustc --target wasm32-unknown-unknown yourCode.rs -o yourCode.wasm
    ```

    For reducing the size of file, your need to install **wasm-gc**:

    ```bash
    cargo install --git https://github.com/alexcrichton/wasm-gc
    wasm-gc yourCode.wasm small-yourCode.wasm
    ```
    2017: open shit
    2018: opeb source
    webcv 有可能不?
    28 天前
    回复了 IC0ZB 创建的主题 程序员 程序员的一生要经历多少苦难?救救我吧
    人生除死无大事,加油
    DigitalOcean
    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   鸣谢   ·   2017 人在线   最高记录 3541   ·  
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.0 · 34ms · UTC 14:03 · PVG 22:03 · LAX 06:03 · JFK 09:03
    ♥ Do have faith in what you're doing.
    沪ICP备16043287号-1